96951df04b3b_player_id_to_biginteger.py 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. """player id to biginteger
  2. Revision ID: 96951df04b3b
  3. Revises: 82a809b72bf3
  4. Create Date: 2019-09-04 13:09:22.495778
  5. """
  6. from alembic import op
  7. import sqlalchemy as sa
  8. # revision identifiers, used by Alembic.
  9. revision = '96951df04b3b'
  10. down_revision = '82a809b72bf3'
  11. branch_labels = None
  12. depends_on = None
  13. def upgrade():
  14. op.alter_column('department_stat', 'player_id',
  15. existing_type=sa.INTEGER(),
  16. type_=sa.BigInteger(),
  17. existing_nullable=True)
  18. op.alter_column('factory', 'player_id',
  19. existing_type=sa.INTEGER(),
  20. type_=sa.BigInteger(),
  21. existing_nullable=True)
  22. op.alter_column('military_academy', 'player_id',
  23. existing_type=sa.INTEGER(),
  24. type_=sa.BigInteger(),
  25. existing_nullable=True)
  26. op.alter_column('player', 'id',
  27. existing_type=sa.INTEGER(),
  28. type_=sa.BigInteger(),
  29. autoincrement=True,
  30. existing_server_default=sa.text("nextval('player_id_seq'::regclass)"))
  31. op.alter_column('player_location', 'player_id',
  32. existing_type=sa.INTEGER(),
  33. type_=sa.BigInteger(),
  34. existing_nullable=True)
  35. op.alter_column('player_party', 'player_id',
  36. existing_type=sa.INTEGER(),
  37. type_=sa.BigInteger(),
  38. existing_nullable=True)
  39. op.alter_column('player_residency', 'player_id',
  40. existing_type=sa.INTEGER(),
  41. type_=sa.BigInteger(),
  42. existing_nullable=True)
  43. def downgrade():
  44. op.alter_column('player_residency', 'player_id',
  45. existing_type=sa.BigInteger(),
  46. type_=sa.INTEGER(),
  47. existing_nullable=True)
  48. op.alter_column('player_party', 'player_id',
  49. existing_type=sa.BigInteger(),
  50. type_=sa.INTEGER(),
  51. existing_nullable=True)
  52. op.alter_column('player_location', 'player_id',
  53. existing_type=sa.BigInteger(),
  54. type_=sa.INTEGER(),
  55. existing_nullable=True)
  56. op.alter_column('player', 'id',
  57. existing_type=sa.BigInteger(),
  58. type_=sa.INTEGER(),
  59. autoincrement=True,
  60. existing_server_default=sa.text("nextval('player_id_seq'::regclass)"))
  61. op.alter_column('military_academy', 'player_id',
  62. existing_type=sa.BigInteger(),
  63. type_=sa.INTEGER(),
  64. existing_nullable=True)
  65. op.alter_column('factory', 'player_id',
  66. existing_type=sa.BigInteger(),
  67. type_=sa.INTEGER(),
  68. existing_nullable=True)
  69. op.alter_column('department_stat', 'player_id',
  70. existing_type=sa.BigInteger(),
  71. type_=sa.INTEGER(),
  72. existing_nullable=True)