32 lines
720 B
JavaScript
32 lines
720 B
JavaScript
/// <reference path="../pb_data/types.d.ts" />
|
|
migrate((db) => {
|
|
const dao = new Dao(db)
|
|
const collection = dao.findCollectionByNameOrId("zfbbb4gbdk9dh6k")
|
|
|
|
// add
|
|
collection.schema.addField(new SchemaField({
|
|
"system": false,
|
|
"id": "ghj1hkic",
|
|
"name": "confidence",
|
|
"type": "number",
|
|
"required": false,
|
|
"presentable": false,
|
|
"unique": false,
|
|
"options": {
|
|
"min": null,
|
|
"max": null,
|
|
"noDecimal": false
|
|
}
|
|
}))
|
|
|
|
return dao.saveCollection(collection)
|
|
}, (db) => {
|
|
const dao = new Dao(db)
|
|
const collection = dao.findCollectionByNameOrId("zfbbb4gbdk9dh6k")
|
|
|
|
// remove
|
|
collection.schema.removeField("ghj1hkic")
|
|
|
|
return dao.saveCollection(collection)
|
|
})
|