fix: make config profile migrations idempotent
Guard the 0013 and 0014 config profile migrations against schemas created by the parallel 2026_05_24_add_config_profiles branch. This lets existing databases continue past duplicate config_profiles tables while converging on the current Alembic graph. Quality gates: py_compile and ruff passed on edited migrations; LSP diagnostics passed; alembic heads returns 86cec91fdb00 (head); fresh review found no blocker.
This commit is contained in:
@@ -5,7 +5,7 @@ Revises: 0012_default_port_req
|
|||||||
Create Date: 2026-05-24 12:00:00.000000
|
Create Date: 2026-05-24 12:00:00.000000
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from typing import Sequence, Union
|
from collections.abc import Sequence
|
||||||
|
|
||||||
from alembic import op
|
from alembic import op
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
@@ -13,81 +13,181 @@ from sqlalchemy.dialects import postgresql
|
|||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision: str = "0013_add_config_profiles"
|
revision: str = "0013_add_config_profiles"
|
||||||
down_revision: Union[str, None] = "0012_default_port_req"
|
down_revision: str | None = "0012_default_port_req"
|
||||||
branch_labels: Union[str, Sequence[str], None] = None
|
branch_labels: str | Sequence[str] | None = None
|
||||||
depends_on: Union[str, Sequence[str], None] = None
|
depends_on: str | Sequence[str] | None = None
|
||||||
|
|
||||||
|
|
||||||
|
def _table_exists(table_name: str) -> bool:
|
||||||
|
return sa.inspect(op.get_bind()).has_table(table_name)
|
||||||
|
|
||||||
|
|
||||||
|
def _column_exists(table_name: str, column_name: str) -> bool:
|
||||||
|
if not _table_exists(table_name):
|
||||||
|
return False
|
||||||
|
return column_name in {
|
||||||
|
column["name"] for column in sa.inspect(op.get_bind()).get_columns(table_name)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _index_exists(table_name: str, index_name: str) -> bool:
|
||||||
|
if not _table_exists(table_name):
|
||||||
|
return False
|
||||||
|
return index_name in {
|
||||||
|
index["name"] for index in sa.inspect(op.get_bind()).get_indexes(table_name)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _foreign_key_exists(
|
||||||
|
table_name: str,
|
||||||
|
constrained_columns: list[str],
|
||||||
|
referred_table: str,
|
||||||
|
) -> bool:
|
||||||
|
if not _table_exists(table_name):
|
||||||
|
return False
|
||||||
|
for foreign_key in sa.inspect(op.get_bind()).get_foreign_keys(table_name):
|
||||||
|
if (
|
||||||
|
foreign_key.get("constrained_columns") == constrained_columns
|
||||||
|
and foreign_key.get("referred_table") == referred_table
|
||||||
|
):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def upgrade() -> None:
|
def upgrade() -> None:
|
||||||
# Create config_profiles table
|
# Earlier branches may already have created config_profiles. Keep this
|
||||||
op.create_table(
|
# migration defensive so databases can converge onto the current graph.
|
||||||
"config_profiles",
|
if not _table_exists("config_profiles"):
|
||||||
sa.Column("id", postgresql.UUID(as_uuid=True), nullable=False),
|
op.create_table(
|
||||||
sa.Column("user_id", postgresql.UUID(as_uuid=True), nullable=False),
|
"config_profiles",
|
||||||
sa.Column("name", sa.String(length=255), nullable=False),
|
sa.Column("id", postgresql.UUID(as_uuid=True), nullable=False),
|
||||||
sa.Column("description", sa.Text(), nullable=True),
|
sa.Column("user_id", postgresql.UUID(as_uuid=True), nullable=False),
|
||||||
sa.Column("created_at", sa.DateTime(timezone=True), server_default=sa.text("NOW()"), nullable=False),
|
sa.Column("name", sa.String(length=255), nullable=False),
|
||||||
sa.Column("updated_at", sa.DateTime(timezone=True), server_default=sa.text("NOW()"), nullable=False),
|
sa.Column("description", sa.Text(), nullable=True),
|
||||||
sa.ForeignKeyConstraint(["user_id"], ["users.id"], ondelete="CASCADE"),
|
sa.Column(
|
||||||
sa.PrimaryKeyConstraint("id"),
|
"created_at",
|
||||||
sa.UniqueConstraint("user_id", "name", name="uq_config_profiles_user_name"),
|
sa.DateTime(timezone=True),
|
||||||
)
|
server_default=sa.text("NOW()"),
|
||||||
op.create_index("idx_config_profiles_user", "config_profiles", ["user_id"])
|
nullable=False,
|
||||||
|
),
|
||||||
|
sa.Column(
|
||||||
|
"updated_at",
|
||||||
|
sa.DateTime(timezone=True),
|
||||||
|
server_default=sa.text("NOW()"),
|
||||||
|
nullable=False,
|
||||||
|
),
|
||||||
|
sa.ForeignKeyConstraint(["user_id"], ["users.id"], ondelete="CASCADE"),
|
||||||
|
sa.PrimaryKeyConstraint("id"),
|
||||||
|
sa.UniqueConstraint(
|
||||||
|
"user_id", "name", name="uq_config_profiles_user_name"
|
||||||
|
),
|
||||||
|
)
|
||||||
|
if not _index_exists("config_profiles", "idx_config_profiles_user"):
|
||||||
|
op.create_index("idx_config_profiles_user", "config_profiles", ["user_id"])
|
||||||
|
|
||||||
# Create config_includes table
|
if not _table_exists("config_includes"):
|
||||||
op.create_table(
|
op.create_table(
|
||||||
"config_includes",
|
"config_includes",
|
||||||
sa.Column("id", postgresql.UUID(as_uuid=True), nullable=False),
|
sa.Column("id", postgresql.UUID(as_uuid=True), nullable=False),
|
||||||
sa.Column("profile_id", postgresql.UUID(as_uuid=True), nullable=False),
|
sa.Column("profile_id", postgresql.UUID(as_uuid=True), nullable=False),
|
||||||
sa.Column("included_profile_id", postgresql.UUID(as_uuid=True), nullable=False),
|
sa.Column(
|
||||||
sa.Column("order_index", sa.Integer(), nullable=False, server_default="0"),
|
"included_profile_id", postgresql.UUID(as_uuid=True), nullable=False
|
||||||
sa.Column("created_at", sa.DateTime(timezone=True), server_default=sa.text("NOW()"), nullable=False),
|
),
|
||||||
sa.Column("updated_at", sa.DateTime(timezone=True), server_default=sa.text("NOW()"), nullable=False),
|
sa.Column("order_index", sa.Integer(), nullable=False, server_default="0"),
|
||||||
sa.ForeignKeyConstraint(["profile_id"], ["config_profiles.id"], ondelete="CASCADE"),
|
sa.Column(
|
||||||
sa.ForeignKeyConstraint(["included_profile_id"], ["config_profiles.id"], ondelete="CASCADE"),
|
"created_at",
|
||||||
sa.PrimaryKeyConstraint("id"),
|
sa.DateTime(timezone=True),
|
||||||
sa.UniqueConstraint("profile_id", "included_profile_id", name="uq_config_includes_pair"),
|
server_default=sa.text("NOW()"),
|
||||||
)
|
nullable=False,
|
||||||
op.create_index("idx_config_includes_profile", "config_includes", ["profile_id"])
|
),
|
||||||
op.create_index("idx_config_includes_included", "config_includes", ["included_profile_id"])
|
sa.Column(
|
||||||
|
"updated_at",
|
||||||
|
sa.DateTime(timezone=True),
|
||||||
|
server_default=sa.text("NOW()"),
|
||||||
|
nullable=False,
|
||||||
|
),
|
||||||
|
sa.ForeignKeyConstraint(
|
||||||
|
["profile_id"], ["config_profiles.id"], ondelete="CASCADE"
|
||||||
|
),
|
||||||
|
sa.ForeignKeyConstraint(
|
||||||
|
["included_profile_id"],
|
||||||
|
["config_profiles.id"],
|
||||||
|
ondelete="CASCADE",
|
||||||
|
),
|
||||||
|
sa.PrimaryKeyConstraint("id"),
|
||||||
|
sa.UniqueConstraint(
|
||||||
|
"profile_id", "included_profile_id", name="uq_config_includes_pair"
|
||||||
|
),
|
||||||
|
)
|
||||||
|
if not _index_exists("config_includes", "idx_config_includes_profile"):
|
||||||
|
op.create_index("idx_config_includes_profile", "config_includes", ["profile_id"])
|
||||||
|
if not _index_exists("config_includes", "idx_config_includes_included"):
|
||||||
|
op.create_index(
|
||||||
|
"idx_config_includes_included", "config_includes", ["included_profile_id"]
|
||||||
|
)
|
||||||
|
|
||||||
# Create config_mounts table
|
if not _table_exists("config_mounts"):
|
||||||
op.create_table(
|
op.create_table(
|
||||||
"config_mounts",
|
"config_mounts",
|
||||||
sa.Column("id", postgresql.UUID(as_uuid=True), nullable=False),
|
sa.Column("id", postgresql.UUID(as_uuid=True), nullable=False),
|
||||||
sa.Column("profile_id", postgresql.UUID(as_uuid=True), nullable=False),
|
sa.Column("profile_id", postgresql.UUID(as_uuid=True), nullable=False),
|
||||||
sa.Column("mount_path", sa.String(length=1024), nullable=False),
|
sa.Column("mount_path", sa.String(length=1024), nullable=False),
|
||||||
sa.Column("content", sa.Text(), nullable=True),
|
sa.Column("content", sa.Text(), nullable=True),
|
||||||
sa.Column("source_profile_id", postgresql.UUID(as_uuid=True), nullable=True),
|
sa.Column("source_profile_id", postgresql.UUID(as_uuid=True), nullable=True),
|
||||||
sa.Column("order_index", sa.Integer(), nullable=False, server_default="0"),
|
sa.Column("order_index", sa.Integer(), nullable=False, server_default="0"),
|
||||||
sa.Column("created_at", sa.DateTime(timezone=True), server_default=sa.text("NOW()"), nullable=False),
|
sa.Column(
|
||||||
sa.Column("updated_at", sa.DateTime(timezone=True), server_default=sa.text("NOW()"), nullable=False),
|
"created_at",
|
||||||
sa.ForeignKeyConstraint(["profile_id"], ["config_profiles.id"], ondelete="CASCADE"),
|
sa.DateTime(timezone=True),
|
||||||
sa.ForeignKeyConstraint(["source_profile_id"], ["config_profiles.id"], ondelete="SET NULL"),
|
server_default=sa.text("NOW()"),
|
||||||
sa.PrimaryKeyConstraint("id"),
|
nullable=False,
|
||||||
)
|
),
|
||||||
op.create_index("idx_config_mounts_profile", "config_mounts", ["profile_id"])
|
sa.Column(
|
||||||
|
"updated_at",
|
||||||
|
sa.DateTime(timezone=True),
|
||||||
|
server_default=sa.text("NOW()"),
|
||||||
|
nullable=False,
|
||||||
|
),
|
||||||
|
sa.ForeignKeyConstraint(
|
||||||
|
["profile_id"], ["config_profiles.id"], ondelete="CASCADE"
|
||||||
|
),
|
||||||
|
sa.ForeignKeyConstraint(
|
||||||
|
["source_profile_id"], ["config_profiles.id"], ondelete="SET NULL"
|
||||||
|
),
|
||||||
|
sa.PrimaryKeyConstraint("id"),
|
||||||
|
)
|
||||||
|
if not _index_exists("config_mounts", "idx_config_mounts_profile"):
|
||||||
|
op.create_index("idx_config_mounts_profile", "config_mounts", ["profile_id"])
|
||||||
|
|
||||||
# Add selected_profile_id to tool_instances
|
if not _column_exists("tool_instances", "selected_profile_id"):
|
||||||
op.add_column(
|
op.add_column(
|
||||||
"tool_instances",
|
"tool_instances",
|
||||||
sa.Column("selected_profile_id", postgresql.UUID(as_uuid=True), nullable=True),
|
sa.Column("selected_profile_id", postgresql.UUID(as_uuid=True), nullable=True),
|
||||||
)
|
)
|
||||||
op.create_foreign_key(
|
if not _foreign_key_exists(
|
||||||
"fk_tool_instances_selected_profile",
|
"tool_instances", ["selected_profile_id"], "config_profiles"
|
||||||
"tool_instances",
|
):
|
||||||
"config_profiles",
|
op.create_foreign_key(
|
||||||
["selected_profile_id"],
|
"fk_tool_instances_selected_profile",
|
||||||
["id"],
|
"tool_instances",
|
||||||
ondelete="SET NULL",
|
"config_profiles",
|
||||||
)
|
["selected_profile_id"],
|
||||||
op.create_index("idx_tool_instances_selected_profile", "tool_instances", ["selected_profile_id"])
|
["id"],
|
||||||
|
ondelete="SET NULL",
|
||||||
|
)
|
||||||
|
if not _index_exists("tool_instances", "idx_tool_instances_selected_profile"):
|
||||||
|
op.create_index(
|
||||||
|
"idx_tool_instances_selected_profile",
|
||||||
|
"tool_instances",
|
||||||
|
["selected_profile_id"],
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def downgrade() -> None:
|
def downgrade() -> None:
|
||||||
# Remove selected_profile_id from tool_instances
|
# Remove selected_profile_id from tool_instances
|
||||||
op.drop_index("idx_tool_instances_selected_profile", table_name="tool_instances")
|
op.drop_index("idx_tool_instances_selected_profile", table_name="tool_instances")
|
||||||
op.drop_constraint("fk_tool_instances_selected_profile", "tool_instances", type_="foreignkey")
|
op.drop_constraint(
|
||||||
|
"fk_tool_instances_selected_profile", "tool_instances", type_="foreignkey"
|
||||||
|
)
|
||||||
op.drop_column("tool_instances", "selected_profile_id")
|
op.drop_column("tool_instances", "selected_profile_id")
|
||||||
|
|
||||||
# Drop config_mounts
|
# Drop config_mounts
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Revises: 0013_add_config_profiles
|
|||||||
Create Date: 2026-05-24 14:00:00.000000
|
Create Date: 2026-05-24 14:00:00.000000
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from typing import Sequence, Union
|
from collections.abc import Sequence
|
||||||
|
|
||||||
from alembic import op
|
from alembic import op
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
@@ -13,82 +13,141 @@ from sqlalchemy.dialects import postgresql
|
|||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision: str = "0014_add_profile_resolver_fields"
|
revision: str = "0014_add_profile_resolver_fields"
|
||||||
down_revision: Union[str, None] = "0013_add_config_profiles"
|
down_revision: str | None = "0013_add_config_profiles"
|
||||||
branch_labels: Union[str, Sequence[str], None] = None
|
branch_labels: str | Sequence[str] | None = None
|
||||||
depends_on: Union[str, Sequence[str], None] = None
|
depends_on: str | Sequence[str] | None = None
|
||||||
|
|
||||||
|
|
||||||
|
def _table_exists(table_name: str) -> bool:
|
||||||
|
return sa.inspect(op.get_bind()).has_table(table_name)
|
||||||
|
|
||||||
|
|
||||||
|
def _column_exists(table_name: str, column_name: str) -> bool:
|
||||||
|
if not _table_exists(table_name):
|
||||||
|
return False
|
||||||
|
return column_name in {
|
||||||
|
column["name"] for column in sa.inspect(op.get_bind()).get_columns(table_name)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _index_exists(table_name: str, index_name: str) -> bool:
|
||||||
|
if not _table_exists(table_name):
|
||||||
|
return False
|
||||||
|
return index_name in {
|
||||||
|
index["name"] for index in sa.inspect(op.get_bind()).get_indexes(table_name)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _foreign_key_exists(
|
||||||
|
table_name: str,
|
||||||
|
constrained_columns: list[str],
|
||||||
|
referred_table: str,
|
||||||
|
) -> bool:
|
||||||
|
if not _table_exists(table_name):
|
||||||
|
return False
|
||||||
|
for foreign_key in sa.inspect(op.get_bind()).get_foreign_keys(table_name):
|
||||||
|
if (
|
||||||
|
foreign_key.get("constrained_columns") == constrained_columns
|
||||||
|
and foreign_key.get("referred_table") == referred_table
|
||||||
|
):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def _foreign_key_names_for_column(table_name: str, column_name: str) -> list[str]:
|
||||||
|
if not _table_exists(table_name):
|
||||||
|
return []
|
||||||
|
names: list[str] = []
|
||||||
|
for foreign_key in sa.inspect(op.get_bind()).get_foreign_keys(table_name):
|
||||||
|
if column_name in foreign_key.get("constrained_columns", []):
|
||||||
|
name = foreign_key.get("name")
|
||||||
|
if name:
|
||||||
|
names.append(name)
|
||||||
|
return names
|
||||||
|
|
||||||
|
|
||||||
def upgrade() -> None:
|
def upgrade() -> None:
|
||||||
# Add fields to config_profiles
|
if not _column_exists("config_profiles", "project_id"):
|
||||||
op.add_column(
|
op.add_column(
|
||||||
"config_profiles",
|
"config_profiles",
|
||||||
sa.Column("project_id", postgresql.UUID(as_uuid=True), nullable=True),
|
sa.Column("project_id", postgresql.UUID(as_uuid=True), nullable=True),
|
||||||
)
|
)
|
||||||
op.add_column(
|
if not _column_exists("config_profiles", "tool_type_id"):
|
||||||
"config_profiles",
|
op.add_column(
|
||||||
sa.Column("tool_type_id", postgresql.UUID(as_uuid=True), nullable=True),
|
"config_profiles",
|
||||||
)
|
sa.Column("tool_type_id", postgresql.UUID(as_uuid=True), nullable=True),
|
||||||
op.add_column(
|
)
|
||||||
"config_profiles",
|
if not _column_exists("config_profiles", "environment_variables"):
|
||||||
sa.Column("environment_variables", sa.JSON(), nullable=True),
|
op.add_column(
|
||||||
)
|
"config_profiles",
|
||||||
op.add_column(
|
sa.Column("environment_variables", sa.JSON(), nullable=True),
|
||||||
"config_profiles",
|
)
|
||||||
sa.Column("start_command", sa.Text(), nullable=True),
|
if not _column_exists("config_profiles", "start_command"):
|
||||||
)
|
op.add_column(
|
||||||
op.add_column(
|
"config_profiles",
|
||||||
"config_profiles",
|
sa.Column("start_command", sa.Text(), nullable=True),
|
||||||
sa.Column("working_directory", sa.Text(), nullable=True),
|
)
|
||||||
)
|
if not _column_exists("config_profiles", "working_directory"):
|
||||||
op.add_column(
|
op.add_column(
|
||||||
"config_profiles",
|
"config_profiles",
|
||||||
sa.Column("port", sa.Integer(), nullable=True),
|
sa.Column("working_directory", sa.Text(), nullable=True),
|
||||||
)
|
)
|
||||||
op.add_column(
|
if not _column_exists("config_profiles", "port"):
|
||||||
"config_profiles",
|
op.add_column("config_profiles", sa.Column("port", sa.Integer(), nullable=True))
|
||||||
sa.Column("is_default", sa.Boolean(), nullable=False, server_default="false"),
|
if not _column_exists("config_profiles", "is_default"):
|
||||||
)
|
op.add_column(
|
||||||
|
"config_profiles",
|
||||||
# Add foreign keys for project and tool_type
|
sa.Column("is_default", sa.Boolean(), nullable=False, server_default="false"),
|
||||||
op.create_foreign_key(
|
)
|
||||||
"fk_config_profiles_project",
|
|
||||||
"config_profiles",
|
if not _foreign_key_exists("config_profiles", ["project_id"], "projects"):
|
||||||
"projects",
|
op.create_foreign_key(
|
||||||
["project_id"],
|
"fk_config_profiles_project",
|
||||||
["id"],
|
"config_profiles",
|
||||||
ondelete="CASCADE",
|
"projects",
|
||||||
)
|
["project_id"],
|
||||||
op.create_foreign_key(
|
["id"],
|
||||||
"fk_config_profiles_tool_type",
|
ondelete="CASCADE",
|
||||||
"config_profiles",
|
)
|
||||||
"tool_types",
|
if not _foreign_key_exists("config_profiles", ["tool_type_id"], "tool_types"):
|
||||||
["tool_type_id"],
|
op.create_foreign_key(
|
||||||
["id"],
|
"fk_config_profiles_tool_type",
|
||||||
ondelete="CASCADE",
|
"config_profiles",
|
||||||
)
|
"tool_types",
|
||||||
|
["tool_type_id"],
|
||||||
# Create indices
|
["id"],
|
||||||
op.create_index("idx_config_profiles_project", "config_profiles", ["project_id"])
|
ondelete="CASCADE",
|
||||||
op.create_index("idx_config_profiles_tool_type", "config_profiles", ["tool_type_id"])
|
)
|
||||||
|
|
||||||
# Alter config_mounts: rename mount_path to target_path, add mode, change content to files JSON
|
if not _index_exists("config_profiles", "idx_config_profiles_project"):
|
||||||
op.alter_column("config_mounts", "mount_path", new_column_name="target_path")
|
op.create_index("idx_config_profiles_project", "config_profiles", ["project_id"])
|
||||||
op.add_column(
|
if not _index_exists("config_profiles", "idx_config_profiles_tool_type"):
|
||||||
"config_mounts",
|
op.create_index(
|
||||||
sa.Column("mode", sa.String(length=10), nullable=False, server_default="rw"),
|
"idx_config_profiles_tool_type", "config_profiles", ["tool_type_id"]
|
||||||
)
|
)
|
||||||
op.add_column(
|
|
||||||
"config_mounts",
|
if _column_exists("config_mounts", "mount_path") and not _column_exists(
|
||||||
sa.Column("files", sa.JSON(), nullable=True),
|
"config_mounts", "target_path"
|
||||||
)
|
):
|
||||||
# Drop the source_profile foreign key if it exists
|
op.alter_column("config_mounts", "mount_path", new_column_name="target_path")
|
||||||
op.drop_constraint(
|
if not _column_exists("config_mounts", "mode"):
|
||||||
"config_mounts_source_profile_id_fkey",
|
op.add_column(
|
||||||
"config_mounts",
|
"config_mounts",
|
||||||
type_="foreignkey",
|
sa.Column("mode", sa.String(length=10), nullable=False, server_default="rw"),
|
||||||
)
|
)
|
||||||
op.drop_column("config_mounts", "content")
|
if not _column_exists("config_mounts", "files"):
|
||||||
op.drop_column("config_mounts", "source_profile_id")
|
op.add_column(
|
||||||
|
"config_mounts",
|
||||||
|
sa.Column("files", sa.JSON(), nullable=True),
|
||||||
|
)
|
||||||
|
for constraint_name in _foreign_key_names_for_column(
|
||||||
|
"config_mounts", "source_profile_id"
|
||||||
|
):
|
||||||
|
op.drop_constraint(constraint_name, "config_mounts", type_="foreignkey")
|
||||||
|
if _column_exists("config_mounts", "content"):
|
||||||
|
op.drop_column("config_mounts", "content")
|
||||||
|
if _column_exists("config_mounts", "source_profile_id"):
|
||||||
|
op.drop_column("config_mounts", "source_profile_id")
|
||||||
|
|
||||||
|
|
||||||
def downgrade() -> None:
|
def downgrade() -> None:
|
||||||
@@ -104,11 +163,13 @@ def downgrade() -> None:
|
|||||||
op.drop_column("config_mounts", "files")
|
op.drop_column("config_mounts", "files")
|
||||||
op.drop_column("config_mounts", "mode")
|
op.drop_column("config_mounts", "mode")
|
||||||
op.alter_column("config_mounts", "target_path", new_column_name="mount_path")
|
op.alter_column("config_mounts", "target_path", new_column_name="mount_path")
|
||||||
|
|
||||||
# Restore config_profiles
|
# Restore config_profiles
|
||||||
op.drop_index("idx_config_profiles_tool_type", table_name="config_profiles")
|
op.drop_index("idx_config_profiles_tool_type", table_name="config_profiles")
|
||||||
op.drop_index("idx_config_profiles_project", table_name="config_profiles")
|
op.drop_index("idx_config_profiles_project", table_name="config_profiles")
|
||||||
op.drop_constraint("fk_config_profiles_tool_type", "config_profiles", type_="foreignkey")
|
op.drop_constraint(
|
||||||
|
"fk_config_profiles_tool_type", "config_profiles", type_="foreignkey"
|
||||||
|
)
|
||||||
op.drop_constraint("fk_config_profiles_project", "config_profiles", type_="foreignkey")
|
op.drop_constraint("fk_config_profiles_project", "config_profiles", type_="foreignkey")
|
||||||
op.drop_column("config_profiles", "is_default")
|
op.drop_column("config_profiles", "is_default")
|
||||||
op.drop_column("config_profiles", "port")
|
op.drop_column("config_profiles", "port")
|
||||||
|
|||||||
Reference in New Issue
Block a user