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

  // update collection data
  unmarshal({
    "indexes": [
      "CREATE UNIQUE INDEX `idx_ga9IDWWYbf` ON `subheddits` (`access`)",
      "CREATE UNIQUE INDEX `idx_92fMLQnrtL` ON `subheddits` (`name`)"
    ],
    "name": "subheddits"
  }, collection)

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

  // update collection data
  unmarshal({
    "indexes": [
      "CREATE UNIQUE INDEX `idx_ga9IDWWYbf` ON `subheddit` (`access`)",
      "CREATE UNIQUE INDEX `idx_92fMLQnrtL` ON `subheddit` (`name`)"
    ],
    "name": "subheddit"
  }, collection)

  return app.save(collection)
})
