From 3fc0518168eb8f7c2025aa9ef5b3020c19b20af1 Mon Sep 17 00:00:00 2001 From: Avery Lee Date: Fri, 28 Jun 2024 14:50:02 -0700 Subject: [PATCH] Fixes sqlalchemy upgrade/downgrade. --- .../versions/2024-06-28_15a8d3228123.py | 47 ------------------- 1 file changed, 47 deletions(-) diff --git a/src/dispatch/database/revisions/tenant/versions/2024-06-28_15a8d3228123.py b/src/dispatch/database/revisions/tenant/versions/2024-06-28_15a8d3228123.py index eb17f73ea659..dd9635197d92 100644 --- a/src/dispatch/database/revisions/tenant/versions/2024-06-28_15a8d3228123.py +++ b/src/dispatch/database/revisions/tenant/versions/2024-06-28_15a8d3228123.py @@ -60,66 +60,19 @@ def upgrade(): sa.ForeignKeyConstraint(["project_id"], ["project.id"], ondelete="CASCADE"), sa.PrimaryKeyConstraint("id"), ) - op.create_table( - "assoc_signal_instance_tags", - sa.Column("signal_instance_id", postgresql.UUID(as_uuid=True), nullable=False), - sa.Column("tag_id", sa.Integer(), nullable=False), - sa.ForeignKeyConstraint(["signal_instance_id"], ["signal_instance.id"], ondelete="CASCADE"), - sa.ForeignKeyConstraint(["tag_id"], ["tag.id"], ondelete="CASCADE"), - sa.PrimaryKeyConstraint("signal_instance_id", "tag_id"), - ) op.add_column("case_type", sa.Column("cost_model_id", sa.Integer(), nullable=True)) op.create_foreign_key(None, "case_type", "cost_model", ["cost_model_id"], ["id"]) - op.alter_column( - "entity", "source", existing_type=sa.BOOLEAN(), type_=sa.String(), existing_nullable=True - ) - op.drop_index("ix_entity_search_vector", table_name="entity", postgresql_using="gin") - op.create_index( - "entity_search_vector_idx", - "entity", - ["search_vector"], - unique=False, - postgresql_using="gin", - ) - op.alter_column("entity_type", "jpath", existing_type=sa.VARCHAR(), nullable=True) op.add_column("participant_activity", sa.Column("case_id", sa.Integer(), nullable=True)) op.create_foreign_key(None, "participant_activity", "case", ["case_id"], ["id"]) - op.drop_column("plugin_instance", "configuration") - op.drop_constraint("project_stable_priority_id_fkey", "project", type_="foreignkey") # ### end Alembic commands ### def downgrade(): # ### commands auto generated by Alembic - please adjust! ### - op.create_foreign_key( - "project_stable_priority_id_fkey", - "project", - "incident_priority", - ["stable_priority_id"], - ["id"], - ) - op.add_column( - "plugin_instance", - sa.Column( - "configuration", - postgresql.JSON(astext_type=sa.Text()), - autoincrement=False, - nullable=True, - ), - ) op.drop_constraint(None, "participant_activity", type_="foreignkey") op.drop_column("participant_activity", "case_id") - op.alter_column("entity_type", "jpath", existing_type=sa.VARCHAR(), nullable=False) - op.drop_index("entity_search_vector_idx", table_name="entity", postgresql_using="gin") - op.create_index( - "ix_entity_search_vector", "entity", ["search_vector"], unique=False, postgresql_using="gin" - ) - op.alter_column( - "entity", "source", existing_type=sa.String(), type_=sa.BOOLEAN(), existing_nullable=True - ) op.drop_constraint(None, "case_type", type_="foreignkey") op.drop_column("case_type", "cost_model_id") - op.drop_table("assoc_signal_instance_tags") op.drop_table("case_cost") op.drop_index( "case_cost_type_search_vector_idx", table_name="case_cost_type", postgresql_using="gin"