Add extend_existing=True to MenuNode and ContainerRelation models

Prevents SQLAlchemy 'table already defined' error if the table gets
registered by a stale glue submodule or cached Docker layer before
the shared model is loaded.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
giles
2026-02-19 04:48:07 +00:00
parent 5bcf68af2b
commit f1716a0fc0
2 changed files with 2 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ class ContainerRelation(Base):
),
Index("ix_container_relations_parent", "parent_type", "parent_id"),
Index("ix_container_relations_child", "child_type", "child_id"),
{"extend_existing": True},
)
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)

View File

@@ -11,6 +11,7 @@ class MenuNode(Base):
__table_args__ = (
Index("ix_menu_nodes_container", "container_type", "container_id"),
Index("ix_menu_nodes_parent_id", "parent_id"),
{"extend_existing": True},
)
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)