Skip to content

Commit

Permalink
Fixes sqlalchemy upgrade/downgrade.
Browse files Browse the repository at this point in the history
  • Loading branch information
metroid-samus committed Jun 28, 2024
1 parent 3f7220c commit 3fc0518
Showing 1 changed file with 0 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 3fc0518

Please sign in to comment.