mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-22 00:01:34 +00:00
ae42cbf4a8
Never-deployed "draft only" scripts/flows/apps used to live as a stub row in their own table (draft_only = true) alongside a draft row. They now live solely in the `draft` table. Migration `remove_draft_only`: - ensures every draft_only stub has a matching draft row (ON CONFLICT DO NOTHING preserves the real draft; synthesises one matching the frontend draft JSON shape only for stubs that lost their draft), with email = NULL - deletes the stub rows (FKs to *_version / dependency tables cascade) - drops the draft_only column from script/flow/app The down migration re-adds the (nullable) columns; it is fully reversible schema-wise (deleted stubs are not resurrected — their content lives in draft). Removes every draft_only / include_draft_only reference from the backend: handlers, list filters (draft-only items no longer exist in those tables so the filters are dropped), INSERT/SELECT column lists, NewScript/NewFlow and *WithDraft structs, the deploy no-op comparison, the delete-permission check (deleting always requires admin now), git-sync's draft-only skip, and openapi. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
9 lines
513 B
SQL
9 lines
513 B
SQL
-- Re-add the draft_only columns (nullable, as originally created). The stub
|
|
-- rows deleted by the up migration are not restored — their content lives on
|
|
-- in the `draft` table, which is where draft-only items now belong. This keeps
|
|
-- the schema fully reversible; rolling forward again is a no-op for those
|
|
-- already-transferred drafts (ON CONFLICT DO NOTHING).
|
|
ALTER TABLE script ADD COLUMN draft_only BOOLEAN;
|
|
ALTER TABLE flow ADD COLUMN draft_only BOOLEAN;
|
|
ALTER TABLE app ADD COLUMN draft_only BOOLEAN;
|