Hello from MCP server
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_4087614041")
// add field
collection.fields.addAt(2, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text1579384326",
"max": 0,
"min": 0,
"name": "name",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
// add field
collection.fields.addAt(3, new Field({
"cascadeDelete": false,
"collectionId": "pbc_2873630990",
"hidden": false,
"id": "relation1914026624",
"maxSelect": 1,
"minSelect": 0,
"name": "org",
"presentable": false,
"required": false,
"system": false,
"type": "relation"
}))
// add field
collection.fields.addAt(4, 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_4087614041")
// remove field
collection.fields.removeById("text1579384326")
// remove field
collection.fields.removeById("relation1914026624")
// remove field
collection.fields.removeById("text565658025")
return app.save(collection)
})