mothership migrations update

This commit is contained in:
Ben Allfree 2024-10-18 14:37:39 +00:00
parent 0562df200b
commit ef90214366
19 changed files with 2514 additions and 0 deletions

View File

@ -0,0 +1,18 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("18rfmj8aklx6bjq")
collection.indexes = [
"CREATE UNIQUE INDEX `idx_tsm2mRA` ON `sent_messages` (\n `user`,\n `campaign_message`\n)"
]
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("18rfmj8aklx6bjq")
collection.indexes = []
return dao.saveCollection(collection)
})

View File

@ -0,0 +1,71 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId("4jyrkxcora6bl8r");
return dao.deleteCollection(collection);
}, (db) => {
const collection = new Collection({
"id": "4jyrkxcora6bl8r",
"created": "2023-12-24 03:51:53.315Z",
"updated": "2024-10-12 22:53:33.717Z",
"name": "legacy_users",
"type": "view",
"system": false,
"schema": [
{
"system": false,
"id": "8jht2ome",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
},
{
"system": false,
"id": "8whql8c9",
"name": "isFounder",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "fftixxya",
"name": "subscription",
"type": "select",
"required": true,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"free",
"premium",
"lifetime",
"founder",
"legacy"
]
}
}
],
"indexes": [],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {
"query": "select u.id, u.email,u.isFounder,u.subscription,u.created,u.updated from verified_users u where u.isLegacy=1"
}
});
return Dao(db).saveCollection(collection);
})

View File

@ -0,0 +1,73 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId("1xetiik3maqvihl");
return dao.deleteCollection(collection);
}, (db) => {
const collection = new Collection({
"id": "1xetiik3maqvihl",
"created": "2024-07-03 22:26:16.959Z",
"updated": "2024-07-27 15:00:01.887Z",
"name": "unpaid_instances",
"type": "view",
"system": false,
"schema": [
{
"system": false,
"id": "f8nl2huf",
"name": "uid",
"type": "relation",
"required": true,
"presentable": false,
"unique": false,
"options": {
"collectionId": "systemprofiles0",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
},
{
"system": false,
"id": "fvdiv6cs",
"name": "subdomain",
"type": "text",
"required": true,
"presentable": true,
"unique": false,
"options": {
"min": null,
"max": 50,
"pattern": "^[a-z][a-z0-9-]{2,39}$"
}
},
{
"system": false,
"id": "3akaknyp",
"name": "suspension",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}
],
"indexes": [],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {
"query": "select instances.id, uid, subdomain, suspension, instances.updated from instances join verified_users vu where vu.id = uid and (vu.subscription=\"free\" or vu.subscription = \"legacy\")"
}
});
return Dao(db).saveCollection(collection);
})

View File

@ -0,0 +1,55 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId("aif4h1j462iqopo");
return dao.deleteCollection(collection);
}, (db) => {
const collection = new Collection({
"id": "aif4h1j462iqopo",
"created": "2023-12-14 09:01:33.345Z",
"updated": "2024-07-27 15:00:01.743Z",
"name": "settings",
"type": "base",
"system": false,
"schema": [
{
"system": false,
"id": "a0gyirdi",
"name": "name",
"type": "text",
"required": true,
"presentable": true,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "xso1u0og",
"name": "value",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 2000000
}
}
],
"indexes": [
"CREATE INDEX `idx_qMbeGsg` ON `settings` (`name`)"
],
"listRule": "",
"viewRule": "",
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {}
});
return Dao(db).saveCollection(collection);
})

View File

