|
| 1 | +"""staged resource web monitor updates |
| 2 | +
|
| 3 | +Revision ID: 58f8edd66b69 |
| 4 | +Revises: c90d46f6d3f2 |
| 5 | +Create Date: 2024-12-17 19:25:36.184841 |
| 6 | +
|
| 7 | +""" |
| 8 | +from alembic import op |
| 9 | +import sqlalchemy as sa |
| 10 | + |
| 11 | + |
| 12 | +# revision identifiers, used by Alembic. |
| 13 | +revision = '58f8edd66b69' |
| 14 | +down_revision = 'c90d46f6d3f2' |
| 15 | +branch_labels = None |
| 16 | +depends_on = None |
| 17 | + |
| 18 | + |
| 19 | +def upgrade(): |
| 20 | + # ### commands auto generated by Alembic - please adjust! ### |
| 21 | + op.add_column('stagedresource', sa.Column('system_id', sa.String(), nullable=True)) |
| 22 | + op.add_column('stagedresource', sa.Column('vendor_id', sa.String(), nullable=True)) |
| 23 | + op.create_index(op.f('ix_stagedresource_monitor_config_id'), 'stagedresource', ['monitor_config_id'], unique=False) |
| 24 | + op.create_index(op.f('ix_stagedresource_system_id'), 'stagedresource', ['system_id'], unique=False) |
| 25 | + op.create_index(op.f('ix_stagedresource_vendor_id'), 'stagedresource', ['vendor_id'], unique=False) |
| 26 | + op.create_foreign_key(None, 'stagedresource', 'ctl_systems', ['system_id'], ['id']) |
| 27 | + # ### end Alembic commands ### |
| 28 | + |
| 29 | + |
| 30 | +def downgrade(): |
| 31 | + # ### commands auto generated by Alembic - please adjust! ### |
| 32 | + op.drop_constraint(None, 'stagedresource', type_='foreignkey') |
| 33 | + op.drop_index(op.f('ix_stagedresource_vendor_id'), table_name='stagedresource') |
| 34 | + op.drop_index(op.f('ix_stagedresource_system_id'), table_name='stagedresource') |
| 35 | + op.drop_index(op.f('ix_stagedresource_monitor_config_id'), table_name='stagedresource') |
| 36 | + op.drop_column('stagedresource', 'vendor_id') |
| 37 | + op.drop_column('stagedresource', 'system_id') |
| 38 | + # ### end Alembic commands ### |
0 commit comments