64a70a7aab8b_add_workflow_run_index.py 888 B

123456789101112131415161718192021222324252627282930313233
  1. """add workflow run index
  2. Revision ID: 64a70a7aab8b
  3. Revises: 03f98355ba0e
  4. Create Date: 2024-05-28 12:32:00.276061
  5. """
  6. from alembic import op
  7. import models as models
  8. # revision identifiers, used by Alembic.
  9. revision = '64a70a7aab8b'
  10. down_revision = '03f98355ba0e'
  11. branch_labels = None
  12. depends_on = None
  13. def upgrade():
  14. # ### commands auto generated by Alembic - please adjust! ###
  15. with op.batch_alter_table('workflow_runs', schema=None) as batch_op:
  16. batch_op.create_index('workflow_run_tenant_app_sequence_idx', ['tenant_id', 'app_id', 'sequence_number'], unique=False)
  17. # ### end Alembic commands ###
  18. def downgrade():
  19. # ### commands auto generated by Alembic - please adjust! ###
  20. with op.batch_alter_table('workflow_runs', schema=None) as batch_op:
  21. batch_op.drop_index('workflow_run_tenant_app_sequence_idx')
  22. # ### end Alembic commands ###