feat(F-103): completed feature
This commit is contained in:
23
project/migrations/034_category_description_colors.js
Normal file
23
project/migrations/034_category_description_colors.js
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Adds description and explicit card colors (background + text) to categories.
|
||||
* - description: visible category description (AI can fill it when empty).
|
||||
* - bg_color / text_color: hex colors used by category cards in the storefront.
|
||||
* All columns are nullable — existing categories remain unaffected.
|
||||
*/
|
||||
export const up = (pgm) => {
|
||||
pgm.sql(`
|
||||
ALTER TABLE categories_categories
|
||||
ADD COLUMN IF NOT EXISTS description TEXT NULL DEFAULT NULL,
|
||||
ADD COLUMN IF NOT EXISTS bg_color VARCHAR(20) NULL DEFAULT NULL,
|
||||
ADD COLUMN IF NOT EXISTS text_color VARCHAR(20) NULL DEFAULT NULL
|
||||
`);
|
||||
};
|
||||
|
||||
export const down = (pgm) => {
|
||||
pgm.sql(`
|
||||
ALTER TABLE categories_categories
|
||||
DROP COLUMN IF EXISTS description,
|
||||
DROP COLUMN IF EXISTS bg_color,
|
||||
DROP COLUMN IF EXISTS text_color
|
||||
`);
|
||||
};
|
||||
Reference in New Issue
Block a user