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

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

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

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

  // add field
  collection.fields.addAt(5, new Field({
    "cascadeDelete": false,
    "collectionId": "pbc_1340419796",
    "hidden": false,
    "id": "relation2029409178",
    "maxSelect": 999,
    "minSelect": 0,
    "name": "badges",
    "presentable": false,
    "required": false,
    "system": false,
    "type": "relation"
  }))

  // add field
  collection.fields.addAt(6, new Field({
    "cascadeDelete": false,
    "collectionId": "pbc_1340419796",
    "hidden": false,
    "id": "relation2813965191",
    "maxSelect": 1,
    "minSelect": 0,
    "name": "featured_badge",
    "presentable": false,
    "required": false,
    "system": false,
    "type": "relation"
  }))

  return app.save(collection)
})
