From 62a0d11e9854b4f0132b6b957425b499db656271 Mon Sep 17 00:00:00 2001 From: Ben Allfree Date: Thu, 7 Dec 2023 12:39:12 +0000 Subject: [PATCH] chore: update instance subdomain regex --- .../1700847183_updated_instances.js | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/mothership-app/migrations/1700847183_updated_instances.js diff --git a/src/mothership-app/migrations/1700847183_updated_instances.js b/src/mothership-app/migrations/1700847183_updated_instances.js new file mode 100644 index 00000000..59a54f38 --- /dev/null +++ b/src/mothership-app/migrations/1700847183_updated_instances.js @@ -0,0 +1,44 @@ +/// +migrate((db) => { + const dao = new Dao(db) + const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv") + + // update + collection.schema.addField(new SchemaField({ + "system": false, + "id": "qdtuuld1", + "name": "subdomain", + "type": "text", + "required": true, + "presentable": false, + "unique": false, + "options": { + "min": null, + "max": 50, + "pattern": "^[a-z][a-z0-9-]{2,39}$" + } + })) + + return dao.saveCollection(collection) +}, (db) => { + const dao = new Dao(db) + const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv") + + // update + collection.schema.addField(new SchemaField({ + "system": false, + "id": "qdtuuld1", + "name": "subdomain", + "type": "text", + "required": true, + "presentable": false, + "unique": false, + "options": { + "min": null, + "max": 50, + "pattern": "^[a-z][\\-a-z]+$" + } + })) + + return dao.saveCollection(collection) +})