user authentication

This commit is contained in:
2020-07-03 15:10:47 +03:00
parent 9805d64bac
commit 19b584cbe7
6 changed files with 149 additions and 24 deletions

@@ -0,0 +1,39 @@
"""add users table
Revision ID: d0915c4b79cd
Revises: 60a6132e925b
Create Date: 2020-07-03 14:14:52.140939
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd0915c4b79cd'
down_revision = '60a6132e925b'
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('name', sa.String(length=100), nullable=True),
sa.Column('username', sa.String(length=50), nullable=False),
sa.Column('email', sa.String(length=100), nullable=False),
sa.Column('password_hash', sa.String(length=100), nullable=False),
sa.Column('created_on', sa.DateTime(), nullable=True),
sa.Column('updated_on', sa.DateTime(), nullable=True),
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 ###