deckhearth/migrations/1787685911000_add-custom-cards-art-mode-flavor-quote.js

38 lines
929 B
JavaScript
Raw Permalink Normal View History

/**
* Phase 1 designer upgrades:
* - art_mode: 'framed' (classic layout) | 'fullart' (edge-to-edge art,
* text on scrims)
* - flavor_quote: optional quotation rendered with decorative dividers
*/
export const up = (pgm) => {
pgm.sql(`
ALTER TABLE custom_cards
ADD COLUMN IF NOT EXISTS art_mode VARCHAR(20) NOT NULL DEFAULT 'framed',
ADD COLUMN IF NOT EXISTS flavor_quote TEXT
`);
pgm.sql(`
ALTER TABLE custom_cards
DROP CONSTRAINT IF EXISTS chk_custom_cards_art_mode
`);
pgm.sql(`
ALTER TABLE custom_cards
ADD CONSTRAINT chk_custom_cards_art_mode
CHECK (art_mode IN ('framed', 'fullart'))
`);
};
export const down = (pgm) => {
pgm.sql(`
ALTER TABLE custom_cards
DROP CONSTRAINT IF EXISTS chk_custom_cards_art_mode
`);
pgm.sql(`
ALTER TABLE custom_cards
DROP COLUMN IF EXISTS art_mode,
DROP COLUMN IF EXISTS flavor_quote
`);
};