@ -0,0 +1,117 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y5lqraz7c4jvisu")
// remove
collection.schema.removeField("fksunfv1")
// remove
collection.schema.removeField("gmqwgamf")
// remove
collection.schema.removeField("crksfxsv")
// remove
collection.schema.removeField("qoshryii")
// remove
collection.schema.removeField("cmkxbt9j")
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y5lqraz7c4jvisu")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "fksunfv1",
"name": "instance",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "etae8tuiaxl6xfv",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "gmqwgamf",
"name": "campaign",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "yfhnigik0uvyt4m",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "crksfxsv",
"name": "campaign_message",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "w1vjr1edr5tsam3",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "qoshryii",
"name": "sent_message",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "18rfmj8aklx6bjq",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "cmkxbt9j",
"name": "payment",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "iff2jfzb89dwiov",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))
return dao.saveCollection(collection)
})

View File

@ -0,0 +1,31 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("18rfmj8aklx6bjq")
// remove
collection.schema.removeField("yzvlcy7m")
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("18rfmj8aklx6bjq")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "yzvlcy7m",
"name": "message",
"type": "text",
"required": true,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}))
return dao.saveCollection(collection)
})

View File

@ -0,0 +1,306 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("4kshuv7r3jdrst4")
// remove
collection.schema.removeField("q69x8w4a")
// remove
collection.schema.removeField("er2ylafm")
// remove
collection.schema.removeField("vpmfcodf")
// remove
collection.schema.removeField("anvzvrl7")
// remove
collection.schema.removeField("185juzjg")
// remove
collection.schema.removeField("ldm3npvb")
// remove
collection.schema.removeField("5cjjcfgn")
// remove
collection.schema.removeField("krgy04py")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "d1ih2lys",
"name": "username",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "a2lkatzz",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "rrnexgam",
"name": "subscription",
"type": "select",
"required": true,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"free",
"premium",
"lifetime",
"founder",
"legacy"
]
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "nw92xw4d",
"name": "subscription_interval",
"type": "select",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"month",
"year",
"life"
]
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "wdvo6qe5",
"name": "isLegacy",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "exomhe8e",
"name": "tokenKey",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 1
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "kvuurum5",
"name": "passwordHash",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 1
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "z14fromd",
"name": "unsubscribe",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("4kshuv7r3jdrst4")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "q69x8w4a",
"name": "username",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "er2ylafm",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "vpmfcodf",
"name": "subscription",
"type": "select",
"required": true,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"free",
"premium",
"lifetime",
"founder",
"legacy"
]
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "anvzvrl7",
"name": "subscription_interval",
"type": "select",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"month",
"year",
"life"
]
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "185juzjg",
"name": "isLegacy",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "ldm3npvb",
"name": "tokenKey",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 1
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "5cjjcfgn",
"name": "passwordHash",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 1
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "krgy04py",
"name": "unsubscribe",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}))
// remove
collection.schema.removeField("d1ih2lys")
// remove
collection.schema.removeField("a2lkatzz")
// remove
collection.schema.removeField("rrnexgam")
// remove
collection.schema.removeField("nw92xw4d")
// remove
collection.schema.removeField("wdvo6qe5")
// remove
collection.schema.removeField("exomhe8e")
// remove
collection.schema.removeField("kvuurum5")
// remove
collection.schema.removeField("z14fromd")
return dao.saveCollection(collection)
})

View File

@ -0,0 +1,186 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("s00x84jumfjcuvc")
collection.options = {
"query": "select id, username, email, subscription, subscription_interval ,created,updated from verified_users where unsubscribe=0"
}
// remove
collection.schema.removeField("nxgkeook")
// remove
collection.schema.removeField("aegnhgqh")
// remove
collection.schema.removeField("cm0hyyx3")
// remove
collection.schema.removeField("smjrftnt")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "nxduzx8j",
"name": "username",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "uxypjefe",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "2eksisrf",
"name": "subscription",
"type": "select",
"required": true,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"free",
"premium",
"lifetime",
"founder",
"legacy"
]
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "9vsfyoqa",
"name": "subscription_interval",
"type": "select",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"month",
"year",
"life"
]
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("s00x84jumfjcuvc")
collection.options = {
"query": "select id, username, email, subscription, subscription_interval, created,updated from verified_users where unsubscribe=0"
}
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "nxgkeook",
"name": "username",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "aegnhgqh",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "cm0hyyx3",
"name": "subscription",
"type": "select",
"required": true,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"free",
"premium",
"lifetime",
"founder",
"legacy"
]
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "smjrftnt",
"name": "subscription_interval",
"type": "select",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"month",
"year",
"life"
]
}
}))
// remove
collection.schema.removeField("nxduzx8j")
// remove
collection.schema.removeField("uxypjefe")
// remove
collection.schema.removeField("2eksisrf")
// remove
collection.schema.removeField("9vsfyoqa")
return dao.saveCollection(collection)
})

