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

  // update
  collection.schema.addField(new SchemaField({
    "system": false,
    "id": "mfk9eat0",
    "name": "status",
    "type": "select",
    "required": true,
    "presentable": false,
    "unique": false,
    "options": {
      "maxSelect": 1,
      "values": [
        "draft",
        "published",
        "rejected"
      ]
    }
  }))

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

  // update
  collection.schema.addField(new SchemaField({
    "system": false,
    "id": "mfk9eat0",
    "name": "status",
    "type": "select",
    "required": true,
    "presentable": false,
    "unique": false,
    "options": {
      "maxSelect": 1,
      "values": [
        "draft",
        "published"
      ]
    }
  }))

  return dao.saveCollection(collection)
})
