From c7ab5eb90053742ce261052dcf8c818eb6e80ce3 Mon Sep 17 00:00:00 2001 From: Samir Boulahtit Date: Tue, 5 May 2026 20:17:44 +0200 Subject: [PATCH] fix(makefile): use \`alembic upgrade heads\` for multi-branch migrations The project has multiple migration branch heads (one per module: softdelete, cms, customers, loyalty, ...) so \`migrate-up\` and \`db-reset\` need \`heads\` (plural). The \`head\` (singular) form hit "Multiple head revisions are present" once the first module branch was created. Co-Authored-By: Claude Opus 4.7 (1M context) --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ab686d7e..e4efe147 100644 --- a/Makefile +++ b/Makefile @@ -74,7 +74,7 @@ endif migrate-up: @echo "Running database migrations..." - $(PYTHON) -m alembic upgrade head + $(PYTHON) -m alembic upgrade heads @echo "✅ Migrations completed successfully" migrate-down: @@ -170,7 +170,7 @@ db-reset: @echo "Dropping and recreating public schema..." $(PYTHON) -c "from app.core.config import settings; from sqlalchemy import create_engine, text; e=create_engine(settings.database_url); c=e.connect(); c.execute(text('DROP SCHEMA public CASCADE')); c.execute(text('CREATE SCHEMA public')); c.commit(); c.close()" @echo "Applying all migrations..." - $(PYTHON) -m alembic upgrade head + $(PYTHON) -m alembic upgrade heads @echo "Initializing production data..." $(PYTHON) scripts/seed/init_production.py @echo "Initializing log settings..."