musclecat/pb_migrations/1702060974_updated_tasks.js

33 lines
799 B
JavaScript

/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("pf13z4hs1iubw41")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "6gfllcfj",
"name": "list",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "i42xt9r6ykqdq3j",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("pf13z4hs1iubw41")
// remove
collection.schema.removeField("6gfllcfj")
return dao.saveCollection(collection)
})