From f23fadf52ba104edb5d9fed5d1064197c8236656 Mon Sep 17 00:00:00 2001 From: Developer Date: Sat, 13 Jun 2026 09:18:13 +0000 Subject: [PATCH] fix(alembic): make tool_instances.clone_mode nullable The workspace-first cleanup removed clone_mode from the creation flow, so the API now inserts NULL. Align the database with the model by making clone_mode nullable. Apply with: cd apps/api && alembic upgrade head --- .../2026_06_13_make_clone_mode_nullable.py | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 apps/api/alembic/versions/2026_06_13_make_clone_mode_nullable.py diff --git a/apps/api/alembic/versions/2026_06_13_make_clone_mode_nullable.py b/apps/api/alembic/versions/2026_06_13_make_clone_mode_nullable.py new file mode 100644 index 0000000..ff592ca --- /dev/null +++ b/apps/api/alembic/versions/2026_06_13_make_clone_mode_nullable.py @@ -0,0 +1,35 @@ +"""make clone_mode nullable + +Revision ID: 2026_06_13_make_clone_mode_nullable +Revises: 86cec91fdb00 +Create Date: 2026-06-13 10:00:00.000000 +""" + +from alembic import op +import sqlalchemy as sa + +# revision identifiers, used by Alembic. +revision = "2026_06_13_make_clone_mode_nullable" +down_revision = "86cec91fdb00" +branch_labels = None +depends_on = None + + +def upgrade() -> None: + # The workspace-first cleanup no longer writes clone_mode; existing rows + # keep their value, but new rows may be NULL. + op.alter_column( + "tool_instances", + "clone_mode", + existing_type=sa.String(20), + nullable=True, + ) + + +def downgrade() -> None: + op.alter_column( + "tool_instances", + "clone_mode", + existing_type=sa.String(20), + nullable=False, + )