Fix harmonize prod DB targeting and large-hall loading hangs.
Prod env files now win over root .env so harmonize:db can open gallery_prod after gallery_dev; tour_stops gains updated_at; halls no longer block the overlay on every painting texture. Docs cover the fixes and one-artist image pull from prod; Duccio painting assets synced from TrueNAS. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
f6c73c1792
commit
8e444fa461
@@ -21,9 +21,15 @@ BEGIN
|
||||
'paintings',
|
||||
'painting_influences',
|
||||
'painting_influence_sources',
|
||||
'painting_annotations'
|
||||
'painting_annotations',
|
||||
'tour_stops'
|
||||
]
|
||||
LOOP
|
||||
-- Skip tables not created yet (e.g. tour_stops before migrate-tours.sql).
|
||||
IF to_regclass(format('public.%I', tbl)) IS NULL THEN
|
||||
CONTINUE;
|
||||
END IF;
|
||||
|
||||
EXECUTE format(
|
||||
'ALTER TABLE %I ADD COLUMN IF NOT EXISTS updated_at TIMESTAMPTZ NOT NULL DEFAULT now()',
|
||||
tbl
|
||||
|
||||
@@ -20,9 +20,13 @@ CREATE TABLE IF NOT EXISTS tour_stops (
|
||||
painting_id INTEGER NOT NULL REFERENCES paintings(id) ON DELETE CASCADE,
|
||||
sort_order INTEGER NOT NULL DEFAULT 0,
|
||||
body TEXT NOT NULL DEFAULT '',
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||
UNIQUE (tour_id, painting_id)
|
||||
);
|
||||
|
||||
-- Existing DBs created before updated_at: migrate-sync-timestamps.sql also adds it.
|
||||
ALTER TABLE tour_stops ADD COLUMN IF NOT EXISTS updated_at TIMESTAMPTZ NOT NULL DEFAULT now();
|
||||
|
||||
CREATE INDEX IF NOT EXISTS tour_stops_tour_idx ON tour_stops (tour_id, sort_order);
|
||||
CREATE INDEX IF NOT EXISTS tour_stops_painting_idx ON tour_stops (painting_id);
|
||||
|
||||
@@ -38,3 +42,8 @@ DROP TRIGGER IF EXISTS tours_updated_at ON tours;
|
||||
CREATE TRIGGER tours_updated_at
|
||||
BEFORE UPDATE ON tours
|
||||
FOR EACH ROW EXECUTE PROCEDURE tours_touch_updated_at();
|
||||
|
||||
DROP TRIGGER IF EXISTS tour_stops_updated_at ON tour_stops;
|
||||
CREATE TRIGGER tour_stops_updated_at
|
||||
BEFORE UPDATE ON tour_stops
|
||||
FOR EACH ROW EXECUTE PROCEDURE tours_touch_updated_at();
|
||||
|
||||
Reference in New Issue
Block a user