Skip to content

Commit

Permalink
bump migration downrev
Browse files Browse the repository at this point in the history
  • Loading branch information
adamsachs committed Jan 16, 2025
1 parent 69994bc commit b0e732f
Showing 1 changed file with 34 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,38 +1,55 @@
"""staged resource web monitor updates
Revision ID: 58f8edd66b69
Revises: c90d46f6d3f2
Revises: ae65da77c468
Create Date: 2024-12-17 19:25:36.184841
"""
from alembic import op
import sqlalchemy as sa

import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = '58f8edd66b69'
down_revision = 'c90d46f6d3f2'
revision = "58f8edd66b69"
down_revision = "ae65da77c468"
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('stagedresource', sa.Column('system_id', sa.String(), nullable=True))
op.add_column('stagedresource', sa.Column('vendor_id', sa.String(), nullable=True))
op.create_index(op.f('ix_stagedresource_monitor_config_id'), 'stagedresource', ['monitor_config_id'], unique=False)
op.create_index(op.f('ix_stagedresource_system_id'), 'stagedresource', ['system_id'], unique=False)
op.create_index(op.f('ix_stagedresource_vendor_id'), 'stagedresource', ['vendor_id'], unique=False)
op.create_foreign_key(None, 'stagedresource', 'ctl_systems', ['system_id'], ['id'])
op.add_column("stagedresource", sa.Column("system_id", sa.String(), nullable=True))
op.add_column("stagedresource", sa.Column("vendor_id", sa.String(), nullable=True))
op.create_index(
op.f("ix_stagedresource_monitor_config_id"),
"stagedresource",
["monitor_config_id"],
unique=False,
)
op.create_index(
op.f("ix_stagedresource_system_id"),
"stagedresource",
["system_id"],
unique=False,
)
op.create_index(
op.f("ix_stagedresource_vendor_id"),
"stagedresource",
["vendor_id"],
unique=False,
)
op.create_foreign_key(None, "stagedresource", "ctl_systems", ["system_id"], ["id"])
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'stagedresource', type_='foreignkey')
op.drop_index(op.f('ix_stagedresource_vendor_id'), table_name='stagedresource')
op.drop_index(op.f('ix_stagedresource_system_id'), table_name='stagedresource')
op.drop_index(op.f('ix_stagedresource_monitor_config_id'), table_name='stagedresource')
op.drop_column('stagedresource', 'vendor_id')
op.drop_column('stagedresource', 'system_id')
op.drop_constraint(None, "stagedresource", type_="foreignkey")
op.drop_index(op.f("ix_stagedresource_vendor_id"), table_name="stagedresource")
op.drop_index(op.f("ix_stagedresource_system_id"), table_name="stagedresource")
op.drop_index(
op.f("ix_stagedresource_monitor_config_id"), table_name="stagedresource"
)
op.drop_column("stagedresource", "vendor_id")
op.drop_column("stagedresource", "system_id")
# ### end Alembic commands ###

0 comments on commit b0e732f

Please sign in to comment.