View File

@ -0,0 +1,799 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("buq519uv711078p")
collection.options = {
"query": "SELECT\n (ROW_NUMBER() OVER()) as id,\n COUNT(DISTINCT users.id) AS total_users,\n COUNT(DISTINCT CASE WHEN users.subscription ='free' THEN users.id END) AS total_free_subscribers,\n COUNT(DISTINCT CASE WHEN users.subscription= 'premium' THEN users.id END) AS total_pro_subscribers,\n COUNT(DISTINCT CASE WHEN users.subscription= 'premium' and users.subscription_interval='month' THEN users.id END) AS total_pro_month_subscribers,\n COUNT(DISTINCT CASE WHEN users.subscription= 'premium' and users.subscription_interval='year' THEN users.id END) AS total_pro_year_subscribers,\n COUNT(DISTINCT CASE WHEN users.subscription= 'founder' THEN users.id END) AS total_founder_subscribers,\n COUNT(DISTINCT CASE WHEN users.subscription= 'flounder' THEN users.id END) AS total_flounder_subscribers,\n \n COUNT(DISTINCT CASE WHEN users.created > DATETIME('now', '-1 hour') THEN users.id END) AS new_users_last_hour,\n COUNT(DISTINCT CASE WHEN users.created > DATETIME('now', '-24 hours') THEN users.id END) AS new_users_last_24_hours,\n COUNT(DISTINCT CASE WHEN users.created > DATETIME('now', '-7 days') THEN users.id END) AS new_users_last_7_days,\n COUNT(DISTINCT CASE WHEN users.created > DATETIME('now', '-30 days') THEN users.id END) AS new_users_last_30_days,\n \n COUNT(DISTINCT instances.id ) AS total_instances,\n COUNT(DISTINCT CASE WHEN instances.updated > DATETIME('now', '-1 hour') THEN instances.id END) AS total_instances_last_hour,\n COUNT(DISTINCT CASE WHEN instances.updated > DATETIME('now', '-24 hours') THEN instances.id END) AS total_instances_last_24_hours,\n COUNT(DISTINCT CASE WHEN instances.updated > DATETIME('now', '-7 days') THEN instances.id END) AS total_instances_last_7_days,\n COUNT(DISTINCT CASE WHEN instances.updated > DATETIME('now', '-30 days') THEN instances.id END) AS total_instances_last_30_days,\n \n COUNT(DISTINCT CASE WHEN instances.created > DATETIME('now', '-1 hour') THEN instances.id END) AS new_instances_last_hour,\n COUNT(DISTINCT CASE WHEN instances.created > DATETIME('now', '-24 hours') THEN instances.id END) AS new_instances_last_24_hours,\n COUNT(DISTINCT CASE WHEN instances.created > DATETIME('now', '-7 days') THEN instances.id END) AS new_instances_last_7_days,\n COUNT(DISTINCT CASE WHEN instances.created > DATETIME('now', '-30 days') THEN instances.id END) AS new_instances_last_30_days\n \nFROM\n verified_users users\nLEFT JOIN\n instances ON users.id = instances.uid;\n"
}
// remove
collection.schema.removeField("y2weqof7")
// remove
collection.schema.removeField("sr33ovja")
// remove
collection.schema.removeField("mq2acp0p")
// remove
collection.schema.removeField("nmjyqh18")
// remove
collection.schema.removeField("l5wcacsc")
// remove
collection.schema.removeField("82xa2ihs")
// remove
collection.schema.removeField("8hjq7s97")
// remove
collection.schema.removeField("rw5nkivi")
// remove
collection.schema.removeField("vtqekl4b")
// remove
collection.schema.removeField("7ewlybyg")
// remove
collection.schema.removeField("dr9gn7nc")
// remove
collection.schema.removeField("uaq20ew3")
// remove
collection.schema.removeField("4vlfklku")
// remove
collection.schema.removeField("1dxhhnnv")
// remove
collection.schema.removeField("gdnae6zl")
// remove
collection.schema.removeField("1vqziild")
// remove
collection.schema.removeField("tpcbbfjp")
// remove
collection.schema.removeField("eviqvobv")
// remove
collection.schema.removeField("a2ip71w4")
// remove
collection.schema.removeField("dhiuhaid")
// remove
collection.schema.removeField("jslxkgsc")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "jnfw9k3i",
"name": "total_users",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "o4i8nwpy",
"name": "total_free_subscribers",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "g1axjvpo",
"name": "total_pro_subscribers",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "hdvpvmyz",
"name": "total_pro_month_subscribers",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "fbllwtxz",
"name": "total_pro_year_subscribers",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "4q844qsv",
"name": "total_founder_subscribers",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "qqrjtdna",
"name": "total_flounder_subscribers",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "nr08d14y",
"name": "new_users_last_hour",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "kwr3wpeh",
"name": "new_users_last_24_hours",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "ml2w4v5h",
"name": "new_users_last_7_days",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "dbao78l3",
"name": "new_users_last_30_days",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "qis0qckm",
"name": "total_instances",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "pygkmabh",
"name": "total_instances_last_hour",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "w8y2m3ra",
"name": "total_instances_last_24_hours",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "ppfamxbk",
"name": "total_instances_last_7_days",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "vvdlbqyy",
"name": "total_instances_last_30_days",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "h0ehflrf",
"name": "new_instances_last_hour",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "yp2yookd",
"name": "new_instances_last_24_hours",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "s8ingt5t",
"name": "new_instances_last_7_days",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "ojtxbkzj",
"name": "new_instances_last_30_days",
"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("buq519uv711078p")
collection.options = {
"query": "SELECT\n (ROW_NUMBER() OVER()) as id,\n COUNT(DISTINCT users.id) AS total_users,\n COUNT(DISTINCT CASE WHEN users.subscription ='legacy' THEN users.id END) AS total_legacy_subscribers,\n COUNT(DISTINCT CASE WHEN users.subscription ='free' THEN users.id END) AS total_free_subscribers,\n COUNT(DISTINCT CASE WHEN users.subscription= 'premium' THEN users.id END) AS total_pro_subscribers,\n COUNT(DISTINCT CASE WHEN users.subscription= 'premium' and users.subscription_interval='month' THEN users.id END) AS total_pro_month_subscribers,\n COUNT(DISTINCT CASE WHEN users.subscription= 'premium' and users.subscription_interval='year' THEN users.id END) AS total_pro_year_subscribers,\n COUNT(DISTINCT CASE WHEN users.subscription= 'founder' THEN users.id END) AS total_founder_subscribers,\n COUNT(DISTINCT CASE WHEN users.subscription= 'flounder' THEN users.id END) AS total_flounder_subscribers,\n \n COUNT(DISTINCT CASE WHEN users.created > DATETIME('now', '-1 hour') THEN users.id END) AS new_users_last_hour,\n COUNT(DISTINCT CASE WHEN users.created > DATETIME('now', '-24 hours') THEN users.id END) AS new_users_last_24_hours,\n COUNT(DISTINCT CASE WHEN users.created > DATETIME('now', '-7 days') THEN users.id END) AS new_users_last_7_days,\n COUNT(DISTINCT CASE WHEN users.created > DATETIME('now', '-30 days') THEN users.id END) AS new_users_last_30_days,\n \n COUNT(DISTINCT instances.id ) AS total_instances,\n COUNT(DISTINCT CASE WHEN instances.updated > DATETIME('now', '-1 hour') THEN instances.id END) AS total_instances_last_hour,\n COUNT(DISTINCT CASE WHEN instances.updated > DATETIME('now', '-24 hours') THEN instances.id END) AS total_instances_last_24_hours,\n COUNT(DISTINCT CASE WHEN instances.updated > DATETIME('now', '-7 days') THEN instances.id END) AS total_instances_last_7_days,\n COUNT(DISTINCT CASE WHEN instances.updated > DATETIME('now', '-30 days') THEN instances.id END) AS total_instances_last_30_days,\n \n COUNT(DISTINCT CASE WHEN instances.created > DATETIME('now', '-1 hour') THEN instances.id END) AS new_instances_last_hour,\n COUNT(DISTINCT CASE WHEN instances.created > DATETIME('now', '-24 hours') THEN instances.id END) AS new_instances_last_24_hours,\n COUNT(DISTINCT CASE WHEN instances.created > DATETIME('now', '-7 days') THEN instances.id END) AS new_instances_last_7_days,\n COUNT(DISTINCT CASE WHEN instances.created > DATETIME('now', '-30 days') THEN instances.id END) AS new_instances_last_30_days\n \nFROM\n verified_users users\nLEFT JOIN\n instances ON users.id = instances.uid;\n"
}
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "y2weqof7",
"name": "total_users",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "sr33ovja",
"name": "total_legacy_subscribers",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "mq2acp0p",
"name": "total_free_subscribers",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "nmjyqh18",
"name": "total_pro_subscribers",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "l5wcacsc",
"name": "total_pro_month_subscribers",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "82xa2ihs",
"name": "total_pro_year_subscribers",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "8hjq7s97",
"name": "total_founder_subscribers",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "rw5nkivi",
"name": "total_flounder_subscribers",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "vtqekl4b",
"name": "new_users_last_hour",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "7ewlybyg",
"name": "new_users_last_24_hours",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "dr9gn7nc",
"name": "new_users_last_7_days",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "uaq20ew3",
"name": "new_users_last_30_days",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "4vlfklku",
"name": "total_instances",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "1dxhhnnv",
"name": "total_instances_last_hour",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "gdnae6zl",
"name": "total_instances_last_24_hours",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "1vqziild",
"name": "total_instances_last_7_days",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "tpcbbfjp",
"name": "total_instances_last_30_days",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "eviqvobv",
"name": "new_instances_last_hour",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "a2ip71w4",
"name": "new_instances_last_24_hours",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "dhiuhaid",
"name": "new_instances_last_7_days",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "jslxkgsc",
"name": "new_instances_last_30_days",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// remove
collection.schema.removeField("jnfw9k3i")
// remove
collection.schema.removeField("o4i8nwpy")
// remove
collection.schema.removeField("g1axjvpo")
// remove
collection.schema.removeField("hdvpvmyz")
// remove
collection.schema.removeField("fbllwtxz")
// remove
collection.schema.removeField("4q844qsv")
// remove
collection.schema.removeField("qqrjtdna")
// remove
collection.schema.removeField("nr08d14y")
// remove
collection.schema.removeField("kwr3wpeh")
// remove
collection.schema.removeField("ml2w4v5h")
// remove
collection.schema.removeField("dbao78l3")
// remove
collection.schema.removeField("qis0qckm")
// remove
collection.schema.removeField("pygkmabh")
// remove
collection.schema.removeField("w8y2m3ra")
// remove
collection.schema.removeField("ppfamxbk")
// remove
collection.schema.removeField("vvdlbqyy")
// remove
collection.schema.removeField("h0ehflrf")
// remove
collection.schema.removeField("yp2yookd")
// remove
collection.schema.removeField("s8ingt5t")
// remove
collection.schema.removeField("ojtxbkzj")
return dao.saveCollection(collection)
})

