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

  if (!collection.fields.fieldNames().includes("autojudges")) {
    collection.fields.addAt(
      collection.fields.length,
      new Field({
        "hidden": false,
        "id": "bool1779700001",
        "name": "autojudges",
        "presentable": false,
        "required": false,
        "system": false,
        "type": "bool"
      })
    );
  }

  return app.save(collection);
}, (app) => {
  const collection = app.findCollectionByNameOrId("pbc_2769025244");
  if (collection.fields.fieldNames().includes("autojudges")) {
    collection.fields.removeByName("autojudges");
  }
  return app.save(collection);
});
