41 lines
1.1 KiB
Python
41 lines
1.1 KiB
Python
"""Add user support.
|
|
|
|
Revision ID: 1232daf66ac
|
|
Revises: 144929e0f5f
|
|
Create Date: 2015-08-31 10:24:40.578432
|
|
|
|
"""
|
|
|
|
# pylint: disable=no-member
|
|
|
|
# revision identifiers, used by Alembic.
|
|
# pylint: disable=invalid-name
|
|
revision = '1232daf66ac'
|
|
down_revision = '144929e0f5f'
|
|
# pylint: enable=invalid-name
|
|
|
|
# pylint: disable=wrong-import-position
|
|
from alembic import op # noqa
|
|
import sqlalchemy as sa # noqa
|
|
# pylint: enable=wrong-import-position
|
|
|
|
|
|
def upgrade():
|
|
"""Upgrades for revision 1232daf66ac"""
|
|
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)
|
|
|
|
|
|
def downgrade():
|
|
"""Downgrades for revision 1232daf66ac"""
|
|
op.drop_index(op.f('ix_user_email'), table_name='user')
|
|
op.drop_table('user')
|