From 5bcf68af2ba1e5a4e8cbf151177d9d8a81441aaa Mon Sep 17 00:00:00 2001 From: giles Date: Thu, 19 Feb 2026 04:34:28 +0000 Subject: [PATCH] Fix duplicate table error: remove glue.models from model import loop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MenuNode and ContainerRelation now live in shared/models/ — importing glue.models caused SQLAlchemy to see duplicate table definitions. Also register the two new models in shared/models/__init__.py. Co-Authored-By: Claude Opus 4.6 --- infrastructure/factory.py | 2 +- models/__init__.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/infrastructure/factory.py b/infrastructure/factory.py index a5e1b90..94d54a6 100644 --- a/infrastructure/factory.py +++ b/infrastructure/factory.py @@ -11,7 +11,7 @@ from shared.config import init_config, config, pretty from shared.models import KV # ensure shared models imported # Register all app model classes with SQLAlchemy so cross-domain # relationship() string references resolve correctly. -for _mod in ("blog.models", "market.models", "cart.models", "events.models", "glue.models"): +for _mod in ("blog.models", "market.models", "cart.models", "events.models"): try: __import__(_mod) except ImportError: diff --git a/models/__init__.py b/models/__init__.py index 6d53df6..fcb3aa3 100644 --- a/models/__init__.py +++ b/models/__init__.py @@ -25,3 +25,5 @@ from .calendars import ( Calendar, CalendarEntry, CalendarSlot, TicketType, Ticket, CalendarEntryPost, ) +from .container_relation import ContainerRelation +from .menu_node import MenuNode