deckhearth/migrations/1787685911000_add-custom-cards-art-mode-flavor-quote.js
Randall Stillwell 147041d292 feat(designer): rarity badges, flavor quotes with dividers, full-art mode
- rarity now renders as shape+color symbol anchored inside the type bar
  (circle/diamond/pentagon/star per rarity) — fixes straddling gem alignment
- new flavor_quote field: centered italic quotation with ornamental
  diamond dividers between description/actions/quote
- framed | fullart toggle: full-art bleeds artwork edge-to-edge with
  title/cost top scrim and type/text bottom scrim
- shared pickDesignFields lib so create/update routes cannot drift
- migration 1787685911000: art_mode + flavor_quote columns
2026-08-24 16:19:24 -05:00

37 lines
929 B
JavaScript

/**
* 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
`);
};