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_3149105702")

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

  // add field
  collection.fields.addAt(4, new Field({
    "autogeneratePattern": "",
    "hidden": false,
    "id": "text3756801849",
    "max": 0,
    "min": 0,
    "name": "rate",
    "pattern": "",
    "presentable": false,
    "primaryKey": false,
    "required": false,
    "system": false,
    "type": "text"
  }))

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

  // add field
  collection.fields.addAt(4, new Field({
    "hidden": false,
    "id": "number3756801849",
    "max": null,
    "min": null,
    "name": "rate",
    "onlyInt": false,
    "presentable": false,
    "required": false,
    "system": false,
    "type": "number"
  }))

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

  return app.save(collection)
})