Files
brain/db/migrations/004_bookmark_version.sql
Andrew S Erwin b9721ff13f
release gate / check (push) Failing after 8m35s
initial commit on Federted servers
2026-10-19 16:23:55 -05:00

8 lines
514 B
SQL

-- 004_bookmark_version.sql — optimistic concurrency for bookmark updates
-- (review CR-04). Owner-driven PUT /api/bookmarks/{id} (fields and tag
-- replacement) now requires the expected version and bumps it; the
-- column-deletion move bumps it too, so a client holding a stale snapshot
-- gets a 409 instead of silently overwriting a concurrent edit. Sharing and
-- server-driven flags (alertSent) stay outside the contract.
ALTER TABLE "Bookmark" ADD COLUMN IF NOT EXISTS version integer NOT NULL DEFAULT 0;