You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
board/pb_migrations/1763196655_updated_testDorz.js

97 lines
2.4 KiB
JavaScript

/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_2992844423")
// update collection data
unmarshal({
"viewQuery": "select \n (ROW_NUMBER() OVER()) as id,\n `Dvn1`.`patientName` as dvn_patient, \n `Dorz3`.`patientName` as dorz_patient\nfrom `Dorz3` \n join `Dvn1` on `Dvn1`.`patientName` = `Dorz3`.`patientName`\nwhere `Dorz3`.`patientName` ISNULL\n"
}, collection)
// remove field
collection.fields.removeById("_clone_KmkI")
// remove field
collection.fields.removeById("_clone_4kSO")
// add field
collection.fields.addAt(1, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "_clone_qxuf",
"max": 0,
"min": 0,
"name": "dvn_patient",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
// add field
collection.fields.addAt(2, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "_clone_tyZ1",
"max": 0,
"min": 0,
"name": "dorz_patient",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_2992844423")
// update collection data
unmarshal({
"viewQuery": "select \n (ROW_NUMBER() OVER()) as id,\n `Dvn1`.`policyNumber` as dvn_patient, \n `Dorz1`.`policyNumber` as dorz_patient\nfrom `Dorz1` \n join `Dvn1` on `Dvn1`.`policyNumber` = `Dorz1`.`policyNumber`\nwhere `Dorz1`.`patientName` ISNULL\n"
}, collection)
// add field
collection.fields.addAt(1, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "_clone_KmkI",
"max": 0,
"min": 0,
"name": "dvn_patient",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
// add field
collection.fields.addAt(2, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "_clone_4kSO",
"max": 0,
"min": 0,
"name": "dorz_patient",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
// remove field
collection.fields.removeById("_clone_qxuf")
// remove field
collection.fields.removeById("_clone_tyZ1")
return app.save(collection)
})