new widget types 2
This commit is contained in:
@@ -1,20 +1,22 @@
|
||||
/// PocketBase migration: half_width on home_filter_widgets.
|
||||
///
|
||||
/// Apply after 1740000004 if that collection already exists.
|
||||
/// Apply after 1740000004 if that collection already exists without half_width.
|
||||
/// For new installs, 1740000004 already creates half_width — this is a no-op then.
|
||||
migrate((app) => {
|
||||
const col = app.findCollectionByNameOrId("home_filter_widgets");
|
||||
col.fields.add({
|
||||
type: "bool",
|
||||
if (col.fields.getByName("half_width")) return;
|
||||
|
||||
col.fields.add(new BoolField({
|
||||
name: "half_width",
|
||||
required: false,
|
||||
});
|
||||
}));
|
||||
app.save(col);
|
||||
}, (app) => {
|
||||
try {
|
||||
const col = app.findCollectionByNameOrId("home_filter_widgets");
|
||||
const field = col.fields.getByName("half_width");
|
||||
if (field) {
|
||||
col.fields.remove(field);
|
||||
col.fields.removeById(field.id);
|
||||
app.save(col);
|
||||
}
|
||||
} catch (_) {}
|
||||
|
||||
Reference in New Issue
Block a user