From 00193651aac43e4e5ee8e08a8ba0cafcc42e0844 Mon Sep 17 00:00:00 2001 From: varutasu <104105839+varutasu@users.noreply.github.com> Date: Tue, 2 Jun 2026 00:42:23 -0500 Subject: [PATCH] Backfill system collection descriptions to current vocabulary. (#60) Existing is_system_collection rows may carry stale copy; align them with VOCAB.SYSTEM_COLLECTION_SEED_DESCRIPTION so UI matches new signups. Co-authored-by: Cursor --- ...378340194_system-collection-description.js | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 migrations/1780378340194_system-collection-description.js diff --git a/migrations/1780378340194_system-collection-description.js b/migrations/1780378340194_system-collection-description.js new file mode 100644 index 0000000..89b2abb --- /dev/null +++ b/migrations/1780378340194_system-collection-description.js @@ -0,0 +1,31 @@ +/** + * Backfill system collection descriptions to match VOCAB.SYSTEM_COLLECTION_SEED_DESCRIPTION + * in lib/collection-vocabulary.js (pick-a-name / collection-vocabulary convoy). + * + * @type {import('node-pg-migrate').ColumnDefinitions | undefined} + */ +export const shorthands = undefined; + +/** + * @param pgm {import('node-pg-migrate').MigrationBuilder} + * @param run {() => void | undefined} + * @returns {Promise | void} + */ +export const up = (pgm) => { + pgm.sql(` + UPDATE collections + SET description = 'Automatically syncs with My Collection. This list cannot be deleted or made public.' + WHERE is_system_collection = true + `); +}; + +/** + * Irreversible — prior description text is not preserved. + * + * @param pgm {import('node-pg-migrate').MigrationBuilder} + * @param run {() => void | undefined} + * @returns {Promise | void} + */ +export const down = () => { + throw new Error('Irreversible data migration'); +};