feat: add project logo backing and button style migration
This commit is contained in:
parent
e5ff11a79d
commit
21e41ed492
16
pb_migrations/1791860000_project_button_style.js
Normal file
16
pb_migrations/1791860000_project_button_style.js
Normal 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);
|
||||||
|
});
|
||||||
Loading…
x
Reference in New Issue
Block a user