/// <reference path="../pb_data/types.d.ts" />
migrate(
  app => {
    const collection = app.findCollectionByNameOrId('pbc_918751319');
    if (!collection.fields.fieldNames().includes('pos')) {
      collection.fields.addAt(collection.fields.length, new Field({
        hidden: false,
        id: 'number7720012001',
        max: null,
        min: 0,
        name: 'pos',
        onlyInt: false,
        presentable: false,
        required: false,
        system: false,
        type: 'number'
      }));
    }
    return app.save(collection);
  },
  app => {
    const collection = app.findCollectionByNameOrId('pbc_918751319');
    if (collection.fields.fieldNames().includes('pos')) {
      collection.fields.removeByName('pos');
    }
    return app.save(collection);
  }
);
