Hello from MCP server
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_3981801833")
// add field
collection.fields.addAt(4, new Field({
"cascadeDelete": false,
"collectionId": "pbc_4087614041",
"hidden": false,
"id": "relation2542791873",
"maxSelect": 1,
"minSelect": 0,
"name": "costsTime",
"presentable": false,
"required": false,
"system": false,
"type": "relation"
}))
// add field
collection.fields.addAt(5, new Field({
"cascadeDelete": false,
"collectionId": "pbc_3503383967",
"hidden": false,
"id": "relation1462576577",
"maxSelect": 1,
"minSelect": 0,
"name": "costsMaterial",
"presentable": false,
"required": false,
"system": false,
"type": "relation"
}))
// add field
collection.fields.addAt(6, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text565658025",
"max": 0,
"min": 0,
"name": "ref_id",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_3981801833")
// remove field
collection.fields.removeById("relation2542791873")
// remove field
collection.fields.removeById("relation1462576577")
// remove field
collection.fields.removeById("text565658025")
return app.save(collection)
})