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
This commit is contained in:
@@ -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,
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user