|
1 | 1 | """staged resource web monitor updates
|
2 | 2 |
|
3 | 3 | Revision ID: 58f8edd66b69
|
4 |
| -Revises: c90d46f6d3f2 |
| 4 | +Revises: ae65da77c468 |
5 | 5 | Create Date: 2024-12-17 19:25:36.184841
|
6 | 6 |
|
7 | 7 | """
|
8 |
| -from alembic import op |
9 |
| -import sqlalchemy as sa |
10 | 8 |
|
| 9 | +import sqlalchemy as sa |
| 10 | +from alembic import op |
11 | 11 |
|
12 | 12 | # revision identifiers, used by Alembic.
|
13 |
| -revision = '58f8edd66b69' |
14 |
| -down_revision = 'c90d46f6d3f2' |
| 13 | +revision = "58f8edd66b69" |
| 14 | +down_revision = "ae65da77c468" |
15 | 15 | branch_labels = None
|
16 | 16 | depends_on = None
|
17 | 17 |
|
18 | 18 |
|
19 | 19 | def upgrade():
|
20 | 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']) |
| 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( |
| 24 | + op.f("ix_stagedresource_monitor_config_id"), |
| 25 | + "stagedresource", |
| 26 | + ["monitor_config_id"], |
| 27 | + unique=False, |
| 28 | + ) |
| 29 | + op.create_index( |
| 30 | + op.f("ix_stagedresource_system_id"), |
| 31 | + "stagedresource", |
| 32 | + ["system_id"], |
| 33 | + unique=False, |
| 34 | + ) |
| 35 | + op.create_index( |
| 36 | + op.f("ix_stagedresource_vendor_id"), |
| 37 | + "stagedresource", |
| 38 | + ["vendor_id"], |
| 39 | + unique=False, |
| 40 | + ) |
| 41 | + op.create_foreign_key(None, "stagedresource", "ctl_systems", ["system_id"], ["id"]) |
27 | 42 | # ### end Alembic commands ###
|
28 | 43 |
|
29 | 44 |
|
30 | 45 | def downgrade():
|
31 | 46 | # ### 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') |
| 47 | + op.drop_constraint(None, "stagedresource", type_="foreignkey") |
| 48 | + op.drop_index(op.f("ix_stagedresource_vendor_id"), table_name="stagedresource") |
| 49 | + op.drop_index(op.f("ix_stagedresource_system_id"), table_name="stagedresource") |
| 50 | + op.drop_index( |
| 51 | + op.f("ix_stagedresource_monitor_config_id"), table_name="stagedresource" |
| 52 | + ) |
| 53 | + op.drop_column("stagedresource", "vendor_id") |
| 54 | + op.drop_column("stagedresource", "system_id") |
38 | 55 | # ### end Alembic commands ###
|
0 commit comments