Fix duplicate table error: remove glue.models from model import loop

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 <noreply@anthropic.com>
This commit is contained in:
giles
2026-02-19 04:34:28 +00:00
parent 70b1c7de10
commit 5bcf68af2b
2 changed files with 3 additions and 1 deletions

View File

@@ -11,7 +11,7 @@ from shared.config import init_config, config, pretty
from shared.models import KV # ensure shared models imported from shared.models import KV # ensure shared models imported
# Register all app model classes with SQLAlchemy so cross-domain # Register all app model classes with SQLAlchemy so cross-domain
# relationship() string references resolve correctly. # 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: try:
__import__(_mod) __import__(_mod)
except ImportError: except ImportError:

View File

@@ -25,3 +25,5 @@ from .calendars import (
Calendar, CalendarEntry, CalendarSlot, Calendar, CalendarEntry, CalendarSlot,
TicketType, Ticket, CalendarEntryPost, TicketType, Ticket, CalendarEntryPost,
) )
from .container_relation import ContainerRelation
from .menu_node import MenuNode