From 2f1833e90de715545db7d9a6f2245e95e2244572 Mon Sep 17 00:00:00 2001 From: Barcode Betty Date: Sat, 4 Apr 2026 21:36:05 +0000 Subject: [PATCH] fix(api): commit after create_all in alembic env.py SQLAlchemy 2.0 removed implicit autocommit; without an explicit connection.commit() DDL changes from create_all() are rolled back when the connection closes, leaving fresh databases without tables. Co-Authored-By: Paperclip --- api/alembic/env.py | 1 + 1 file changed, 1 insertion(+) diff --git a/api/alembic/env.py b/api/alembic/env.py index d692a7f..6844fba 100644 --- a/api/alembic/env.py +++ b/api/alembic/env.py @@ -53,6 +53,7 @@ def run_migrations_online() -> None: # checkfirst=True ensures this is a no-op on existing databases. try: Base.metadata.create_all(bind=connection, checkfirst=True) + connection.commit() except Exception as exc: import logging logging.getLogger("alembic.env").warning(