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

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

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

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

  // add field
  collection.fields.addAt(3, new Field({
    "autogeneratePattern": "",
    "hidden": false,
    "id": "text_song",
    "max": 10,
    "min": 1,
    "name": "song",
    "pattern": "",
    "presentable": false,
    "primaryKey": false,
    "required": false,
    "system": false,
    "type": "text"
  }))

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

  return app.save(collection)
})
