/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
  const dao = new Dao(db)
  const collection = dao.findCollectionByNameOrId("e864strfxo14pm4")

  // add
  collection.schema.addField(new SchemaField({
    "system": false,
    "id": "b49obm5u",
    "name": "category",
    "type": "relation",
    "required": false,
    "presentable": false,
    "unique": false,
    "options": {
      "collectionId": "kjxvi8asj2igqwf",
      "cascadeDelete": false,
      "minSelect": null,
      "maxSelect": 1,
      "displayFields": null
    }
  }))

  return dao.saveCollection(collection)
}, (db) => {
  const dao = new Dao(db)
  const collection = dao.findCollectionByNameOrId("e864strfxo14pm4")

  // remove
  collection.schema.removeField("b49obm5u")

  return dao.saveCollection(collection)
})
