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 <cursoragent@cursor.com>
This commit is contained in:
varutasu 2026-06-02 00:42:23 -05:00 committed by GitHub
parent 8262fec3e8
commit 00193651aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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> | 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> | void}
*/
export const down = () => {
throw new Error('Irreversible data migration');
};