431b9069abfc_update_resource_track.py 837 B

12345678910111213141516171819202122232425262728
  1. """update_resource_track
  2. Revision ID: 431b9069abfc
  3. Revises: 931dee70fc71
  4. Create Date: 2019-08-21 17:46:47.853150
  5. """
  6. from alembic import op
  7. import sqlalchemy as sa
  8. # revision identifiers, used by Alembic.
  9. revision = '431b9069abfc'
  10. down_revision = '931dee70fc71'
  11. branch_labels = None
  12. depends_on = None
  13. def upgrade():
  14. op.add_column('resource_stat', sa.Column('limit_left', sa.SmallInteger(), nullable=True))
  15. op.drop_column('resource_stat', 'percentage_total')
  16. op.drop_column('resource_stat', 'percentage_explored')
  17. def downgrade():
  18. op.add_column('resource_stat', sa.Column('percentage_explored', sa.SMALLINT(), autoincrement=False, nullable=True))
  19. op.add_column('resource_stat', sa.Column('percentage_total', sa.SMALLINT(), autoincrement=False, nullable=True))
  20. op.drop_column('resource_stat', 'limit_left')