Add user model.

This commit is contained in:
Alexis Lahouze 2015-08-31 10:55:05 +02:00
parent 3c918b8fc2
commit 808d4b6621
1 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,34 @@
"""Add user support.
Revision ID: 1232daf66ac
Revises: 144929e0f5f
Create Date: 2015-08-31 10:24:40.578432
"""
# revision identifiers, used by Alembic.
revision = '1232daf66ac'
down_revision = '144929e0f5f'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.create_table('user',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('email', sa.String(length=200), nullable=False),
sa.Column('password', sa.String(length=100), nullable=True),
sa.Column('active', sa.Boolean(), server_default=sa.text('true'), nullable=False),
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_user_email'), 'user', ['email'], unique=True)
### end Alembic commands ###
def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_user_email'), table_name='user')
op.drop_table('user')
### end Alembic commands ###