accountant/migrations/versions/1232daf66ac_add_user_support.py

35 lines
983 B
Python
Raw Normal View History

2015-08-31 10:55:05 +02:00
"""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 ###