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

  // update collection data
  unmarshal({
    "indexes": [
      "CREATE UNIQUE INDEX `idx_bQGELhzt8l` ON `costsTime` (\n  `org`,\n  `refId`\n)"
    ]
  }, collection)

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

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

  // update collection data
  unmarshal({
    "indexes": [
      "CREATE UNIQUE INDEX `idx_bQGELhzt8l` ON `costsTime` (\n  `org`,\n  `ref_id`\n)"
    ]
  }, collection)

  // update 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)
})