Files
windmill/backend/windmill-api-scripts
Diego Imbert a672f125bd feat(backend): scope drafts to the owning user's email
Add a nullable `email` column to the `draft` table and replace the
(workspace_id, path, typ) primary key with a unique index over
(workspace_id, path, typ, COALESCE(email, '')) so each user gets at most
one draft per path while the legacy/NULL bucket stays unique too. The
column is nullable so pre-migration drafts are preserved.

All draft reads/writes are now user-scoped:
- create_draft stamps email = authed.email and upserts per-user
- delete_draft and the deploy-time draft cleanup only touch the
  caller's own draft
- get_{script,flow,app}_by_path_with_draft and the list endpoints only
  surface the caller's own draft (draft.email = authed.email)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 15:53:04 +02:00
..