From c151c320977e1804f8adc9ca5cfb99aa6b01dca4 Mon Sep 17 00:00:00 2001 From: Ben Allfree Date: Fri, 10 Jan 2025 11:46:20 +0000 Subject: [PATCH] enh: add subscription quantity to users --- .../pb_migrations/1736478456_updated_users.js | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 packages/pockethost/src/mothership-app/pb_migrations/1736478456_updated_users.js diff --git a/packages/pockethost/src/mothership-app/pb_migrations/1736478456_updated_users.js b/packages/pockethost/src/mothership-app/pb_migrations/1736478456_updated_users.js new file mode 100644 index 00000000..4421136d --- /dev/null +++ b/packages/pockethost/src/mothership-app/pb_migrations/1736478456_updated_users.js @@ -0,0 +1,31 @@ +/// +migrate((db) => { + const dao = new Dao(db) + const collection = dao.findCollectionByNameOrId("systemprofiles0") + + // add + collection.schema.addField(new SchemaField({ + "system": false, + "id": "u4ckg6um", + "name": "subscription_quantity", + "type": "number", + "required": false, + "presentable": false, + "unique": false, + "options": { + "min": null, + "max": null, + "noDecimal": false + } + })) + + return dao.saveCollection(collection) +}, (db) => { + const dao = new Dao(db) + const collection = dao.findCollectionByNameOrId("systemprofiles0") + + // remove + collection.schema.removeField("u4ckg6um") + + return dao.saveCollection(collection) +})