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/1763198417_updated_testDorz.js

93 lines
2.3 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 NULL AS dvn_patient,\n Dorz3.patientName AS dorz_patient\nFROM Dorz3\nWHERE NOT EXISTS (\n SELECT 1 FROM Dvn1 WHERE Dvn1.patientName = Dorz3.patientName\n);"
}, collection)
// remove field
collection.fields.removeById("_clone_ioBw")
// remove field
collection.fields.removeById("_clone_sdmz")
// add field
collection.fields.addAt(1, new Field({
"hidden": false,
"id": "json4023128640",
"maxSize": 1,
"name": "dvn_patient",
"presentable": false,
"required": false,
"system": false,
"type": "json"
}))
// add field
collection.fields.addAt(2, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "_clone_SvKm",
"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.patientName AS dvn_patient,\n Dorz3.patientName AS dorz_patient\nFROM Dorz3\nLEFT JOIN Dvn1 ON Dvn1.patientName = Dorz3.patientName\nWHERE Dvn1.patientName IS NULL;"
}, collection)
// add field
collection.fields.addAt(1, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "_clone_ioBw",
"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_sdmz",
"max": 0,
"min": 0,
"name": "dorz_patient",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
// remove field
collection.fields.removeById("json4023128640")
// remove field
collection.fields.removeById("_clone_SvKm")
return app.save(collection)
})