45 lines
956 B
JavaScript
45 lines
956 B
JavaScript
|
|
/// <reference path="../pb_data/types.d.ts" />
|
||
|
|
migrate((db) => {
|
||
|
|
const dao = new Dao(db)
|
||
|
|
const collection = dao.findCollectionByNameOrId("ledgers_col")
|
||
|
|
|
||
|
|
// update
|
||
|
|
collection.schema.addField(new SchemaField({
|
||
|
|
"system": false,
|
||
|
|
"id": "lgr_desc",
|
||
|
|
"name": "description",
|
||
|
|
"type": "text",
|
||
|
|
"required": false,
|
||
|
|
"presentable": false,
|
||
|
|
"unique": false,
|
||
|
|
"options": {
|
||
|
|
"min": null,
|
||
|
|
"max": 500,
|
||
|
|
"pattern": ""
|
||
|
|
}
|
||
|
|
}))
|
||
|
|
|
||
|
|
return dao.saveCollection(collection)
|
||
|
|
}, (db) => {
|
||
|
|
const dao = new Dao(db)
|
||
|
|
const collection = dao.findCollectionByNameOrId("ledgers_col")
|
||
|
|
|
||
|
|
// update
|
||
|
|
collection.schema.addField(new SchemaField({
|
||
|
|
"system": false,
|
||
|
|
"id": "lgr_desc",
|
||
|
|
"name": "description",
|
||
|
|
"type": "text",
|
||
|
|
"required": true,
|
||
|
|
"presentable": false,
|
||
|
|
"unique": false,
|
||
|
|
"options": {
|
||
|
|
"min": null,
|
||
|
|
"max": 500,
|
||
|
|
"pattern": ""
|
||
|
|
}
|
||
|
|
}))
|
||
|
|
|
||
|
|
return dao.saveCollection(collection)
|
||
|
|
})
|