48 lines
1.1 KiB
JavaScript
48 lines
1.1 KiB
JavaScript
/// <reference path="../pb_data/types.d.ts" />
|
|
migrate((app) => {
|
|
const collection = app.findCollectionByNameOrId("pbc_2541054544")
|
|
|
|
// add field
|
|
collection.fields.addAt(22, new Field({
|
|
"cascadeDelete": false,
|
|
"collectionId": "pbc_3346940990",
|
|
"hidden": false,
|
|
"id": "relation1841317061",
|
|
"maxSelect": 1,
|
|
"minSelect": 0,
|
|
"name": "group",
|
|
"presentable": false,
|
|
"required": false,
|
|
"system": false,
|
|
"type": "relation"
|
|
}))
|
|
|
|
// add field
|
|
collection.fields.addAt(23, new Field({
|
|
"autogeneratePattern": "",
|
|
"hidden": false,
|
|
"id": "text3987859035",
|
|
"max": 0,
|
|
"min": 0,
|
|
"name": "match_type",
|
|
"pattern": "",
|
|
"presentable": false,
|
|
"primaryKey": false,
|
|
"required": false,
|
|
"system": false,
|
|
"type": "text"
|
|
}))
|
|
|
|
return app.save(collection)
|
|
}, (app) => {
|
|
const collection = app.findCollectionByNameOrId("pbc_2541054544")
|
|
|
|
// remove field
|
|
collection.fields.removeById("relation1841317061")
|
|
|
|
// remove field
|
|
collection.fields.removeById("text3987859035")
|
|
|
|
return app.save(collection)
|
|
})
|