chore: backfill system collection descriptions #60

Merged
varutasu merged 1 commit from chore/migrate-system-collection-description into main 2026-06-02 01:42:23 -04:00
Showing only changes of commit 09bc53ff1f - Show all commits

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');
};