c1d7ddb101a1_add_code.py 682 B

123456789101112131415161718192021222324252627282930
  1. """add_code
  2. Revision ID: c1d7ddb101a1
  3. Revises: 3d9ba6086a23
  4. Create Date: 2019-04-01 17:23:32.312946
  5. """
  6. from alembic import op
  7. import sqlalchemy as sa
  8. # revision identifiers, used by Alembic.
  9. revision = 'c1d7ddb101a1'
  10. down_revision = '3d9ba6086a23'
  11. branch_labels = None
  12. depends_on = None
  13. def upgrade():
  14. op.create_table('code',
  15. sa.Column('id', sa.Integer(), nullable=False),
  16. sa.Column('expire_date', sa.DateTime(), nullable=True),
  17. sa.Column('secret', sa.String(length=255), nullable=True),
  18. sa.PrimaryKeyConstraint('id', name=op.f('pk_code')),
  19. sa.UniqueConstraint('secret', name=op.f('uq_code_secret'))
  20. )
  21. def downgrade():
  22. op.drop_table('code')