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.
65 lines
1.6 KiB
JavaScript
65 lines
1.6 KiB
JavaScript
/// <reference path="../pb_data/types.d.ts" />
|
|
migrate((app) => {
|
|
const collection = new Collection({
|
|
"createRule": null,
|
|
"deleteRule": null,
|
|
"fields": [
|
|
{
|
|
"autogeneratePattern": "",
|
|
"hidden": false,
|
|
"id": "text3208210256",
|
|
"max": 0,
|
|
"min": 0,
|
|
"name": "id",
|
|
"pattern": "^[a-z0-9]+$",
|
|
"presentable": false,
|
|
"primaryKey": true,
|
|
"required": true,
|
|
"system": true,
|
|
"type": "text"
|
|
},
|
|
{
|
|
"autogeneratePattern": "",
|
|
"hidden": false,
|
|
"id": "_clone_wFQB",
|
|
"max": 0,
|
|
"min": 0,
|
|
"name": "policyNumber",
|
|
"pattern": "",
|
|
"presentable": false,
|
|
"primaryKey": false,
|
|
"required": false,
|
|
"system": false,
|
|
"type": "text"
|
|
},
|
|
{
|
|
"hidden": false,
|
|
"id": "number432430951",
|
|
"max": null,
|
|
"min": null,
|
|
"name": "cnt",
|
|
"onlyInt": false,
|
|
"presentable": false,
|
|
"required": false,
|
|
"system": false,
|
|
"type": "number"
|
|
}
|
|
],
|
|
"id": "pbc_2992844423",
|
|
"indexes": [],
|
|
"listRule": null,
|
|
"name": "testDorz",
|
|
"system": false,
|
|
"type": "view",
|
|
"updateRule": null,
|
|
"viewQuery": "select \n (ROW_NUMBER() OVER()) as id,\n policyNumber, \n count(policyNumber) as cnt\nfrom `Dorz1` \ngroup by policyNumber\nhaving cnt > 1;",
|
|
"viewRule": null
|
|
});
|
|
|
|
return app.save(collection);
|
|
}, (app) => {
|
|
const collection = app.findCollectionByNameOrId("pbc_2992844423");
|
|
|
|
return app.delete(collection);
|
|
})
|