diff --git a/packages/pockethost/src/mothership-app/pb_migrations/1752933095_updated_instances.js b/packages/pockethost/src/mothership-app/pb_migrations/1752933095_updated_instances.js new file mode 100644 index 00000000..65124006 --- /dev/null +++ b/packages/pockethost/src/mothership-app/pb_migrations/1752933095_updated_instances.js @@ -0,0 +1,33 @@ +/// +migrate((db) => { + const dao = new Dao(db) + const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv") + + // remove + collection.schema.removeField("smblegnt") + + return dao.saveCollection(collection) +}, (db) => { + const dao = new Dao(db) + const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv") + + // add + collection.schema.addField(new SchemaField({ + "system": false, + "id": "smblegnt", + "name": "domains", + "type": "relation", + "required": false, + "presentable": false, + "unique": false, + "options": { + "collectionId": "jw1wz9nmkvnhcm6", + "cascadeDelete": false, + "minSelect": null, + "maxSelect": null, + "displayFields": null + } + })) + + return dao.saveCollection(collection) +}) diff --git a/packages/pockethost/src/mothership-app/pb_migrations/1752933103_deleted_domains.js b/packages/pockethost/src/mothership-app/pb_migrations/1752933103_deleted_domains.js new file mode 100644 index 00000000..47aead84 --- /dev/null +++ b/packages/pockethost/src/mothership-app/pb_migrations/1752933103_deleted_domains.js @@ -0,0 +1,73 @@ +/// +migrate((db) => { + const dao = new Dao(db); + const collection = dao.findCollectionByNameOrId("jw1wz9nmkvnhcm6"); + + return dao.deleteCollection(collection); +}, (db) => { + const collection = new Collection({ + "id": "jw1wz9nmkvnhcm6", + "created": "2025-07-18 05:18:37.698Z", + "updated": "2025-07-19 01:09:48.781Z", + "name": "domains", + "type": "base", + "system": false, + "schema": [ + { + "system": false, + "id": "fhie5snn", + "name": "instance", + "type": "relation", + "required": false, + "presentable": false, + "unique": false, + "options": { + "collectionId": "etae8tuiaxl6xfv", + "cascadeDelete": false, + "minSelect": null, + "maxSelect": 1, + "displayFields": null + } + }, + { + "system": false, + "id": "wn3oncif", + "name": "domain", + "type": "text", + "required": false, + "presentable": true, + "unique": false, + "options": { + "min": null, + "max": null, + "pattern": "" + } + }, + { + "system": false, + "id": "vzkcvhhg", + "name": "active", + "type": "bool", + "required": false, + "presentable": false, + "unique": false, + "options": {} + } + ], + "indexes": [ + "CREATE UNIQUE INDEX `idx_gtGcwf2` ON `domains` (`domain`)", + "CREATE INDEX `idx_OtPOwXe` ON `domains` (`instance`)", + "CREATE INDEX `idx_0omsTdi` ON `domains` (`created`)", + "CREATE INDEX `idx_uMaIOVQ` ON `domains` (`updated`)", + "CREATE UNIQUE INDEX `idx_VLBOSap` ON `domains` (\n `instance`,\n `domain`\n)" + ], + "listRule": "@request.auth.id=instance.uid", + "viewRule": "@request.auth.id=instance.uid", + "createRule": null, + "updateRule": null, + "deleteRule": null, + "options": {} + }); + + return Dao(db).saveCollection(collection); +})