deckhearth/migrations/1787718511000_add-frame-image-layout.js

24 lines
691 B
JavaScript
Raw Normal View History

/**
* Image-based custom frames:
* - frame_image_url: full-card frame artwork (PNG with transparent
* windows for art/text) rendered as the card base layer.
* - layout: art/text window zones as 0-1 fractions of the card
* ({ art: {x,y,w,h}, text: {x,y,w,h} }) so windows align with the
* uploaded image regardless of render size.
*/
export const up = (pgm) => {
pgm.sql(`
ALTER TABLE custom_frames
ADD COLUMN IF NOT EXISTS frame_image_url TEXT,
ADD COLUMN IF NOT EXISTS layout JSONB
`);
};
export const down = (pgm) => {
pgm.sql(`
ALTER TABLE custom_frames
DROP COLUMN IF EXISTS layout,
DROP COLUMN IF EXISTS frame_image_url
`);
};