2a3aebbbf4bb_add_app_tracing.py 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. """add app tracing
  2. Revision ID: 2a3aebbbf4bb
  3. Revises: c031d46af369
  4. Create Date: 2024-06-17 10:08:54.803701
  5. """
  6. import sqlalchemy as sa
  7. from alembic import op
  8. import models as models
  9. # revision identifiers, used by Alembic.
  10. revision = '2a3aebbbf4bb'
  11. down_revision = 'c031d46af369'
  12. branch_labels = None
  13. depends_on = None
  14. def upgrade():
  15. # ### commands auto generated by Alembic - please adjust! ###
  16. with op.batch_alter_table('apps', schema=None) as batch_op:
  17. batch_op.add_column(sa.Column('tracing', sa.Text(), nullable=True))
  18. with op.batch_alter_table('trace_app_config', schema=None) as batch_op:
  19. batch_op.create_index('tracing_app_config_app_id_idx', ['app_id'], unique=False)
  20. # ### end Alembic commands ###
  21. def downgrade():
  22. # ### commands auto generated by Alembic - please adjust! ###
  23. with op.batch_alter_table('trace_app_config', schema=None) as batch_op:
  24. batch_op.drop_index('tracing_app_config_app_id_idx')
  25. with op.batch_alter_table('apps', schema=None) as batch_op:
  26. batch_op.drop_column('tracing')
  27. # ### end Alembic commands ###