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

  // add field
  collection.fields.addAt(5, new Field({
    "autogeneratePattern": "",
    "hidden": false,
    "id": "text3868298200",
    "max": 0,
    "min": 0,
    "name": "bhsId",
    "pattern": "",
    "presentable": false,
    "primaryKey": false,
    "required": false,
    "system": false,
    "type": "text"
  }))

  // add field
  collection.fields.addAt(6, new Field({
    "autogeneratePattern": "",
    "hidden": false,
    "id": "text834753671",
    "max": 0,
    "min": 0,
    "name": "district",
    "pattern": "",
    "presentable": false,
    "primaryKey": false,
    "required": false,
    "system": false,
    "type": "text"
  }))

  // add field
  collection.fields.addAt(7, new Field({
    "autogeneratePattern": "",
    "hidden": false,
    "id": "text269960980",
    "max": 0,
    "min": 0,
    "name": "division",
    "pattern": "",
    "presentable": false,
    "primaryKey": false,
    "required": false,
    "system": false,
    "type": "text"
  }))

  // add field
  collection.fields.addAt(8, new Field({
    "autogeneratePattern": "",
    "hidden": false,
    "id": "text3616816488",
    "max": 0,
    "min": 0,
    "name": "area",
    "pattern": "",
    "presentable": false,
    "primaryKey": false,
    "required": false,
    "system": false,
    "type": "text"
  }))

  // add field
  collection.fields.addAt(9, new Field({
    "autogeneratePattern": "",
    "hidden": false,
    "id": "text3340845937",
    "max": 0,
    "min": 0,
    "name": "chapters",
    "pattern": "",
    "presentable": false,
    "primaryKey": false,
    "required": false,
    "system": false,
    "type": "text"
  }))

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

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

  // add field
  collection.fields.addAt(12, new Field({
    "hidden": false,
    "id": "bool321103221",
    "name": "evaluation",
    "presentable": false,
    "required": false,
    "system": false,
    "type": "bool"
  }))

  // add field
  collection.fields.addAt(13, new Field({
    "hidden": false,
    "id": "bool1625438169",
    "name": "scoreEvalOnly",
    "presentable": false,
    "required": false,
    "system": false,
    "type": "bool"
  }))

  // add field
  collection.fields.addAt(14, new Field({
    "autogeneratePattern": "",
    "hidden": false,
    "id": "text859837811",
    "max": 0,
    "min": 0,
    "name": "contacts",
    "pattern": "",
    "presentable": false,
    "primaryKey": false,
    "required": false,
    "system": false,
    "type": "text"
  }))

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

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

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

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

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

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

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

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

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

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

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

  return app.save(collection)
})
