aboutsummaryrefslogtreecommitdiffstats
path: root/pb_migrations
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2026-06-05 11:23:34 -0700
committerPinapelz <yukais@pinapelz.com>2026-06-05 11:23:34 -0700
commit95d56dd94153cf464ada2c9bbbe840a3da14f98a (patch)
tree9967f18d5f0a6f0f189078f0fa05929bd234980f /pb_migrations
init commit
Diffstat (limited to 'pb_migrations')
-rw-r--r--pb_migrations/1780454593_deleted_users.js223
-rw-r--r--pb_migrations/1780455015_created_games.js127
-rw-r--r--pb_migrations/1780455076_updated_games.js45
-rw-r--r--pb_migrations/1780455123_created_movies.js140
-rw-r--r--pb_migrations/1780458989_updated_games.js20
-rw-r--r--pb_migrations/1780542471_updated_games.js20
-rw-r--r--pb_migrations/1780542481_deleted_movies.js140
-rw-r--r--pb_migrations/1780542767_updated_list.js24
8 files changed, 739 insertions, 0 deletions
diff --git a/pb_migrations/1780454593_deleted_users.js b/pb_migrations/1780454593_deleted_users.js
new file mode 100644
index 0000000..96bfb9f
--- /dev/null
+++ b/pb_migrations/1780454593_deleted_users.js
@@ -0,0 +1,223 @@
+/// <reference path="../pb_data/types.d.ts" />
+migrate((app) => {
+ const collection = app.findCollectionByNameOrId("_pb_users_auth_");
+
+ return app.delete(collection);
+}, (app) => {
+ const collection = new Collection({
+ "authAlert": {
+ "emailTemplate": {
+ "body": "<p>Hello,</p>\n<p>We noticed a login to your {APP_NAME} account from a new location:</p>\n<p><em>{ALERT_INFO}</em></p>\n<p><strong>If this wasn't you, you should immediately change your {APP_NAME} account password to revoke access from all other locations.</strong></p>\n<p>If this was you, you may disregard this email.</p>\n<p>\n Thanks,<br/>\n {APP_NAME} team\n</p>",
+ "subject": "Login from a new location"
+ },
+ "enabled": true
+ },
+ "authRule": "",
+ "authToken": {
+ "duration": 432000
+ },
+ "confirmEmailChangeTemplate": {
+ "body": "<p>Hello,</p>\n<p>Click on the button below to confirm your new email address.</p>\n<p>\n <a class=\"btn\" href=\"{APP_URL}/_/#/auth/confirm-email-change/{TOKEN}\" target=\"_blank\" rel=\"noopener\">Confirm new email</a>\n</p>\n<p><i>If you didn't ask to change your email address, please ignore this email.</i></p>\n<p>\n Thanks,<br/>\n {APP_NAME} team\n</p>",
+ "subject": "Confirm your {APP_NAME} new email address"
+ },
+ "createRule": "",
+ "deleteRule": "id = @request.auth.id",
+ "emailChangeToken": {
+ "duration": 1800
+ },
+ "fields": [
+ {
+ "autogeneratePattern": "[a-z0-9]{15}",
+ "help": "",
+ "hidden": false,
+ "id": "text3208210256",
+ "max": 15,
+ "min": 15,
+ "name": "id",
+ "pattern": "^[a-z0-9]+$",
+ "presentable": false,
+ "primaryKey": true,
+ "required": true,
+ "system": true,
+ "type": "text"
+ },
+ {
+ "cost": 0,
+ "help": "",
+ "hidden": true,
+ "id": "password901924565",
+ "max": 0,
+ "min": 8,
+ "name": "password",
+ "pattern": "",
+ "presentable": false,
+ "required": true,
+ "system": true,
+ "type": "password"
+ },
+ {
+ "autogeneratePattern": "[a-zA-Z0-9]{50}",
+ "help": "",
+ "hidden": true,
+ "id": "text2504183744",
+ "max": 60,
+ "min": 30,
+ "name": "tokenKey",
+ "pattern": "",
+ "presentable": false,
+ "primaryKey": false,
+ "required": true,
+ "system": true,
+ "type": "text"
+ },
+ {
+ "exceptDomains": null,
+ "help": "",
+ "hidden": false,
+ "id": "email3885137012",
+ "name": "email",
+ "onlyDomains": null,
+ "presentable": false,
+ "required": true,
+ "system": true,
+ "type": "email"
+ },
+ {
+ "help": "",
+ "hidden": false,
+ "id": "bool1547992806",
+ "name": "emailVisibility",
+ "presentable": false,
+ "required": false,
+ "system": true,
+ "type": "bool"
+ },
+ {
+ "help": "",
+ "hidden": false,
+ "id": "bool256245529",
+ "name": "verified",
+ "presentable": false,
+ "required": false,
+ "system": true,
+ "type": "bool"
+ },
+ {
+ "autogeneratePattern": "",
+ "help": "",
+ "hidden": false,
+ "id": "text1579384326",
+ "max": 255,
+ "min": 0,
+ "name": "name",
+ "pattern": "",
+ "presentable": false,
+ "primaryKey": false,
+ "required": false,
+ "system": false,
+ "type": "text"
+ },
+ {
+ "help": "",
+ "hidden": false,
+ "id": "file376926767",
+ "maxSelect": 1,
+ "maxSize": 0,
+ "mimeTypes": [
+ "image/jpeg",
+ "image/png",
+ "image/svg+xml",
+ "image/gif",
+ "image/webp"
+ ],
+ "name": "avatar",
+ "presentable": false,
+ "protected": false,
+ "required": false,
+ "system": false,
+ "thumbs": null,
+ "type": "file"
+ },
+ {
+ "hidden": false,
+ "id": "autodate2990389176",
+ "name": "created",
+ "onCreate": true,
+ "onUpdate": false,
+ "presentable": false,
+ "system": false,
+ "type": "autodate"
+ },
+ {
+ "hidden": false,
+ "id": "autodate3332085495",
+ "name": "updated",
+ "onCreate": true,
+ "onUpdate": true,
+ "presentable": false,
+ "system": false,
+ "type": "autodate"
+ }
+ ],
+ "fileToken": {
+ "duration": 180
+ },
+ "id": "_pb_users_auth_",
+ "indexes": [
+ "CREATE UNIQUE INDEX `idx_tokenKey__pb_users_auth_` ON `users` (`tokenKey`)",
+ "CREATE UNIQUE INDEX `idx_email__pb_users_auth_` ON `users` (`email`) WHERE `email` != ''"
+ ],
+ "listRule": "id = @request.auth.id",
+ "manageRule": null,
+ "mfa": {
+ "duration": 600,
+ "enabled": false,
+ "rule": ""
+ },
+ "name": "users",
+ "oauth2": {
+ "enabled": false,
+ "mappedFields": {
+ "avatarURL": "avatar",
+ "id": "",
+ "name": "name",
+ "username": ""
+ }
+ },
+ "otp": {
+ "duration": 180,
+ "emailTemplate": {
+ "body": "<p>Hello,</p>\n<p>Your one-time password is: <strong>{OTP}</strong></p>\n<p><i>If you didn't ask for the one-time password, you can ignore this email.</i></p>\n<p>\n Thanks,<br/>\n {APP_NAME} team\n</p>",
+ "subject": "OTP for {APP_NAME}"
+ },
+ "enabled": false,
+ "length": 8
+ },
+ "passwordAuth": {
+ "enabled": true,
+ "identityFields": [
+ "email"
+ ]
+ },
+ "passwordResetToken": {
+ "duration": 1800
+ },
+ "resetPasswordTemplate": {
+ "body": "<p>Hello,</p>\n<p>Click on the button below to reset your password.</p>\n<p>\n <a class=\"btn\" href=\"{APP_URL}/_/#/auth/confirm-password-reset/{TOKEN}\" target=\"_blank\" rel=\"noopener\">Reset password</a>\n</p>\n<p><i>If you didn't ask to reset your password, please ignore this email.</i></p>\n<p>\n Thanks,<br/>\n {APP_NAME} team\n</p>",
+ "subject": "Reset your {APP_NAME} password"
+ },
+ "system": false,
+ "type": "auth",
+ "updateRule": "id = @request.auth.id",
+ "verificationTemplate": {
+ "body": "<p>Hello,</p>\n<p>Thank you for joining us at {APP_NAME}.</p>\n<p>Click on the button below to verify your email address.</p>\n<p>\n <a class=\"btn\" href=\"{APP_URL}/_/#/auth/confirm-verification/{TOKEN}\" target=\"_blank\" rel=\"noopener\">Verify</a>\n</p>\n<p><i>If you didn't recently register, please ignore this email.</i></p>\n<p>\n Thanks,<br/>\n {APP_NAME} team\n</p>",
+ "subject": "Verify your {APP_NAME} email"
+ },
+ "verificationToken": {
+ "duration": 86400
+ },
+ "viewRule": "id = @request.auth.id"
+ });
+
+ return app.save(collection);
+})
diff --git a/pb_migrations/1780455015_created_games.js b/pb_migrations/1780455015_created_games.js
new file mode 100644
index 0000000..450c53c
--- /dev/null
+++ b/pb_migrations/1780455015_created_games.js
@@ -0,0 +1,127 @@
+/// <reference path="../pb_data/types.d.ts" />
+migrate((app) => {
+ const collection = new Collection({
+ "createRule": null,
+ "deleteRule": null,
+ "fields": [
+ {
+ "autogeneratePattern": "[a-z0-9]{15}",
+ "help": "",
+ "hidden": false,
+ "id": "text3208210256",
+ "max": 15,
+ "min": 15,
+ "name": "id",
+ "pattern": "^[a-z0-9]+$",
+ "presentable": false,
+ "primaryKey": true,
+ "required": true,
+ "system": true,
+ "type": "text"
+ },
+ {
+ "autogeneratePattern": "",
+ "help": "",
+ "hidden": false,
+ "id": "text1579384326",
+ "max": 0,
+ "min": 0,
+ "name": "name",
+ "pattern": "",
+ "presentable": false,
+ "primaryKey": false,
+ "required": false,
+ "system": false,
+ "type": "text"
+ },
+ {
+ "autogeneratePattern": "",
+ "help": "",
+ "hidden": false,
+ "id": "text1843675174",
+ "max": 0,
+ "min": 0,
+ "name": "description",
+ "pattern": "",
+ "presentable": false,
+ "primaryKey": false,
+ "required": false,
+ "system": false,
+ "type": "text"
+ },
+ {
+ "exceptDomains": null,
+ "help": "",
+ "hidden": false,
+ "id": "url3309110367",
+ "name": "image",
+ "onlyDomains": null,
+ "presentable": false,
+ "required": false,
+ "system": false,
+ "type": "url"
+ },
+ {
+ "autogeneratePattern": "",
+ "help": "",
+ "hidden": false,
+ "id": "text2363381545",
+ "max": 0,
+ "min": 0,
+ "name": "type",
+ "pattern": "",
+ "presentable": false,
+ "primaryKey": false,
+ "required": false,
+ "system": false,
+ "type": "text"
+ },
+ {
+ "exceptDomains": null,
+ "help": "",
+ "hidden": false,
+ "id": "url4101391790",
+ "name": "url",
+ "onlyDomains": null,
+ "presentable": false,
+ "required": false,
+ "system": false,
+ "type": "url"
+ },
+ {
+ "hidden": false,
+ "id": "autodate2990389176",
+ "name": "created",
+ "onCreate": true,
+ "onUpdate": false,
+ "presentable": false,
+ "system": false,
+ "type": "autodate"
+ },
+ {
+ "hidden": false,
+ "id": "autodate3332085495",
+ "name": "updated",
+ "onCreate": true,
+ "onUpdate": true,
+ "presentable": false,
+ "system": false,
+ "type": "autodate"
+ }
+ ],
+ "id": "pbc_879072730",
+ "indexes": [],
+ "listRule": null,
+ "name": "games",
+ "system": false,
+ "type": "base",
+ "updateRule": null,
+ "viewRule": null
+ });
+
+ return app.save(collection);
+}, (app) => {
+ const collection = app.findCollectionByNameOrId("pbc_879072730");
+
+ return app.delete(collection);
+})
diff --git a/pb_migrations/1780455076_updated_games.js b/pb_migrations/1780455076_updated_games.js
new file mode 100644
index 0000000..b19bcf8
--- /dev/null
+++ b/pb_migrations/1780455076_updated_games.js
@@ -0,0 +1,45 @@
+/// <reference path="../pb_data/types.d.ts" />
+migrate((app) => {
+ const collection = app.findCollectionByNameOrId("pbc_879072730")
+
+ // add field
+ collection.fields.addAt(6, new Field({
+ "help": "",
+ "hidden": false,
+ "id": "bool1825427252",
+ "name": "played",
+ "presentable": false,
+ "required": false,
+ "system": false,
+ "type": "bool"
+ }))
+
+ // add field
+ collection.fields.addAt(7, new Field({
+ "autogeneratePattern": "",
+ "help": "",
+ "hidden": false,
+ "id": "text18589324",
+ "max": 0,
+ "min": 0,
+ "name": "notes",
+ "pattern": "",
+ "presentable": false,
+ "primaryKey": false,
+ "required": false,
+ "system": false,
+ "type": "text"
+ }))
+
+ return app.save(collection)
+}, (app) => {
+ const collection = app.findCollectionByNameOrId("pbc_879072730")
+
+ // remove field
+ collection.fields.removeById("bool1825427252")
+
+ // remove field
+ collection.fields.removeById("text18589324")
+
+ return app.save(collection)
+})
diff --git a/pb_migrations/1780455123_created_movies.js b/pb_migrations/1780455123_created_movies.js
new file mode 100644
index 0000000..4161fa7
--- /dev/null
+++ b/pb_migrations/1780455123_created_movies.js
@@ -0,0 +1,140 @@
+/// <reference path="../pb_data/types.d.ts" />
+migrate((app) => {
+ const collection = new Collection({
+ "createRule": null,
+ "deleteRule": null,
+ "fields": [
+ {
+ "autogeneratePattern": "[a-z0-9]{15}",
+ "help": "",
+ "hidden": false,
+ "id": "text3208210256",
+ "max": 15,
+ "min": 15,
+ "name": "id",
+ "pattern": "^[a-z0-9]+$",
+ "presentable": false,
+ "primaryKey": true,
+ "required": true,
+ "system": true,
+ "type": "text"
+ },
+ {
+ "autogeneratePattern": "",
+ "help": "",
+ "hidden": false,
+ "id": "text724990059",
+ "max": 0,
+ "min": 0,
+ "name": "title",
+ "pattern": "",
+ "presentable": false,
+ "primaryKey": false,
+ "required": false,
+ "system": false,
+ "type": "text"
+ },
+ {
+ "autogeneratePattern": "",
+ "help": "",
+ "hidden": false,
+ "id": "text1843675174",
+ "max": 0,
+ "min": 0,
+ "name": "description",
+ "pattern": "",
+ "presentable": false,
+ "primaryKey": false,
+ "required": false,
+ "system": false,
+ "type": "text"
+ },
+ {
+ "exceptDomains": null,
+ "help": "",
+ "hidden": false,
+ "id": "url4101391790",
+ "name": "url",
+ "onlyDomains": null,
+ "presentable": false,
+ "required": false,
+ "system": false,
+ "type": "url"
+ },
+ {
+ "help": "",
+ "hidden": false,
+ "id": "bool1180390397",
+ "name": "watched",
+ "presentable": false,
+ "required": false,
+ "system": false,
+ "type": "bool"
+ },
+ {
+ "autogeneratePattern": "",
+ "help": "",
+ "hidden": false,
+ "id": "text18589324",
+ "max": 0,
+ "min": 0,
+ "name": "notes",
+ "pattern": "",
+ "presentable": false,
+ "primaryKey": false,
+ "required": false,
+ "system": false,
+ "type": "text"
+ },
+ {
+ "autogeneratePattern": "",
+ "help": "",
+ "hidden": false,
+ "id": "text2363381545",
+ "max": 0,
+ "min": 0,
+ "name": "type",
+ "pattern": "",
+ "presentable": false,
+ "primaryKey": false,
+ "required": false,
+ "system": false,
+ "type": "text"
+ },
+ {
+ "hidden": false,
+ "id": "autodate2990389176",
+ "name": "created",
+ "onCreate": true,
+ "onUpdate": false,
+ "presentable": false,
+ "system": false,
+ "type": "autodate"
+ },
+ {
+ "hidden": false,
+ "id": "autodate3332085495",
+ "name": "updated",
+ "onCreate": true,
+ "onUpdate": true,
+ "presentable": false,
+ "system": false,
+ "type": "autodate"
+ }
+ ],
+ "id": "pbc_4044198014",
+ "indexes": [],
+ "listRule": null,
+ "name": "movies",
+ "system": false,
+ "type": "base",
+ "updateRule": null,
+ "viewRule": null
+ });
+
+ return app.save(collection);
+}, (app) => {
+ const collection = app.findCollectionByNameOrId("pbc_4044198014");
+
+ return app.delete(collection);
+})
diff --git a/pb_migrations/1780458989_updated_games.js b/pb_migrations/1780458989_updated_games.js
new file mode 100644
index 0000000..e972307
--- /dev/null
+++ b/pb_migrations/1780458989_updated_games.js
@@ -0,0 +1,20 @@
+/// <reference path="../pb_data/types.d.ts" />
+migrate((app) => {
+ const collection = app.findCollectionByNameOrId("pbc_879072730")
+
+ // update collection data
+ unmarshal({
+ "listRule": ""
+ }, collection)
+
+ return app.save(collection)
+}, (app) => {
+ const collection = app.findCollectionByNameOrId("pbc_879072730")
+
+ // update collection data
+ unmarshal({
+ "listRule": null
+ }, collection)
+
+ return app.save(collection)
+})
diff --git a/pb_migrations/1780542471_updated_games.js b/pb_migrations/1780542471_updated_games.js
new file mode 100644
index 0000000..b969462
--- /dev/null
+++ b/pb_migrations/1780542471_updated_games.js
@@ -0,0 +1,20 @@
+/// <reference path="../pb_data/types.d.ts" />
+migrate((app) => {
+ const collection = app.findCollectionByNameOrId("pbc_879072730")
+
+ // update collection data
+ unmarshal({
+ "name": "list"
+ }, collection)
+
+ return app.save(collection)
+}, (app) => {
+ const collection = app.findCollectionByNameOrId("pbc_879072730")
+
+ // update collection data
+ unmarshal({
+ "name": "games"
+ }, collection)
+
+ return app.save(collection)
+})
diff --git a/pb_migrations/1780542481_deleted_movies.js b/pb_migrations/1780542481_deleted_movies.js
new file mode 100644
index 0000000..bd35d18
--- /dev/null
+++ b/pb_migrations/1780542481_deleted_movies.js
@@ -0,0 +1,140 @@
+/// <reference path="../pb_data/types.d.ts" />
+migrate((app) => {
+ const collection = app.findCollectionByNameOrId("pbc_4044198014");
+
+ return app.delete(collection);
+}, (app) => {
+ const collection = new Collection({
+ "createRule": null,
+ "deleteRule": null,
+ "fields": [
+ {
+ "autogeneratePattern": "[a-z0-9]{15}",
+ "help": "",
+ "hidden": false,
+ "id": "text3208210256",
+ "max": 15,
+ "min": 15,
+ "name": "id",
+ "pattern": "^[a-z0-9]+$",
+ "presentable": false,
+ "primaryKey": true,
+ "required": true,
+ "system": true,
+ "type": "text"
+ },
+ {
+ "autogeneratePattern": "",
+ "help": "",
+ "hidden": false,
+ "id": "text724990059",
+ "max": 0,
+ "min": 0,
+ "name": "title",
+ "pattern": "",
+ "presentable": false,
+ "primaryKey": false,
+ "required": false,
+ "system": false,
+ "type": "text"
+ },
+ {
+ "autogeneratePattern": "",
+ "help": "",
+ "hidden": false,
+ "id": "text1843675174",
+ "max": 0,
+ "min": 0,
+ "name": "description",
+ "pattern": "",
+ "presentable": false,
+ "primaryKey": false,
+ "required": false,
+ "system": false,
+ "type": "text"
+ },
+ {
+ "exceptDomains": null,
+ "help": "",
+ "hidden": false,
+ "id": "url4101391790",
+ "name": "url",
+ "onlyDomains": null,
+ "presentable": false,
+ "required": false,
+ "system": false,
+ "type": "url"
+ },
+ {
+ "help": "",
+ "hidden": false,
+ "id": "bool1180390397",
+ "name": "watched",
+ "presentable": false,
+ "required": false,
+ "system": false,
+ "type": "bool"
+ },
+ {
+ "autogeneratePattern": "",
+ "help": "",
+ "hidden": false,
+ "id": "text18589324",
+ "max": 0,
+ "min": 0,
+ "name": "notes",
+ "pattern": "",
+ "presentable": false,
+ "primaryKey": false,
+ "required": false,
+ "system": false,
+ "type": "text"
+ },
+ {
+ "autogeneratePattern": "",
+ "help": "",
+ "hidden": false,
+ "id": "text2363381545",
+ "max": 0,
+ "min": 0,
+ "name": "type",
+ "pattern": "",
+ "presentable": false,
+ "primaryKey": false,
+ "required": false,
+ "system": false,
+ "type": "text"
+ },
+ {
+ "hidden": false,
+ "id": "autodate2990389176",
+ "name": "created",
+ "onCreate": true,
+ "onUpdate": false,
+ "presentable": false,
+ "system": false,
+ "type": "autodate"
+ },
+ {
+ "hidden": false,
+ "id": "autodate3332085495",
+ "name": "updated",
+ "onCreate": true,
+ "onUpdate": true,
+ "presentable": false,
+ "system": false,
+ "type": "autodate"
+ }
+ ],
+ "id": "pbc_4044198014",
+ "indexes": [],
+ "listRule": null,
+ "name": "movies",
+ "system": false,
+ "type": "base",
+ "updateRule": null,
+ "viewRule": null
+ });
+
+ return app.save(collection);
+})
diff --git a/pb_migrations/1780542767_updated_list.js b/pb_migrations/1780542767_updated_list.js
new file mode 100644
index 0000000..181bc1f
--- /dev/null
+++ b/pb_migrations/1780542767_updated_list.js
@@ -0,0 +1,24 @@
+/// <reference path="../pb_data/types.d.ts" />
+migrate((app) => {
+ const collection = app.findCollectionByNameOrId("pbc_879072730")
+
+ // update collection data
+ unmarshal({
+ "createRule": "",
+ "updateRule": "",
+ "viewRule": ""
+ }, collection)
+
+ return app.save(collection)
+}, (app) => {
+ const collection = app.findCollectionByNameOrId("pbc_879072730")
+
+ // update collection data
+ unmarshal({
+ "createRule": null,
+ "updateRule": null,
+ "viewRule": null
+ }, collection)
+
+ return app.save(collection)
+})
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage