d9b4e754a98e_change_wp_primary_key.py 725 B

1234567891011121314151617181920212223242526
  1. """change wp primary key
  2. Revision ID: d9b4e754a98e
  3. Revises: 95e16c281a76
  4. Create Date: 2020-04-09 17:45:28.103910
  5. """
  6. from alembic import op
  7. import sqlalchemy as sa
  8. # revision identifiers, used by Alembic.
  9. revision = 'd9b4e754a98e'
  10. down_revision = '95e16c281a76'
  11. branch_labels = None
  12. depends_on = None
  13. def upgrade():
  14. op.drop_constraint('pk_state_work_permit', 'state_work_permit', type_='primary')
  15. op.create_primary_key('pk_state_work_permit', 'state_work_permit', ['state_id', 'player_id', 'from_date_time'])
  16. def downgrade():
  17. op.drop_constraint('pk_state_work_permit', 'state_work_permit', type_='primary')
  18. op.create_primary_key('pk_state_work_permit', 'state_work_permit', ['state_id', 'player_id'])