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

102 lines
2.2 KiB
JavaScript

/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_3940974")
// add field
collection.fields.addAt(3, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text4143632462",
"max": 0,
"min": 0,
"name": "whatsapp_number",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
// add field
collection.fields.addAt(4, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text1768261586",
"max": 0,
"min": 0,
"name": "contact_phone",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
// add field
collection.fields.addAt(5, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text273018052",
"max": 0,
"min": 0,
"name": "contact_phone_href",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
// add field
collection.fields.addAt(6, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text3401084027",
"max": 0,
"min": 0,
"name": "contact_email",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
// add field
collection.fields.addAt(7, new Field({
"exceptDomains": null,
"hidden": false,
"id": "url1819778643",
"name": "contact_email_href",
"onlyDomains": null,
"presentable": false,
"required": false,
"system": false,
"type": "url"
}))
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_3940974")
// remove field
collection.fields.removeById("text4143632462")
// remove field
collection.fields.removeById("text1768261586")
// remove field
collection.fields.removeById("text273018052")
// remove field
collection.fields.removeById("text3401084027")
// remove field
collection.fields.removeById("url1819778643")
return app.save(collection)
})