1234567891011121314151617181920212223242526272829303132 |
- """add_code
- Revision ID: c1d7ddb101a1
- Revises: 3d9ba6086a23
- Create Date: 2019-04-01 17:23:32.312946
- """
- from alembic import op
- import sqlalchemy as sa
- # revision identifiers, used by Alembic.
- revision = 'c1d7ddb101a1'
- down_revision = '3d9ba6086a23'
- branch_labels = None
- depends_on = None
- def upgrade():
- op.create_table('code',
- sa.Column('id', sa.Integer(), nullable=False),
- sa.Column('expire_date', sa.DateTime(), nullable=True),
- sa.Column('secret', sa.String(length=255), nullable=True),
- sa.PrimaryKeyConstraint('id', name=op.f('pk_code')),
- sa.UniqueConstraint('secret', name=op.f('uq_code_secret'))
- )
- op.drop_constraint('user_email_key', 'user', type_='unique')
- def downgrade():
- op.create_unique_constraint('user_email_key', 'user', ['email'])
- op.drop_table('code')
|