View File

@ -0,0 +1,129 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("ledwhu6imoityio")
collection.options = {
"query": "select id, email, created,updated from users where verified = 0"
}
// remove
collection.schema.removeField("u3xw295j")
// remove
collection.schema.removeField("zmruwma6")
// remove
collection.schema.removeField("ltqqpcrf")
// remove
collection.schema.removeField("jsdivvyf")
// remove
collection.schema.removeField("pssisw8g")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "ny9zdjtf",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("ledwhu6imoityio")
collection.options = {
"query": "select id, username, email, subscription, isLegacy, isFounder,created,updated from users where verified = 0"
}
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "u3xw295j",
"name": "username",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "zmruwma6",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "ltqqpcrf",
"name": "subscription",
"type": "select",
"required": true,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"free",
"premium",
"lifetime",
"founder",
"legacy"
]
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "jsdivvyf",
"name": "isLegacy",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "pssisw8g",
"name": "isFounder",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}))
// remove
collection.schema.removeField("ny9zdjtf")
return dao.saveCollection(collection)
})

View File

@ -0,0 +1,299 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("4kshuv7r3jdrst4")
collection.options = {
"query": "select id, username, email, subscription, subscription_interval, tokenKey, passwordHash, unsubscribe, created, updated from users where verified = 1"
}
// remove
collection.schema.removeField("d1ih2lys")
// remove
collection.schema.removeField("a2lkatzz")
// remove
collection.schema.removeField("rrnexgam")
// remove
collection.schema.removeField("nw92xw4d")
// remove
collection.schema.removeField("wdvo6qe5")
// remove
collection.schema.removeField("exomhe8e")
// remove
collection.schema.removeField("kvuurum5")
// remove
collection.schema.removeField("z14fromd")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "fec2cbfb",
"name": "username",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "tytnadtb",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "juickogz",
"name": "subscription",
"type": "select",
"required": true,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"free",
"premium",
"lifetime",
"founder",
"legacy"
]
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "e5tbaqub",
"name": "subscription_interval",
"type": "select",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"month",
"year",
"life"
]
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "lzoyncmi",
"name": "tokenKey",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 1
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "p5hwwwd1",
"name": "passwordHash",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 1
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "mswqajfw",
"name": "unsubscribe",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("4kshuv7r3jdrst4")
collection.options = {
"query": "select id, username, email, subscription, subscription_interval, isLegacy, tokenKey, passwordHash, unsubscribe, created, updated from users where verified = 1"
}
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "d1ih2lys",
"name": "username",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "a2lkatzz",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "rrnexgam",
"name": "subscription",
"type": "select",
"required": true,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"free",
"premium",
"lifetime",
"founder",
"legacy"
]
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "nw92xw4d",
"name": "subscription_interval",
"type": "select",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"month",
"year",
"life"
]
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "wdvo6qe5",
"name": "isLegacy",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "exomhe8e",
"name": "tokenKey",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 1
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "kvuurum5",
"name": "passwordHash",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 1
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "z14fromd",
"name": "unsubscribe",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}))
// remove
collection.schema.removeField("fec2cbfb")
// remove
collection.schema.removeField("tytnadtb")
// remove
collection.schema.removeField("juickogz")
// remove
collection.schema.removeField("e5tbaqub")
// remove
collection.schema.removeField("lzoyncmi")
// remove
collection.schema.removeField("p5hwwwd1")
// remove
collection.schema.removeField("mswqajfw")
return dao.saveCollection(collection)
})

