astro_minivan/backend/pb_migrations/1765512000_updated_b_navbar.js

270 lines
6.2 KiB
JavaScript
Raw Normal View History

2026-03-29 17:24:16 +05:00
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_863577031");
// add field for label
collection.fields.addAt(1, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text3752831548",
"max": 0,
"min": 0,
"name": "label",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}));
// add field for href
collection.fields.addAt(2, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text245810965",
"max": 0,
"min": 0,
"name": "href",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}));
// add field for order
collection.fields.addAt(3, new Field({
"hidden": false,
"id": "number1357924680",
"max": null,
"min": null,
"name": "order",
"onlyInt": true,
"presentable": false,
"required": false,
"system": false,
"type": "number"
}));
// add field for is_active
collection.fields.addAt(4, new Field({
"hidden": false,
"id": "bool1234567890",
"name": "is_active",
"presentable": false,
"required": false,
"system": false,
"type": "bool"
}));
// add field for section
collection.fields.addAt(5, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text1122334455",
"max": 0,
"min": 0,
"name": "section",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}));
// add field for column_title
collection.fields.addAt(6, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text2233445566",
"max": 0,
"min": 0,
"name": "column_title",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}));
// add field for column_order
collection.fields.addAt(7, new Field({
"hidden": false,
"id": "number1122334455",
"max": null,
"min": null,
"name": "column_order",
"onlyInt": true,
"presentable": false,
"required": false,
"system": false,
"type": "number"
}));
// add field for item_order
collection.fields.addAt(8, new Field({
"hidden": false,
"id": "number2233445566",
"max": null,
"min": null,
"name": "item_order",
"onlyInt": true,
"presentable": false,
"required": false,
"system": false,
"type": "number"
}));
// add field for is_cta
collection.fields.addAt(9, new Field({
"hidden": false,
"id": "bool1122334455",
"name": "is_cta",
"presentable": false,
"required": false,
"system": false,
"type": "bool"
}));
// add field for item_type
collection.fields.addAt(10, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text3344556677",
"max": 0,
"min": 0,
"name": "item_type",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}));
// add field for target_blank
collection.fields.addAt(11, new Field({
"hidden": false,
"id": "bool2233445566",
"name": "target_blank",
"presentable": false,
"required": false,
"system": false,
"type": "bool"
}));
// add field for css_class
collection.fields.addAt(12, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text4455667788",
"max": 0,
"min": 0,
"name": "css_class",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}));
// add field for show_on_desktop
collection.fields.addAt(13, new Field({
"hidden": false,
"id": "bool3344556677",
"name": "show_on_desktop",
"presentable": false,
"required": false,
"system": false,
"type": "bool"
}));
// add field for show_on_mobile
collection.fields.addAt(14, new Field({
"hidden": false,
"id": "bool4455667788",
"name": "show_on_mobile",
"presentable": false,
"required": false,
"system": false,
"type": "bool"
}));
// add field for svg_icon
collection.fields.addAt(15, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text5566778899",
"max": 0,
"min": 0,
"name": "svg_icon",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}));
// add field for hover_color_class
collection.fields.addAt(16, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text6677889900",
"max": 0,
"min": 0,
"name": "hover_color_class",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}));
// add field for icon
collection.fields.addAt(17, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text7788990011",
"max": 0,
"min": 0,
"name": "icon",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}));
return app.save(collection);
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_863577031");
// remove all added fields
collection.fields.removeById("text3752831548");
collection.fields.removeById("text245810965");
collection.fields.removeById("number1357924680");
collection.fields.removeById("bool1234567890");
collection.fields.removeById("text1122334455");
collection.fields.removeById("text2233445566");
collection.fields.removeById("number1122334455");
collection.fields.removeById("number2233445566");
collection.fields.removeById("bool1122334455");
collection.fields.removeById("text3344556677");
collection.fields.removeById("bool2233445566");
collection.fields.removeById("text4455667788");
collection.fields.removeById("bool3344556677");
collection.fields.removeById("bool4455667788");
collection.fields.removeById("text5566778899");
collection.fields.removeById("text6677889900");
collection.fields.removeById("text7788990011");
return app.save(collection);
})