deckhearth/migrations/1787711511000_add-frame-textures-game-sharing.js

34 lines
809 B
JavaScript
Raw Normal View History

/**
* Designer follow-ups:
* - custom_frames.texture_url: optional background texture image for
* custom frames (renders behind the card's panels).
* - custom_games.is_public: share a custom game space to the community
* section (read-only).
*/
export const up = (pgm) => {
pgm.sql(`
ALTER TABLE custom_frames
ADD COLUMN IF NOT EXISTS texture_url TEXT
`);
pgm.sql(`
ALTER TABLE custom_games
ADD COLUMN IF NOT EXISTS is_public BOOLEAN NOT NULL DEFAULT false
`);
pgm.sql(`
CREATE INDEX IF NOT EXISTS idx_custom_games_public
ON custom_games(is_public)
`);
};
export const down = (pgm) => {
pgm.sql(`
ALTER TABLE custom_games DROP COLUMN IF EXISTS is_public
`);
pgm.sql(`
ALTER TABLE custom_frames DROP COLUMN IF EXISTS texture_url
`);
};