From c44216782863bcfe66e60a044eeb5de349e4c72b Mon Sep 17 00:00:00 2001 From: Charles Yao Date: Mon, 21 Sep 2026 15:37:53 -0700 Subject: [PATCH] fix(migrations): merge the two alembic heads on feat/dify-builder The migration graph had two heads, both descending from d8e4a6b1c902: - a9cc8d552db4 (add error to dify_builder_runs) on the Builder branch - e7b2a9c4d601 (add agent sandbox usage) from main, which arrived here through merge commit d08c189614 With two heads, `flask upgrade-db` fails at startup with "Multiple head revisions are present", so the dev dify-api pod built from this branch was crash-looping and the rollout never completed. Add an empty merge revision (733e4c46f90e) whose down_revision is ("a9cc8d552db4", "e7b2a9c4d601") instead of re-parenting either one. Both revisions are already pushed and a9cc8d552db4 is already applied on the dev database. Re-parenting a9cc8d552db4 onto e7b2a9c4d601 would make that database believe it is at head while the sandbox usage tables from e7b2a9c4d601 were never created. The merge revision makes alembic apply e7b2a9c4d601 on databases that stopped at a9cc8d552db4, then stamp the merge. Co-Authored-By: Claude Opus 5 (1M context) --- ...ilder_run_error_and_sandbox_usage_heads.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 api/migrations/versions/2026_09_21_1535-733e4c46f90e_merge_builder_run_error_and_sandbox_usage_heads.py diff --git a/api/migrations/versions/2026_09_21_1535-733e4c46f90e_merge_builder_run_error_and_sandbox_usage_heads.py b/api/migrations/versions/2026_09_21_1535-733e4c46f90e_merge_builder_run_error_and_sandbox_usage_heads.py new file mode 100644 index 00000000000..5c3b7bbbc04 --- /dev/null +++ b/api/migrations/versions/2026_09_21_1535-733e4c46f90e_merge_builder_run_error_and_sandbox_usage_heads.py @@ -0,0 +1,22 @@ +"""merge builder run error and agent sandbox usage heads + +Revision ID: 733e4c46f90e +Revises: a9cc8d552db4, e7b2a9c4d601 +Create Date: 2026-09-21 15:35:24.000000 + +""" +import models as models + +# revision identifiers, used by Alembic. +revision = "733e4c46f90e" +down_revision = ("a9cc8d552db4", "e7b2a9c4d601") +branch_labels = None +depends_on = None + + +def upgrade(): + pass + + +def downgrade(): + pass