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

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

  // add
  collection.schema.addField(new SchemaField({
    "system": false,
    "id": "artkpdru",
    "name": "portrait",
    "type": "file",
    "required": false,
    "presentable": false,
    "unique": false,
    "options": {
      "maxSelect": 1,
      "maxSize": 5242880,
      "mimeTypes": [],
      "thumbs": [],
      "protected": false
    }
  }))

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

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

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

  return dao.saveCollection(collection)
})
