From 511720d59b25b4bd499bc62b83dd5079721b9daa Mon Sep 17 00:00:00 2001 From: Ben Allfree Date: Sat, 9 Nov 2024 10:36:41 +0000 Subject: [PATCH] campaign migrations --- .../1730944175_updated_campaign_messages.js | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 packages/pockethost/src/mothership-app/migrations/pb_migrations/1730944175_updated_campaign_messages.js diff --git a/packages/pockethost/src/mothership-app/migrations/pb_migrations/1730944175_updated_campaign_messages.js b/packages/pockethost/src/mothership-app/migrations/pb_migrations/1730944175_updated_campaign_messages.js new file mode 100644 index 00000000..cc2d7eb1 --- /dev/null +++ b/packages/pockethost/src/mothership-app/migrations/pb_migrations/1730944175_updated_campaign_messages.js @@ -0,0 +1,44 @@ +/// +migrate((db) => { + const dao = new Dao(db) + const collection = dao.findCollectionByNameOrId("w1vjr1edr5tsam3") + + // update + collection.schema.addField(new SchemaField({ + "system": false, + "id": "lxy9jyyk", + "name": "subject", + "type": "text", + "required": true, + "presentable": true, + "unique": false, + "options": { + "min": null, + "max": null, + "pattern": "" + } + })) + + return dao.saveCollection(collection) +}, (db) => { + const dao = new Dao(db) + const collection = dao.findCollectionByNameOrId("w1vjr1edr5tsam3") + + // update + collection.schema.addField(new SchemaField({ + "system": false, + "id": "lxy9jyyk", + "name": "subject", + "type": "text", + "required": true, + "presentable": false, + "unique": false, + "options": { + "min": null, + "max": null, + "pattern": "" + } + })) + + return dao.saveCollection(collection) +})