9524fe8e91f0_remove_telegram_verification.py 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. """remove telegram verification
  2. Revision ID: 9524fe8e91f0
  3. Revises: 97d0cf5e4bb0
  4. Create Date: 2020-02-11 00:03:26.671954
  5. """
  6. from alembic import op
  7. import sqlalchemy as sa
  8. from sqlalchemy.dialects import postgresql
  9. # revision identifiers, used by Alembic.
  10. revision = '9524fe8e91f0'
  11. down_revision = '97d0cf5e4bb0'
  12. branch_labels = None
  13. depends_on = None
  14. def upgrade():
  15. op.drop_table('telegram_verification')
  16. def downgrade():
  17. op.create_table('telegram_verification',
  18. sa.Column('player_id', sa.BIGINT(), autoincrement=False, nullable=False),
  19. sa.Column('telegram_id', sa.BIGINT(), autoincrement=False, nullable=False),
  20. sa.Column('code', sa.VARCHAR(), autoincrement=False, nullable=True),
  21. sa.Column('date_time', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
  22. sa.Column('confirmed', sa.BOOLEAN(), server_default=sa.text('false'), autoincrement=False, nullable=True),
  23. sa.ForeignKeyConstraint(['player_id'], ['player.id'], name='fk_telegram_verification_player_id_player'),
  24. sa.ForeignKeyConstraint(['telegram_id'], ['telegram_account.id'], name='fk_telegram_verification_telegram_id_telegram_account'),
  25. sa.PrimaryKeyConstraint('player_id', 'telegram_id', name='pk_telegram_verification')
  26. )