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

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

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

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

  return dao.saveCollection(collection)
})
