From 1441863dcd2b836a495158301e733e6abf97696b Mon Sep 17 00:00:00 2001 From: louiscklaw Date: Mon, 12 May 2025 14:01:52 +0800 Subject: [PATCH] ```remove obsolete UserMetas migrations and related user collection modifications``` --- .../1746681012_deleted_UserMetas.js | 136 ------------------ .../1746681213_updated_UserMetas.js | 45 ------ .../pb_migrations/1746681267_updated_users.js | 29 ---- .../1746681302_updated_UserMetas.js | 29 ---- .../1746683304_updated_Teachers.js | 20 --- 5 files changed, 259 deletions(-) delete mode 100644 002_source/pocketbase/pb_migrations/1746681012_deleted_UserMetas.js delete mode 100644 002_source/pocketbase/pb_migrations/1746681213_updated_UserMetas.js delete mode 100644 002_source/pocketbase/pb_migrations/1746681267_updated_users.js delete mode 100644 002_source/pocketbase/pb_migrations/1746681302_updated_UserMetas.js delete mode 100644 002_source/pocketbase/pb_migrations/1746683304_updated_Teachers.js diff --git a/002_source/pocketbase/pb_migrations/1746681012_deleted_UserMetas.js b/002_source/pocketbase/pb_migrations/1746681012_deleted_UserMetas.js deleted file mode 100644 index 29d91b2..0000000 --- a/002_source/pocketbase/pb_migrations/1746681012_deleted_UserMetas.js +++ /dev/null @@ -1,136 +0,0 @@ -/// -migrate((app) => { - const collection = app.findCollectionByNameOrId("pbc_1305841361"); - - return app.delete(collection); -}, (app) => { - const collection = new Collection({ - "createRule": "", - "deleteRule": "", - "fields": [ - { - "autogeneratePattern": "[a-z0-9]{15}", - "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": "", - "hidden": false, - "id": "text4192936109", - "max": 0, - "min": 0, - "name": "helloworld", - "pattern": "", - "presentable": false, - "primaryKey": false, - "required": false, - "system": false, - "type": "text" - }, - { - "hidden": false, - "id": "json3622966325", - "maxSize": 0, - "name": "meta", - "presentable": false, - "required": false, - "system": false, - "type": "json" - }, - { - "cascadeDelete": false, - "collectionId": "_pb_users_auth_", - "hidden": false, - "id": "relation2809058197", - "maxSelect": 1, - "minSelect": 0, - "name": "user_id", - "presentable": false, - "required": false, - "system": false, - "type": "relation" - }, - { - "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" - }, - { - "autogeneratePattern": "", - "hidden": false, - "id": "text2744374011", - "max": 0, - "min": 0, - "name": "state", - "pattern": "", - "presentable": false, - "primaryKey": false, - "required": false, - "system": false, - "type": "text" - }, - { - "hidden": false, - "id": "file376926767", - "maxSelect": 1, - "maxSize": 0, - "mimeTypes": [], - "name": "avatar", - "presentable": false, - "protected": false, - "required": false, - "system": false, - "thumbs": [], - "type": "file" - }, - { - "autogeneratePattern": "", - "hidden": false, - "id": "text1466534506", - "max": 0, - "min": 0, - "name": "role", - "pattern": "", - "presentable": false, - "primaryKey": false, - "required": false, - "system": false, - "type": "text" - } - ], - "id": "pbc_1305841361", - "indexes": [], - "listRule": "", - "name": "UserMetas", - "system": false, - "type": "base", - "updateRule": "", - "viewRule": "" - }); - - return app.save(collection); -}) diff --git a/002_source/pocketbase/pb_migrations/1746681213_updated_UserMetas.js b/002_source/pocketbase/pb_migrations/1746681213_updated_UserMetas.js deleted file mode 100644 index 9ed9628..0000000 --- a/002_source/pocketbase/pb_migrations/1746681213_updated_UserMetas.js +++ /dev/null @@ -1,45 +0,0 @@ -/// -migrate((app) => { - const collection = app.findCollectionByNameOrId("pbc_1305841361") - - // add field - collection.fields.addAt(9, new Field({ - "autogeneratePattern": "", - "hidden": false, - "id": "text1579384326", - "max": 0, - "min": 0, - "name": "name", - "pattern": "", - "presentable": false, - "primaryKey": false, - "required": false, - "system": false, - "type": "text" - })) - - // add field - collection.fields.addAt(10, new Field({ - "exceptDomains": null, - "hidden": false, - "id": "email3885137012", - "name": "email", - "onlyDomains": null, - "presentable": false, - "required": false, - "system": false, - "type": "email" - })) - - return app.save(collection) -}, (app) => { - const collection = app.findCollectionByNameOrId("pbc_1305841361") - - // remove field - collection.fields.removeById("text1579384326") - - // remove field - collection.fields.removeById("email3885137012") - - return app.save(collection) -}) diff --git a/002_source/pocketbase/pb_migrations/1746681267_updated_users.js b/002_source/pocketbase/pb_migrations/1746681267_updated_users.js deleted file mode 100644 index fee62ea..0000000 --- a/002_source/pocketbase/pb_migrations/1746681267_updated_users.js +++ /dev/null @@ -1,29 +0,0 @@ -/// -migrate((app) => { - const collection = app.findCollectionByNameOrId("_pb_users_auth_") - - // add field - collection.fields.addAt(11, new Field({ - "autogeneratePattern": "", - "hidden": false, - "id": "text1146066909", - "max": 0, - "min": 0, - "name": "phone", - "pattern": "", - "presentable": false, - "primaryKey": false, - "required": false, - "system": false, - "type": "text" - })) - - return app.save(collection) -}, (app) => { - const collection = app.findCollectionByNameOrId("_pb_users_auth_") - - // remove field - collection.fields.removeById("text1146066909") - - return app.save(collection) -}) diff --git a/002_source/pocketbase/pb_migrations/1746681302_updated_UserMetas.js b/002_source/pocketbase/pb_migrations/1746681302_updated_UserMetas.js deleted file mode 100644 index e955407..0000000 --- a/002_source/pocketbase/pb_migrations/1746681302_updated_UserMetas.js +++ /dev/null @@ -1,29 +0,0 @@ -/// -migrate((app) => { - const collection = app.findCollectionByNameOrId("pbc_1305841361") - - // add field - collection.fields.addAt(11, new Field({ - "autogeneratePattern": "", - "hidden": false, - "id": "text1146066909", - "max": 0, - "min": 0, - "name": "phone", - "pattern": "", - "presentable": false, - "primaryKey": false, - "required": false, - "system": false, - "type": "text" - })) - - return app.save(collection) -}, (app) => { - const collection = app.findCollectionByNameOrId("pbc_1305841361") - - // remove field - collection.fields.removeById("text1146066909") - - return app.save(collection) -}) diff --git a/002_source/pocketbase/pb_migrations/1746683304_updated_Teachers.js b/002_source/pocketbase/pb_migrations/1746683304_updated_Teachers.js deleted file mode 100644 index 7c577b4..0000000 --- a/002_source/pocketbase/pb_migrations/1746683304_updated_Teachers.js +++ /dev/null @@ -1,20 +0,0 @@ -/// -migrate((app) => { - const collection = app.findCollectionByNameOrId("pbc_1413424569") - - // update collection data - unmarshal({ - "name": "Teachers_xxx" - }, collection) - - return app.save(collection) -}, (app) => { - const collection = app.findCollectionByNameOrId("pbc_1413424569") - - // update collection data - unmarshal({ - "name": "Teachers" - }, collection) - - return app.save(collection) -})