/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
  const collection = app.findCollectionByNameOrId("pbc_809716240")

  // remove field
  collection.fields.removeById("select586325581")

  // add field
  collection.fields.addAt(7, new Field({
    "hidden": false,
    "id": "number586325581",
    "max": null,
    "min": null,
    "name": "songNum",
    "onlyInt": false,
    "presentable": false,
    "required": false,
    "system": false,
    "type": "number"
  }))

  return app.save(collection)
}, (app) => {
  const collection = app.findCollectionByNameOrId("pbc_809716240")

  // add field
  collection.fields.addAt(3, new Field({
    "hidden": false,
    "id": "select586325581",
    "maxSelect": 1,
    "name": "songNum",
    "presentable": false,
    "required": false,
    "system": false,
    "type": "select",
    "values": [
      "1",
      "2"
    ]
  }))

  // remove field
  collection.fields.removeById("number586325581")

  return app.save(collection)
})
