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

  sources.fields.add(new Field({
    "hidden": false,
    "id": "json_progress",
    "maxSize": 0,
    "name": "progress",
    "presentable": false,
    "required": false,
    "system": false,
    "type": "json"
  }));

  app.save(sources);
}, (app) => {
  const sources = app.findCollectionByNameOrId("sources");
  sources.fields.removeById("json_progress");
  app.save(sources);
});
