astro_minivan/backend/pb_migrations/1766048955_updated_about_hero.js
2026-03-29 17:24:16 +05:00

62 lines
1.3 KiB
JavaScript

/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_3161158982")
// add field
collection.fields.addAt(2, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text724990059",
"max": 0,
"min": 0,
"name": "title",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
// add field
collection.fields.addAt(3, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text1367709617",
"max": 0,
"min": 0,
"name": "subtitle",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
// add field
collection.fields.addAt(4, new Field({
"hidden": false,
"id": "bool458715613",
"name": "is_active",
"presentable": false,
"required": false,
"system": false,
"type": "bool"
}))
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_3161158982")
// remove field
collection.fields.removeById("text724990059")
// remove field
collection.fields.removeById("text1367709617")
// remove field
collection.fields.removeById("bool458715613")
return app.save(collection)
})