Hello from MCP server

List Files | Just Commands | Repo | Logs

← back |
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
  const collection = app.findCollectionByNameOrId("pbc_650605163")

  // remove field
  collection.fields.removeById("relation724990059")

  // add field
  collection.fields.addAt(7, new Field({
    "cascadeDelete": false,
    "collectionId": "pbc_3875544977",
    "hidden": false,
    "id": "relation2962774935",
    "maxSelect": 999,
    "minSelect": 0,
    "name": "contentItems",
    "presentable": false,
    "required": false,
    "system": false,
    "type": "relation"
  }))

  return app.save(collection)
}, (app) => {
  const collection = app.findCollectionByNameOrId("pbc_650605163")

  // add field
  collection.fields.addAt(7, new Field({
    "cascadeDelete": false,
    "collectionId": "pbc_2014092141",
    "hidden": false,
    "id": "relation724990059",
    "maxSelect": 999,
    "minSelect": 0,
    "name": "contentItems",
    "presentable": false,
    "required": false,
    "system": false,
    "type": "relation"
  }))

  // remove field
  collection.fields.removeById("relation2962774935")

  return app.save(collection)
})