diff options
| -rw-r--r-- | pb_migrations/1781213804_updated_scores.js | 20 | ||||
| -rw-r--r-- | pb_migrations/1781214015_updated_scores.js | 78 |
2 files changed, 98 insertions, 0 deletions
diff --git a/pb_migrations/1781213804_updated_scores.js b/pb_migrations/1781213804_updated_scores.js new file mode 100644 index 0000000..0d952fa --- /dev/null +++ b/pb_migrations/1781213804_updated_scores.js @@ -0,0 +1,20 @@ +/// <reference path="../pb_data/types.d.ts" /> +migrate((app) => { + const collection = app.findCollectionByNameOrId("pbc_809716240") + + // update collection data + unmarshal({ + "createRule": "@request.auth.id != \"\"" + }, collection) + + return app.save(collection) +}, (app) => { + const collection = app.findCollectionByNameOrId("pbc_809716240") + + // update collection data + unmarshal({ + "createRule": null + }, collection) + + return app.save(collection) +}) diff --git a/pb_migrations/1781214015_updated_scores.js b/pb_migrations/1781214015_updated_scores.js new file mode 100644 index 0000000..b432213 --- /dev/null +++ b/pb_migrations/1781214015_updated_scores.js @@ -0,0 +1,78 @@ +/// <reference path="../pb_data/types.d.ts" /> +migrate((app) => { + const collection = app.findCollectionByNameOrId("pbc_809716240") + + // update collection data + unmarshal({ + "createRule": "@request.auth.id != \"\" && user.id = @request.auth.id" + }, collection) + + // remove field + collection.fields.removeById("text2657985370") + + // add field + collection.fields.addAt(6, new Field({ + "cascadeDelete": false, + "collectionId": "_pb_users_auth_", + "help": "", + "hidden": false, + "id": "relation2375276105", + "maxSelect": 0, + "minSelect": 0, + "name": "user", + "presentable": false, + "required": false, + "system": false, + "type": "relation" + })) + + // add field + collection.fields.addAt(7, new Field({ + "cascadeDelete": false, + "collectionId": "pbc_4148374969", + "help": "", + "hidden": false, + "id": "relation3847629354", + "maxSelect": 0, + "minSelect": 0, + "name": "chart", + "presentable": false, + "required": false, + "system": false, + "type": "relation" + })) + + return app.save(collection) +}, (app) => { + const collection = app.findCollectionByNameOrId("pbc_809716240") + + // update collection data + unmarshal({ + "createRule": "@request.auth.id != \"\"" + }, collection) + + // add field + collection.fields.addAt(1, new Field({ + "autogeneratePattern": "", + "help": "", + "hidden": false, + "id": "text2657985370", + "max": 0, + "min": 0, + "name": "chartId", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": false, + "system": false, + "type": "text" + })) + + // remove field + collection.fields.removeById("relation2375276105") + + // remove field + collection.fields.removeById("relation3847629354") + + return app.save(collection) +}) |
