Переход на postgresql

This commit is contained in:
2021-08-18 19:23:19 +03:00
parent 4e4eb9bfed
commit 60402fef94
10 changed files with 235 additions and 5 deletions

View File

@@ -0,0 +1,40 @@
"""empty message
Revision ID: 3ca17c6fd061
Revises:
Create Date: 2021-08-18 19:13:48.248213
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '3ca17c6fd061'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('users',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('email', sa.String(), nullable=False),
sa.Column('password', sa.String(), nullable=False),
sa.Column('username', sa.String(), nullable=False),
sa.Column('registered_on', sa.DateTime(), nullable=False),
sa.Column('last_login', sa.DateTime(), nullable=True),
sa.Column('is_confirmed', sa.Boolean(), nullable=False),
sa.Column('is_admin', sa.Boolean(), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('email'),
sa.UniqueConstraint('username')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('users')
# ### end Alembic commands ###