aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2026-06-11 14:41:12 -0700
committerPinapelz <yukais@pinapelz.com>2026-06-11 14:41:12 -0700
commitbd239c8dd65c54577f94f09f6033edb5f6c3ecd2 (patch)
tree6624078ec98efc8e805d8893df096615ce8ae3b7
parent4b1c9d1669eb30a093742f7b5319e66a13428271 (diff)
score table migration to add user and chart relation
-rw-r--r--pb_migrations/1781213804_updated_scores.js20
-rw-r--r--pb_migrations/1781214015_updated_scores.js78
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)
+})
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage