[object Object]

← back to Wallco Ai

migration(prod): additive ALTER TABLE spoon_all_designs for prompt-match cols (prod table != local view; applied to prod dw_unified)

f339c7f90f00ac1418314f169348e4b93e09d745 · 2026-06-01 12:46:38 -0700 · Steve Abrams

Files touched

Diff

commit f339c7f90f00ac1418314f169348e4b93e09d745
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Mon Jun 1 12:46:38 2026 -0700

    migration(prod): additive ALTER TABLE spoon_all_designs for prompt-match cols (prod table != local view; applied to prod dw_unified)
---
 migrations/20260601_prompt_match_columns_PROD.sql | 24 +++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/migrations/20260601_prompt_match_columns_PROD.sql b/migrations/20260601_prompt_match_columns_PROD.sql
new file mode 100644
index 0000000..80ddae2
--- /dev/null
+++ b/migrations/20260601_prompt_match_columns_PROD.sql
@@ -0,0 +1,24 @@
+-- 20260601_prompt_match_columns_PROD.sql
+--
+-- PROD variant of 20260601_prompt_match_columns.sql.
+--
+-- TOPOLOGY DRIFT (discovered 2026-06-01): on PROD dw_unified,
+-- `spoon_all_designs` is a real TABLE (relkind=r) carrying the user_* rating
+-- columns directly — NOT a view over all_designs as it is on the local Mac2
+-- dev DB. The deployed app reads/writes spoon_all_designs everywhere, so on
+-- prod we ALTER that table directly. Running the local migration's
+-- CREATE OR REPLACE VIEW against prod would ERROR ("spoon_all_designs is not a
+-- view"), so this prod file does the table-ALTER only.
+--
+-- ADDITIVE ONLY, idempotent (IF NOT EXISTS). No drops, no renames. Does NOT
+-- touch is_published, the settlement gate, or designs.json sync. Mirrors the
+-- existing prod columns user_stars (integer), user_color_good (boolean),
+-- user_rated_at (timestamptz).
+
+BEGIN;
+
+ALTER TABLE spoon_all_designs ADD COLUMN IF NOT EXISTS user_prompt_match    smallint;
+ALTER TABLE spoon_all_designs ADD COLUMN IF NOT EXISTS user_prompt_verdict  text;
+ALTER TABLE spoon_all_designs ADD COLUMN IF NOT EXISTS user_prompt_rated_at timestamptz;
+
+COMMIT;

← 6d802cf prompt-rate: PG columns are source of truth (read+write), JS  ·  back to Wallco Ai  ·  TODO: log prompt-vs-image PG promotion + deploy (local+prod be40974 →