39d94b1c082b_user_add_discord_id.py 622 B

1234567891011121314151617181920212223242526
  1. """user_add_discord_id
  2. Revision ID: 39d94b1c082b
  3. Revises: c1d7ddb101a1
  4. Create Date: 2019-04-25 07:07:10.028304
  5. """
  6. from alembic import op
  7. import sqlalchemy as sa
  8. # revision identifiers, used by Alembic.
  9. revision = '39d94b1c082b'
  10. down_revision = 'c1d7ddb101a1'
  11. branch_labels = None
  12. depends_on = None
  13. def upgrade():
  14. op.add_column('user', sa.Column('discord_id', sa.BigInteger(), nullable=True))
  15. op.create_unique_constraint(op.f('uq_user_discord_id'), 'user', ['discord_id'])
  16. def downgrade():
  17. op.drop_constraint(op.f('uq_user_discord_id'), 'user', type_='unique')
  18. op.drop_column('user', 'discord_id')