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

  // add
  collection.schema.addField(new SchemaField({
    "system": false,
    "id": "pawur2j5",
    "name": "nombre",
    "type": "text",
    "required": true,
    "presentable": false,
    "unique": false,
    "options": {
      "min": null,
      "max": 100,
      "pattern": ""
    }
  }))

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

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

  return dao.saveCollection(collection)
})