View File

@ -0,0 +1,42 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("systemprofiles0")
// remove
collection.schema.removeField("c1lrvx9q")
// remove
collection.schema.removeField("wp3zam39")
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("systemprofiles0")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "c1lrvx9q",
"name": "isLegacy",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "wp3zam39",
"name": "isFounder",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}))
return dao.saveCollection(collection)
})

View File

@ -0,0 +1,48 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv")
// update
collection.schema.addField(new SchemaField({
"system": false,
"id": "rbj14krn",
"name": "uid",
"type": "relation",
"required": true,
"presentable": false,
"unique": false,
"options": {
"collectionId": "systemprofiles0",
"cascadeDelete": true,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv")
// update
collection.schema.addField(new SchemaField({
"system": false,
"id": "rbj14krn",
"name": "uid",
"type": "relation",
"required": true,
"presentable": false,
"unique": false,
"options": {
"collectionId": "systemprofiles0",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))
return dao.saveCollection(collection)
})

View File

@ -0,0 +1,48 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("18rfmj8aklx6bjq")
// update
collection.schema.addField(new SchemaField({
"system": false,
"id": "wuitrzp6",
"name": "user",
"type": "relation",
"required": true,
"presentable": false,
"unique": false,
"options": {
"collectionId": "systemprofiles0",
"cascadeDelete": true,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("18rfmj8aklx6bjq")
// update
collection.schema.addField(new SchemaField({
"system": false,
"id": "wuitrzp6",
"name": "user",
"type": "relation",
"required": true,
"presentable": false,
"unique": false,
"options": {
"collectionId": "systemprofiles0",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))
return dao.saveCollection(collection)
})

View File

@ -0,0 +1,48 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y5lqraz7c4jvisu")
// update
collection.schema.addField(new SchemaField({
"system": false,
"id": "ry5pnrld",
"name": "user",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "systemprofiles0",
"cascadeDelete": true,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y5lqraz7c4jvisu")
// update
collection.schema.addField(new SchemaField({
"system": false,
"id": "ry5pnrld",
"name": "user",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "systemprofiles0",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))
return dao.saveCollection(collection)
})

View File

@ -0,0 +1,48 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("iff2jfzb89dwiov")
// update
collection.schema.addField(new SchemaField({
"system": false,
"id": "uhurtdtl",
"name": "user",
"type": "relation",
"required": true,
"presentable": false,
"unique": false,
"options": {
"collectionId": "systemprofiles0",
"cascadeDelete": true,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("iff2jfzb89dwiov")
// update
collection.schema.addField(new SchemaField({
"system": false,
"id": "uhurtdtl",
"name": "user",
"type": "relation",
"required": true,
"presentable": false,
"unique": false,
"options": {
"collectionId": "systemprofiles0",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))
return dao.saveCollection(collection)
})

View File

@ -0,0 +1,48 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("hsuwe2h3csch1yr")
// update
collection.schema.addField(new SchemaField({
"system": false,
"id": "3frdgrxe",
"name": "user",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "systemprofiles0",
"cascadeDelete": true,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("hsuwe2h3csch1yr")
// update
collection.schema.addField(new SchemaField({
"system": false,
"id": "3frdgrxe",
"name": "user",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "systemprofiles0",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))
return dao.saveCollection(collection)
})

View File

@ -0,0 +1,117 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("hsuwe2h3csch1yr")
// remove
collection.schema.removeField("kcj9mpcm")
// remove
collection.schema.removeField("sterc0x6")
// remove
collection.schema.removeField("rtfafgv0")
// remove
collection.schema.removeField("vsobm1jq")
// remove
collection.schema.removeField("nztvxk7i")
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("hsuwe2h3csch1yr")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "kcj9mpcm",
"name": "notification",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "y5lqraz7c4jvisu",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "sterc0x6",
"name": "instance",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "etae8tuiaxl6xfv",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "rtfafgv0",
"name": "campaign",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "yfhnigik0uvyt4m",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "vsobm1jq",
"name": "campaign_message",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "w1vjr1edr5tsam3",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "nztvxk7i",
"name": "sent_message",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "18rfmj8aklx6bjq",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))
return dao.saveCollection(collection)
})

View File

@ -0,0 +1,31 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("hsuwe2h3csch1yr")
// remove
collection.schema.removeField("orqvyzje")
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("hsuwe2h3csch1yr")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "orqvyzje",
"name": "email",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}))
return dao.saveCollection(collection)
})