mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-17 00:02:59 +00:00
* fix: give every table a primary key so the db can be logically replicated Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017WS9iNfYQiLJNuBnxysBzi * fix: tighten replicability guard and trim migration comments Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017WS9iNfYQiLJNuBnxysBzi * fix: split deployment_metadata into its own primary-key migration Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017WS9iNfYQiLJNuBnxysBzi * docs: correct the partial-index predicate note after the deployment_metadata split Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017WS9iNfYQiLJNuBnxysBzi --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
14 lines
728 B
SQL
14 lines
728 B
SQL
-- The sixth of the seven; why any of them need a key is in
|
|
-- 20260909052532_add_missing_primary_keys.
|
|
--
|
|
-- Kept out of that migration because it is the one table in the set with no retention
|
|
-- sweep -- rows accumulate per deployed script hash, flow version and app version for
|
|
-- the life of the instance -- so on an instance that upgrades after years of deploys
|
|
-- its ACCESS EXCLUSIVE rewrite is the one that could hold the others locked.
|
|
--
|
|
-- No natural key: each row is a script, flow OR app deployment, and the three unique
|
|
-- indexes are partial on exactly that split, so none of them covers every row.
|
|
|
|
ALTER TABLE deployment_metadata
|
|
ADD COLUMN IF NOT EXISTS id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY;
|