university-final-iot-backend/migrations/versions/7e9220844b2f_.py

35 lines
1.1 KiB
Python

"""empty message
Revision ID: 7e9220844b2f
Revises: eeb3e64b76c4
Create Date: 2018-05-03 16:58:10.100904
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7e9220844b2f'
down_revision = 'eeb3e64b76c4'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('accounts', sa.Column('email', sa.String(), nullable=True))
op.create_index(op.f('ix_accounts_email'), 'accounts', ['email'], unique=True)
op.drop_index('ix_accounts_emails', table_name='accounts')
op.drop_column('accounts', 'emails')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('accounts', sa.Column('emails', sa.VARCHAR(), autoincrement=False, nullable=True))
op.create_index('ix_accounts_emails', 'accounts', ['emails'], unique=True)
op.drop_index(op.f('ix_accounts_email'), table_name='accounts')
op.drop_column('accounts', 'email')
# ### end Alembic commands ###