feat: add project logo backing and button style migration

This commit is contained in:
rajun 2026-10-27 16:28:46 +05:30
parent e5ff11a79d
commit 21e41ed492

View File

@ -0,0 +1,16 @@
/// <reference path="../pocketbase/pb_data/types.d.ts" />
// 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);
});