From 21e41ed492f46c7d844ea501deab68ddbfb2725b Mon Sep 17 00:00:00 2001 From: rajun Date: Tue, 27 Oct 2026 16:28:46 +0530 Subject: [PATCH] feat: add project logo backing and button style migration --- pb_migrations/1791860000_project_button_style.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 pb_migrations/1791860000_project_button_style.js diff --git a/pb_migrations/1791860000_project_button_style.js b/pb_migrations/1791860000_project_button_style.js new file mode 100644 index 0000000..62a93ab --- /dev/null +++ b/pb_migrations/1791860000_project_button_style.js @@ -0,0 +1,16 @@ +/// + +// Custom logo backing colour, and per-project button text colour + label +const HEX = "^#[0-9a-fA-F]{6}$"; + +migrate((app) => { + const projects = app.findCollectionByNameOrId("projects"); + projects.fields.add(new Field({ type: "text", name: "logo_bg_color", pattern: HEX })); + projects.fields.add(new Field({ type: "text", name: "button_text_color", pattern: HEX })); + projects.fields.add(new Field({ type: "text", name: "button_label", max: 32 })); + app.save(projects); +}, (app) => { + const projects = app.findCollectionByNameOrId("projects"); + for (const name of ["logo_bg_color", "button_text_color", "button_label"]) projects.fields.removeByName(name); + app.save(projects); +});