collections cleanup

This commit is contained in:
Ben Allfree 2024-01-12 12:31:32 +00:00
parent c32c3bcb95
commit 5e2ce5ef83
99 changed files with 1863 additions and 8567 deletions

View File

@ -1,496 +0,0 @@
migrate(
(db) => {
const snapshot = [
{
id: 'etae8tuiaxl6xfv',
created: '2022-10-20 08:51:44.195Z',
updated: '2023-06-07 22:41:11.725Z',
name: 'instances',
type: 'base',
system: false,
schema: [
{
system: false,
id: 'qdtuuld1',
name: 'subdomain',
type: 'text',
required: true,
unique: true,
options: {
min: null,
max: 50,
pattern: '^[a-z][\\-a-z]+$',
},
},
{
system: false,
id: 'rbj14krn',
name: 'uid',
type: 'relation',
required: true,
unique: false,
options: {
collectionId: 'systemprofiles0',
cascadeDelete: false,
minSelect: null,
maxSelect: 1,
displayFields: null,
},
},
{
system: false,
id: 'c2y74d7h',
name: 'status',
type: 'text',
required: true,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
{
system: false,
id: 'yxby5r6b',
name: 'platform',
type: 'text',
required: true,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
{
system: false,
id: '4ydffkv3',
name: 'version',
type: 'text',
required: true,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
{
system: false,
id: '1arlklqq',
name: 'secondsThisMonth',
type: 'number',
required: false,
unique: false,
options: {
min: null,
max: null,
},
},
{
system: false,
id: '66vjgzcg',
name: 'isBackupAllowed',
type: 'bool',
required: false,
unique: false,
options: {},
},
{
system: false,
id: 'qew2o2d6',
name: 'currentWorkerBundleId',
type: 'text',
required: false,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
{
system: false,
id: '3yu1db4p',
name: 'secrets',
type: 'json',
required: false,
unique: false,
options: {},
},
],
indexes: [
'CREATE UNIQUE INDEX "idx_unique_qdtuuld1" on "instances" ("subdomain")',
],
listRule: 'uid=@request.auth.id',
viewRule: 'uid = @request.auth.id',
createRule: null,
updateRule: null,
deleteRule: null,
options: {},
},
{
id: 'systemprofiles0',
created: '2022-10-31 21:31:52.175Z',
updated: '2023-06-07 22:41:11.723Z',
name: 'users',
type: 'auth',
system: false,
schema: [
{
system: false,
id: 'pbfieldname',
name: 'name',
type: 'text',
required: false,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
{
system: false,
id: 'pbfieldavatar',
name: 'avatar',
type: 'file',
required: false,
unique: false,
options: {
maxSelect: 1,
maxSize: 5242880,
mimeTypes: [
'image/jpg',
'image/jpeg',
'image/png',
'image/svg+xml',
'image/gif',
],
thumbs: null,
protected: false,
},
},
],
indexes: [],
listRule: 'id = @request.auth.id',
viewRule: 'id = @request.auth.id',
createRule: '',
updateRule: 'id = @request.auth.id',
deleteRule: null,
options: {
allowEmailAuth: true,
allowOAuth2Auth: true,
allowUsernameAuth: false,
exceptEmailDomains: null,
manageRule: null,
minPasswordLength: 8,
onlyEmailDomains: null,
requireEmail: true,
},
},
{
id: 'aiw8te7y7atklwn',
created: '2022-11-04 13:54:23.745Z',
updated: '2023-06-07 22:41:11.723Z',
name: 'invocations',
type: 'base',
system: false,
schema: [
{
system: false,
id: 'st9ydrbo',
name: 'instanceId',
type: 'relation',
required: true,
unique: false,
options: {
collectionId: 'etae8tuiaxl6xfv',
cascadeDelete: false,
minSelect: null,
maxSelect: 1,
displayFields: null,
},
},
{
system: false,
id: 'av4mpuyh',
name: 'startedAt',
type: 'date',
required: true,
unique: false,
options: {
min: '',
max: '',
},
},
{
system: false,
id: 'fnwatixg',
name: 'endedAt',
type: 'date',
required: false,
unique: false,
options: {
min: '',
max: '',
},
},
{
system: false,
id: 'awjozhbn',
name: 'pid',
type: 'number',
required: false,
unique: false,
options: {
min: null,
max: null,
},
},
{
system: false,
id: 'vdkfqege',
name: 'totalSeconds',
type: 'number',
required: false,
unique: false,
options: {
min: null,
max: null,
},
},
],
indexes: [],
listRule: null,
viewRule: null,
createRule: null,
updateRule: null,
deleteRule: null,
options: {},
},
{
id: 'v7s41iokt1vizxd',
created: '2022-11-06 17:23:25.947Z',
updated: '2023-06-07 22:41:11.723Z',
name: 'rpc',
type: 'base',
system: false,
schema: [
{
system: false,
id: 'yv38czcf',
name: 'userId',
type: 'relation',
required: true,
unique: false,
options: {
collectionId: 'systemprofiles0',
cascadeDelete: false,
minSelect: null,
maxSelect: 1,
displayFields: null,
},
},
{
system: false,
id: 'tgvaxwfv',
name: 'payload',
type: 'json',
required: true,
unique: false,
options: {},
},
{
system: false,
id: 'zede8pci',
name: 'status',
type: 'text',
required: false,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
{
system: false,
id: 'nd7cwqmn',
name: 'result',
type: 'json',
required: false,
unique: false,
options: {},
},
{
system: false,
id: '2hlrcx5j',
name: 'cmd',
type: 'text',
required: true,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
],
indexes: [],
listRule: 'userId = @request.auth.id',
viewRule: 'userId = @request.auth.id',
createRule:
"userId = @request.auth.id && status='' && result='' && cmd ?= @collection.rpc_cmds.name",
updateRule: null,
deleteRule: null,
options: {},
},
{
id: '72clb6v41bzsay9',
created: '2022-11-09 15:23:20.313Z',
updated: '2023-06-07 22:41:11.723Z',
name: 'backups',
type: 'base',
system: false,
schema: [
{
system: false,
id: 'someqtjw',
name: 'message',
type: 'text',
required: false,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
{
system: false,
id: 'jk4zwiaj',
name: 'instanceId',
type: 'relation',
required: true,
unique: false,
options: {
collectionId: 'etae8tuiaxl6xfv',
cascadeDelete: false,
minSelect: null,
maxSelect: 1,
displayFields: null,
},
},
{
system: false,
id: 'wsy3l5gm',
name: 'status',
type: 'text',
required: true,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
{
system: false,
id: 'gmkrc5d9',
name: 'bytes',
type: 'number',
required: false,
unique: false,
options: {
min: null,
max: null,
},
},
{
system: false,
id: '4lmammjz',
name: 'platform',
type: 'text',
required: true,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
{
system: false,
id: 'fheqxmbj',
name: 'version',
type: 'text',
required: true,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
{
system: false,
id: 'cinbmdwe',
name: 'progress',
type: 'json',
required: false,
unique: false,
options: {},
},
],
indexes: [],
listRule: '@request.auth.id = instanceId.uid',
viewRule: null,
createRule: null,
updateRule: null,
deleteRule: null,
options: {},
},
{
id: 'enp8mrv5ewtrltj',
created: '2023-01-06 10:21:51.659Z',
updated: '2023-06-07 22:41:11.725Z',
name: 'rpc_cmds',
type: 'base',
system: false,
schema: [
{
system: false,
id: 'jbostfhp',
name: 'name',
type: 'text',
required: true,
unique: true,
options: {
min: null,
max: null,
pattern: '',
},
},
],
indexes: [
'CREATE UNIQUE INDEX "idx_unique_jbostfhp" on "rpc_cmds" ("name")',
],
listRule: null,
viewRule: null,
createRule: null,
updateRule: null,
deleteRule: null,
options: {},
},
]
const collections = snapshot.map((item) => new Collection(item))
return Dao(db).importCollections(collections, true, null)
},
(db) => {
return null
},
)

View File

@ -1,76 +0,0 @@
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('etae8tuiaxl6xfv')
collection.indexes = [
'CREATE UNIQUE INDEX `idx_unique_qdtuuld1` ON `instances` (`subdomain`)',
]
// remove
collection.schema.removeField('yxby5r6b')
// update
collection.schema.addField(
new SchemaField({
system: false,
id: 'qdtuuld1',
name: 'subdomain',
type: 'text',
required: true,
unique: false,
options: {
min: null,
max: 50,
pattern: '^[a-z][\\-a-z]+$',
},
}),
)
return dao.saveCollection(collection)
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('etae8tuiaxl6xfv')
collection.indexes = [
'CREATE UNIQUE INDEX "idx_unique_qdtuuld1" on "instances" ("subdomain")',
]
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'yxby5r6b',
name: 'platform',
type: 'text',
required: true,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
}),
)
// update
collection.schema.addField(
new SchemaField({
system: false,
id: 'qdtuuld1',
name: 'subdomain',
type: 'text',
required: true,
unique: true,
options: {
min: null,
max: 50,
pattern: '^[a-z][\\-a-z]+$',
},
}),
)
return dao.saveCollection(collection)
},
)

View File

@ -1,34 +0,0 @@
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('72clb6v41bzsay9')
// remove
collection.schema.removeField('4lmammjz')
return dao.saveCollection(collection)
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('72clb6v41bzsay9')
// add
collection.schema.addField(
new SchemaField({
system: false,
id: '4lmammjz',
name: 'platform',
type: 'text',
required: true,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
}),
)
return dao.saveCollection(collection)
},
)

View File

@ -1,44 +0,0 @@
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('enp8mrv5ewtrltj')
return dao.deleteCollection(collection)
},
(db) => {
const collection = new Collection({
id: 'enp8mrv5ewtrltj',
created: '2023-01-06 10:21:51.659Z',
updated: '2023-06-07 22:41:11.725Z',
name: 'rpc_cmds',
type: 'base',
system: false,
schema: [
{
system: false,
id: 'jbostfhp',
name: 'name',
type: 'text',
required: true,
unique: true,
options: {
min: null,
max: null,
pattern: '',
},
},
],
indexes: [
'CREATE UNIQUE INDEX "idx_unique_jbostfhp" on "rpc_cmds" ("name")',
],
listRule: null,
viewRule: null,
createRule: null,
updateRule: null,
deleteRule: null,
options: {},
})
return Dao(db).saveCollection(collection)
},
)

View File

@ -1,19 +0,0 @@
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('v7s41iokt1vizxd')
collection.createRule =
"userId = @request.auth.id && status='' && result=''"
return dao.saveCollection(collection)
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('v7s41iokt1vizxd')
collection.createRule = null
return dao.saveCollection(collection)
},
)

View File

@ -1,104 +0,0 @@
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('72clb6v41bzsay9')
return dao.deleteCollection(collection)
},
(db) => {
const collection = new Collection({
id: '72clb6v41bzsay9',
created: '2022-11-09 15:23:20.313Z',
updated: '2023-06-10 09:12:01.004Z',
name: 'backups',
type: 'base',
system: false,
schema: [
{
system: false,
id: 'someqtjw',
name: 'message',
type: 'text',
required: false,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
{
system: false,
id: 'jk4zwiaj',
name: 'instanceId',
type: 'relation',
required: true,
unique: false,
options: {
collectionId: 'etae8tuiaxl6xfv',
cascadeDelete: false,
minSelect: null,
maxSelect: 1,
displayFields: null,
},
},
{
system: false,
id: 'wsy3l5gm',
name: 'status',
type: 'text',
required: true,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
{
system: false,
id: 'gmkrc5d9',
name: 'bytes',
type: 'number',
required: false,
unique: false,
options: {
min: null,
max: null,
},
},
{
system: false,
id: 'fheqxmbj',
name: 'version',
type: 'text',
required: true,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
{
system: false,
id: 'cinbmdwe',
name: 'progress',
type: 'json',
required: false,
unique: false,
options: {},
},
],
indexes: [],
listRule: '@request.auth.id = instanceId.uid',
viewRule: null,
createRule: null,
updateRule: null,
deleteRule: null,
options: {},
})
return Dao(db).saveCollection(collection)
},
)

View File

@ -1,30 +0,0 @@
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('etae8tuiaxl6xfv')
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'mexrkb5z',
name: 'maintenance',
type: 'bool',
required: false,
unique: false,
options: {},
}),
)
return dao.saveCollection(collection)
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('etae8tuiaxl6xfv')
// remove
collection.schema.removeField('mexrkb5z')
return dao.saveCollection(collection)
},
)

View File

@ -1,30 +0,0 @@
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('etae8tuiaxl6xfv')
// remove
collection.schema.removeField('66vjgzcg')
return dao.saveCollection(collection)
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('etae8tuiaxl6xfv')
// add
collection.schema.addField(
new SchemaField({
system: false,
id: '66vjgzcg',
name: 'isBackupAllowed',
type: 'bool',
required: false,
unique: false,
options: {},
}),
)
return dao.saveCollection(collection)
},
)

View File

@ -1,34 +0,0 @@
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('etae8tuiaxl6xfv')
// remove
collection.schema.removeField('qew2o2d6')
return dao.saveCollection(collection)
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('etae8tuiaxl6xfv')
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'qew2o2d6',
name: 'currentWorkerBundleId',
type: 'text',
required: false,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
}),
)
return dao.saveCollection(collection)
},
)

View File

@ -1,174 +0,0 @@
migrate(
(db) => {
const collection = new Collection({
id: 'se6fljwhhc03k4q',
name: 'statsView',
type: 'view',
system: false,
schema: [
{
id: 'bg2ll4o3',
name: 'daysUp',
type: 'json',
system: false,
required: false,
options: {},
},
{
id: 'xhpxeosn',
name: 'userCount',
type: 'json',
system: false,
required: false,
options: {},
},
{
id: 'fy3ip5rd',
name: 'runningInstanceCount',
type: 'json',
system: false,
required: false,
options: {},
},
{
id: 'lslpll2e',
name: 'instanceCount',
type: 'json',
system: false,
required: false,
options: {},
},
{
id: 'vnckdv2z',
name: 'instanceCount1Hour',
type: 'json',
system: false,
required: false,
options: {},
},
{
id: 'k2b1hlow',
name: 'instanceCount1Day',
type: 'json',
system: false,
required: false,
options: {},
},
{
id: '2gxiv0ms',
name: 'instanceCount7Day',
type: 'json',
system: false,
required: false,
options: {},
},
{
id: 'gyx3ho4m',
name: 'instanceCount30Day',
type: 'json',
system: false,
required: false,
options: {},
},
{
id: '6b6e6jrj',
name: 'invocationCount',
type: 'json',
system: false,
required: false,
options: {},
},
{
id: 'ry4re1ml',
name: 'invocationCount1Hour',
type: 'json',
system: false,
required: false,
options: {},
},
{
id: 'knsloc4s',
name: 'invocationCount1Day',
type: 'json',
system: false,
required: false,
options: {},
},
{
id: 'gqkawb2y',
name: 'invocationCount7Day',
type: 'json',
system: false,
required: false,
options: {},
},
{
id: 'csyviigl',
name: 'invocationCount30Day',
type: 'json',
system: false,
required: false,
options: {},
},
{
id: 'eannyk2g',
name: 'invocationSeconds',
type: 'json',
system: false,
required: false,
options: {},
},
{
id: 'upv0v8xv',
name: 'invocationSeconds1Hour',
type: 'json',
system: false,
required: false,
options: {},
},
{
id: 'xm0tjcte',
name: 'invocationSeconds1Day',
type: 'json',
system: false,
required: false,
options: {},
},
{
id: '4xkbzvrb',
name: 'invocationSeconds7Day',
type: 'json',
system: false,
required: false,
options: {},
},
{
id: 'z5cjouey',
name: 'invocationSeconds30Day',
type: 'json',
system: false,
required: false,
options: {},
},
],
indexes: [],
listRule: null,
viewRule: null,
createRule: null,
updateRule: null,
deleteRule: null,
options: {
query:
"select\n (ROW_NUMBER() OVER()) as id, \n (select julianday('now') - julianday( '2023-06-01' )) as daysUp,\n (select count(*) from users where verified=TRUE) as userCount,\n (select count(*) from instances where status='running') as runningInstanceCount,\n (select count(distinct instanceId) from invocations ) as instanceCount,\n (select count(distinct instanceId) from invocations where created > STRFTIME('%Y-%m-%d %H:%fZ', datetime('now','-1 hour'))) as instanceCount1Hour,\n (select count(distinct instanceId) from invocations where created > STRFTIME('%Y-%m-%d %H:%fZ', datetime('now','-1 day'))) as instanceCount1Day,\n (select count(distinct instanceId) from invocations where created > STRFTIME('%Y-%m-%d %H:%fZ', datetime('now','-7 day'))) as instanceCount7Day,\n (select count(distinct instanceId) from invocations where created > STRFTIME('%Y-%m-%d %H:%fZ', datetime('now','-30 day'))) as instanceCount30Day,\n (select count(*) from invocations) as invocationCount,\n (select count(*) from invocations where created > STRFTIME('%Y-%m-%d %H:%fZ', datetime('now','-1 hour'))) as invocationCount1Hour,\n(select count(*) from invocations where created > STRFTIME('%Y-%m-%d %H:%fZ', datetime('now','-1 day'))) as invocationCount1Day,\n(select count(*) from invocations where created > STRFTIME('%Y-%m-%d %H:%fZ', datetime('now','-7 day'))) as invocationCount7Day,\n(select count(*) from invocations where created > STRFTIME('%Y-%m-%d %H:%fZ', datetime('now','-30 day'))) as invocationCount30Day,\n (select sum(totalSeconds) from invocations) as invocationSeconds,\n (select sum(totalSeconds) from invocations where created > STRFTIME('%Y-%m-%d %H:%fZ', datetime('now','-1 hour'))) as invocationSeconds1Hour,\n (select sum(totalSeconds) from invocations where created > STRFTIME('%Y-%m-%d %H:%fZ', datetime('now','-1 day'))) as invocationSeconds1Day,\n (select sum(totalSeconds) from invocations where created > STRFTIME('%Y-%m-%d %H:%fZ', datetime('now','-7 day'))) as invocationSeconds7Day,\n (select sum(totalSeconds) from invocations where created > STRFTIME('%Y-%m-%d %H:%fZ', datetime('now','-30 day'))) as invocationSeconds30Day\n\n\n\n\n\n\n\n\n",
},
})
return Dao(db).saveCollection(collection)
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('se6fljwhhc03k4q')
return dao.deleteCollection(collection)
},
)

View File

@ -1,26 +0,0 @@
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('aiw8te7y7atklwn')
collection.indexes = [
'CREATE INDEX `idx_CTV52b6` ON `invocations` (`created`)',
'CREATE INDEX `idx_6rNZeTK` ON `invocations` (`instanceId`)',
'CREATE INDEX `idx_LTmqfbC` ON `invocations` (`totalSeconds`)',
'CREATE INDEX `idx_7YR9a3g` ON `invocations` (\n `instanceId`,\n `created`\n)',
'CREATE INDEX `idx_ntC1d1L` ON `invocations` (\n `totalSeconds`,\n `created`\n)',
'CREATE INDEX `idx_vViR75E` ON `invocations` (\n `created`,\n `totalSeconds`\n)',
'CREATE INDEX `idx_q9LanEj` ON `invocations` (\n `created`,\n `instanceId`\n)',
]
return dao.saveCollection(collection)
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('aiw8te7y7atklwn')
collection.indexes = []
return dao.saveCollection(collection)
},
)

View File

@ -1,21 +0,0 @@
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('etae8tuiaxl6xfv')
collection.indexes = [
'CREATE UNIQUE INDEX `idx_unique_qdtuuld1` ON `instances` (`subdomain`)',
'CREATE INDEX `idx_DKUSkMx` ON `instances` (`status`)',
]
return dao.saveCollection(collection)
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('etae8tuiaxl6xfv')
collection.indexes = []
return dao.saveCollection(collection)
},
)

View File

@ -1,46 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate(
(db) => {
const collection = new Collection({
id: 'y7qb3zm8vslkfxj',
created: '2023-09-15 13:56:42.907Z',
updated: '2023-09-15 13:56:42.907Z',
name: 'potentialPaidUsersView',
type: 'view',
system: false,
schema: [
{
system: false,
id: '2gw1y72t',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
},
],
indexes: [],
listRule: null,
viewRule: null,
createRule: null,
updateRule: null,
deleteRule: null,
options: {
query:
'select id,email from users where id in (select uid from instances where secondsThisMonth>6000)',
},
})
return Dao(db).saveCollection(collection)
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
return dao.deleteCollection(collection)
},
)

View File

@ -1,65 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
query:
'select id,email from users where id in (select uid from instances where secondsThisMonth<=6000)',
}
// remove
collection.schema.removeField('2gw1y72t')
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'mu8wxouc',
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('y7qb3zm8vslkfxj')
collection.options = {
query:
'select id,email from users where id in (select uid from instances where secondsThisMonth>6000)',
}
// add
collection.schema.addField(
new SchemaField({
system: false,
id: '2gw1y72t',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// remove
collection.schema.removeField('mu8wxouc')
return dao.saveCollection(collection)
},
)

View File

@ -1,65 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
query:
'select id,email from users where id in (select uid from instances where secondsThisMonth>6000)',
}
// remove
collection.schema.removeField('mu8wxouc')
// add
collection.schema.addField(
new SchemaField({
system: false,
id: '4dwqriso',
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('y7qb3zm8vslkfxj')
collection.options = {
query:
'select id,email from users where id in (select uid from instances where secondsThisMonth<=6000)',
}
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'mu8wxouc',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// remove
collection.schema.removeField('4dwqriso')
return dao.saveCollection(collection)
},
)

View File

@ -1,82 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
query:
'select u.id,email,secondsThisMonth from users u join instances i where u.id=i.uid and secondsThisMonth>6000',
}
// remove
collection.schema.removeField('4dwqriso')
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'jeo2co2y',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'pcl2olai',
name: 'secondsThisMonth',
type: 'json',
required: false,
presentable: false,
unique: false,
options: {},
}),
)
return dao.saveCollection(collection)
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
query:
'select id,email from users where id in (select uid from instances where secondsThisMonth>6000)',
}
// add
collection.schema.addField(
new SchemaField({
system: false,
id: '4dwqriso',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// remove
collection.schema.removeField('jeo2co2y')
// remove
collection.schema.removeField('pcl2olai')
return dao.saveCollection(collection)
},
)

View File

@ -1,99 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
query:
'select u.id,email,secondsThisMonth from users u join instances i where u.id=i.uid and secondsThisMonth/60>500',
}
// remove
collection.schema.removeField('jeo2co2y')
// remove
collection.schema.removeField('pcl2olai')
// add
collection.schema.addField(
new SchemaField({
system: false,
id: '4nas99bt',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'pmfykpks',
name: 'secondsThisMonth',
type: 'json',
required: false,
presentable: false,
unique: false,
options: {},
}),
)
return dao.saveCollection(collection)
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
query:
'select u.id,email,secondsThisMonth from users u join instances i where u.id=i.uid and secondsThisMonth>6000',
}
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'jeo2co2y',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'pcl2olai',
name: 'secondsThisMonth',
type: 'json',
required: false,
presentable: false,
unique: false,
options: {},
}),
)
// remove
collection.schema.removeField('4nas99bt')
// remove
collection.schema.removeField('pmfykpks')
return dao.saveCollection(collection)
},
)

View File

@ -1,99 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
query:
'select u.id,email,secondsThisMonth from users u join instances i where u.id=i.uid and secondsThisMonth/60>200',
}
// remove
collection.schema.removeField('4nas99bt')
// remove
collection.schema.removeField('pmfykpks')
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'c0fjqkvh',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'nrzmfvrb',
name: 'secondsThisMonth',
type: 'json',
required: false,
presentable: false,
unique: false,
options: {},
}),
)
return dao.saveCollection(collection)
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
query:
'select u.id,email,secondsThisMonth from users u join instances i where u.id=i.uid and secondsThisMonth/60>500',
}
// add
collection.schema.addField(
new SchemaField({
system: false,
id: '4nas99bt',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'pmfykpks',
name: 'secondsThisMonth',
type: 'json',
required: false,
presentable: false,
unique: false,
options: {},
}),
)
// remove
collection.schema.removeField('c0fjqkvh')
// remove
collection.schema.removeField('nrzmfvrb')
return dao.saveCollection(collection)
},
)

View File

@ -1,59 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('aiw8te7y7atklwn')
collection.indexes = [
'CREATE INDEX `idx_CTV52b6` ON `invocations` (`created`)',
'CREATE INDEX `idx_6rNZeTK` ON `invocations` (`instanceId`)',
'CREATE INDEX `idx_LTmqfbC` ON `invocations` (`totalSeconds`)',
'CREATE INDEX `idx_7YR9a3g` ON `invocations` (\n `instanceId`,\n `created`\n)',
'CREATE INDEX `idx_ntC1d1L` ON `invocations` (\n `totalSeconds`,\n `created`\n)',
'CREATE INDEX `idx_vViR75E` ON `invocations` (\n `created`,\n `totalSeconds`\n)',
'CREATE INDEX `idx_q9LanEj` ON `invocations` (\n `created`,\n `instanceId`\n)',
'CREATE INDEX `idx_ueUQe1N` ON `invocations` (`uid`)',
]
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'kmyokg1d',
name: 'uid',
type: 'relation',
required: false,
presentable: false,
unique: false,
options: {
collectionId: 'systemprofiles0',
cascadeDelete: false,
minSelect: null,
maxSelect: 1,
displayFields: null,
},
}),
)
return dao.saveCollection(collection)
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('aiw8te7y7atklwn')
collection.indexes = [
'CREATE INDEX `idx_CTV52b6` ON `invocations` (`created`)',
'CREATE INDEX `idx_6rNZeTK` ON `invocations` (`instanceId`)',
'CREATE INDEX `idx_LTmqfbC` ON `invocations` (`totalSeconds`)',
'CREATE INDEX `idx_7YR9a3g` ON `invocations` (\n `instanceId`,\n `created`\n)',
'CREATE INDEX `idx_ntC1d1L` ON `invocations` (\n `totalSeconds`,\n `created`\n)',
'CREATE INDEX `idx_vViR75E` ON `invocations` (\n `created`,\n `totalSeconds`\n)',
'CREATE INDEX `idx_q9LanEj` ON `invocations` (\n `created`,\n `instanceId`\n)',
]
// remove
collection.schema.removeField('kmyokg1d')
return dao.saveCollection(collection)
},
)

View File

@ -1,10 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate(
(db) => {
db.newQuery(
'UPDATE invocations SET uid = (select uid from instances where instances.id = invocations.instanceId)',
).execute()
},
(db) => {},
)

View File

@ -1,39 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('aiw8te7y7atklwn')
collection.indexes = [
'CREATE INDEX `idx_CTV52b6` ON `invocations` (`created`)',
'CREATE INDEX `idx_6rNZeTK` ON `invocations` (`instanceId`)',
'CREATE INDEX `idx_LTmqfbC` ON `invocations` (`totalSeconds`)',
'CREATE INDEX `idx_7YR9a3g` ON `invocations` (\n `instanceId`,\n `created`\n)',
'CREATE INDEX `idx_ntC1d1L` ON `invocations` (\n `totalSeconds`,\n `created`\n)',
'CREATE INDEX `idx_vViR75E` ON `invocations` (\n `created`,\n `totalSeconds`\n)',
'CREATE INDEX `idx_q9LanEj` ON `invocations` (\n `created`,\n `instanceId`\n)',
'CREATE INDEX `idx_ueUQe1N` ON `invocations` (`uid`)',
'CREATE INDEX `idx_gh6iEUG` ON `invocations` (\n `instanceId`,\n `startedAt`\n)',
'CREATE INDEX `idx_CUsNbfu` ON `invocations` (\n `uid`,\n `startedAt`\n)',
]
return dao.saveCollection(collection)
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('aiw8te7y7atklwn')
collection.indexes = [
'CREATE INDEX `idx_CTV52b6` ON `invocations` (`created`)',
'CREATE INDEX `idx_6rNZeTK` ON `invocations` (`instanceId`)',
'CREATE INDEX `idx_LTmqfbC` ON `invocations` (`totalSeconds`)',
'CREATE INDEX `idx_7YR9a3g` ON `invocations` (\n `instanceId`,\n `created`\n)',
'CREATE INDEX `idx_ntC1d1L` ON `invocations` (\n `totalSeconds`,\n `created`\n)',
'CREATE INDEX `idx_vViR75E` ON `invocations` (\n `created`,\n `totalSeconds`\n)',
'CREATE INDEX `idx_q9LanEj` ON `invocations` (\n `created`,\n `instanceId`\n)',
'CREATE INDEX `idx_ueUQe1N` ON `invocations` (`uid`)',
]
return dao.saveCollection(collection)
},
)

View File

@ -1,36 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('systemprofiles0')
// remove
collection.schema.removeField('rgwv4xhk')
return dao.saveCollection(collection)
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('systemprofiles0')
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'rgwv4xhk',
name: 'totalSecondsThisMonth',
type: 'number',
required: false,
presentable: false,
unique: false,
options: {
min: null,
max: null,
noDecimal: false,
},
}),
)
return dao.saveCollection(collection)
},
)

View File

@ -1,103 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
query:
'SELECT u.id,\n email,\n i.secondsthismonth\nFROM users u\nJOIN instances i\nwhere u.id=i.uid\nAND secondsthismonth/60>200',
}
// remove
collection.schema.removeField('c0fjqkvh')
// remove
collection.schema.removeField('nrzmfvrb')
// add
collection.schema.addField(
new SchemaField({
system: false,
id: '9xsegduz',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// add
collection.schema.addField(
new SchemaField({
system: false,
id: '4dmlmvan',
name: 'secondsthismonth',
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('y7qb3zm8vslkfxj')
collection.options = {
query:
'select u.id,email,secondsThisMonth from users u join instances i where u.id=i.uid and secondsThisMonth/60>200',
}
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'c0fjqkvh',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'nrzmfvrb',
name: 'secondsThisMonth',
type: 'json',
required: false,
presentable: false,
unique: false,
options: {},
}),
)
// remove
collection.schema.removeField('9xsegduz')
// remove
collection.schema.removeField('4dmlmvan')
return dao.saveCollection(collection)
},
)

View File

@ -1,107 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
query:
'SELECT u.id,\n u.email,\n i.secondsthismonth\nFROM users u\nJOIN instances i\nwhere u.id=i.uid\nAND i.secondsthismonth/60>200',
}
// remove
collection.schema.removeField('9xsegduz')
// remove
collection.schema.removeField('4dmlmvan')
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'omarcdxd',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'c2czszfp',
name: 'secondsthismonth',
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('y7qb3zm8vslkfxj')
collection.options = {
query:
'SELECT u.id,\n email,\n i.secondsthismonth\nFROM users u\nJOIN instances i\nwhere u.id=i.uid\nAND secondsthismonth/60>200',
}
// add
collection.schema.addField(
new SchemaField({
system: false,
id: '9xsegduz',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// add
collection.schema.addField(
new SchemaField({
system: false,
id: '4dmlmvan',
name: 'secondsthismonth',
type: 'number',
required: false,
presentable: false,
unique: false,
options: {
min: null,
max: null,
noDecimal: false,
},
}),
)
// remove
collection.schema.removeField('omarcdxd')
// remove
collection.schema.removeField('c2czszfp')
return dao.saveCollection(collection)
},
)

View File

@ -1,42 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('systemprofiles0')
collection.indexes = [
'CREATE INDEX `idx_q4Kji47` ON `users` (`secondsThisMonth`)',
]
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'qz4cjamg',
name: 'secondsThisMonth',
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')
collection.indexes = []
// remove
collection.schema.removeField('qz4cjamg')
return dao.saveCollection(collection)
},
)

View File

@ -1,107 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
query:
'SELECT u.id,\n u.email,\n u.secondsthismonth\nFROM users u\nWHERE u.secondsthismonth/60>200',
}
// remove
collection.schema.removeField('omarcdxd')
// remove
collection.schema.removeField('c2czszfp')
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'ld24cbna',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'g3qvj4tl',
name: 'secondsthismonth',
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('y7qb3zm8vslkfxj')
collection.options = {
query:
'SELECT u.id,\n u.email,\n i.secondsthismonth\nFROM users u\nJOIN instances i\nwhere u.id=i.uid\nAND i.secondsthismonth/60>200',
}
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'omarcdxd',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'c2czszfp',
name: 'secondsthismonth',
type: 'number',
required: false,
presentable: false,
unique: false,
options: {
min: null,
max: null,
noDecimal: false,
},
}),
)
// remove
collection.schema.removeField('ld24cbna')
// remove
collection.schema.removeField('g3qvj4tl')
return dao.saveCollection(collection)
},
)

View File

@ -1,45 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('aiw8te7y7atklwn')
collection.indexes = [
'CREATE INDEX `idx_CTV52b6` ON `invocations` (`created`)',
'CREATE INDEX `idx_6rNZeTK` ON `invocations` (`instanceId`)',
'CREATE INDEX `idx_LTmqfbC` ON `invocations` (`totalSeconds`)',
'CREATE INDEX `idx_7YR9a3g` ON `invocations` (\n `instanceId`,\n `created`\n)',
'CREATE INDEX `idx_ntC1d1L` ON `invocations` (\n `totalSeconds`,\n `created`\n)',
'CREATE INDEX `idx_vViR75E` ON `invocations` (\n `created`,\n `totalSeconds`\n)',
'CREATE INDEX `idx_q9LanEj` ON `invocations` (\n `created`,\n `instanceId`\n)',
'CREATE INDEX `idx_ueUQe1N` ON `invocations` (`uid`)',
'CREATE INDEX `idx_gh6iEUG` ON `invocations` (\n `instanceId`,\n `startedAt`\n)',
'CREATE INDEX `idx_CUsNbfu` ON `invocations` (\n `uid`,\n `startedAt`\n)',
'CREATE INDEX `idx_O3bEfl0` ON `invocations` (`updated`)',
'CREATE INDEX `idx_qOyDhVG` ON `invocations` (`created`)',
'CREATE INDEX `idx_UM6cwSA` ON `invocations` (`instanceId`)',
'CREATE INDEX `idx_nMr318s` ON `invocations` (`totalSeconds`)',
]
return dao.saveCollection(collection)
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('aiw8te7y7atklwn')
collection.indexes = [
'CREATE INDEX `idx_CTV52b6` ON `invocations` (`created`)',
'CREATE INDEX `idx_6rNZeTK` ON `invocations` (`instanceId`)',
'CREATE INDEX `idx_LTmqfbC` ON `invocations` (`totalSeconds`)',
'CREATE INDEX `idx_7YR9a3g` ON `invocations` (\n `instanceId`,\n `created`\n)',
'CREATE INDEX `idx_ntC1d1L` ON `invocations` (\n `totalSeconds`,\n `created`\n)',
'CREATE INDEX `idx_vViR75E` ON `invocations` (\n `created`,\n `totalSeconds`\n)',
'CREATE INDEX `idx_q9LanEj` ON `invocations` (\n `created`,\n `instanceId`\n)',
'CREATE INDEX `idx_ueUQe1N` ON `invocations` (`uid`)',
'CREATE INDEX `idx_gh6iEUG` ON `invocations` (\n `instanceId`,\n `startedAt`\n)',
'CREATE INDEX `idx_CUsNbfu` ON `invocations` (\n `uid`,\n `startedAt`\n)',
]
return dao.saveCollection(collection)
},
)

View File

@ -1,107 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
query:
'SELECT u.id,\n u.email,\n u.secondsthismonth\nFROM users u\nWHERE u.verified=1 and u.secondsthismonth/60>200',
}
// remove
collection.schema.removeField('ld24cbna')
// remove
collection.schema.removeField('g3qvj4tl')
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'mkmeisox',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'wqw6fejd',
name: 'secondsthismonth',
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('y7qb3zm8vslkfxj')
collection.options = {
query:
'SELECT u.id,\n u.email,\n u.secondsthismonth\nFROM users u\nWHERE u.secondsthismonth/60>200',
}
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'ld24cbna',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'g3qvj4tl',
name: 'secondsthismonth',
type: 'number',
required: false,
presentable: false,
unique: false,
options: {
min: null,
max: null,
noDecimal: false,
},
}),
)
// remove
collection.schema.removeField('mkmeisox')
// remove
collection.schema.removeField('wqw6fejd')
return dao.saveCollection(collection)
},
)

View File

@ -1,56 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId("y7qb3zm8vslkfxj");
return dao.deleteCollection(collection);
}, (db) => {
const collection = new Collection({
"id": "y7qb3zm8vslkfxj",
"created": "2023-09-15 13:56:42.907Z",
"updated": "2023-09-27 06:39:53.322Z",
"name": "potentialPaidUsersView",
"type": "view",
"system": false,
"schema": [
{
"system": false,
"id": "mkmeisox",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
},
{
"system": false,
"id": "wqw6fejd",
"name": "secondsthismonth",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}
],
"indexes": [],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {
"query": "SELECT u.id,\n u.email,\n u.secondsthismonth\nFROM users u\nWHERE u.verified=1 and u.secondsthismonth/60>200"
}
});
return Dao(db).saveCollection(collection);
})

View File

@ -1,209 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId("se6fljwhhc03k4q");
return dao.deleteCollection(collection);
}, (db) => {
const collection = new Collection({
"id": "se6fljwhhc03k4q",
"created": "2023-06-23 01:11:55.281Z",
"updated": "2023-08-13 14:10:47.344Z",
"name": "statsView",
"type": "view",
"system": false,
"schema": [
{
"system": false,
"id": "hwuhhncl",
"name": "daysUp",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "4ki5frha",
"name": "userCount",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "t0sc7gbx",
"name": "runningInstanceCount",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "tdzm0fm9",
"name": "instanceCount",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "qgwuokdt",
"name": "instanceCount1Hour",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "qdfrdpgw",
"name": "instanceCount1Day",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "7zyst2n4",
"name": "instanceCount7Day",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "spsatpua",
"name": "instanceCount30Day",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "hkqkppxr",
"name": "invocationCount",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "p1elamx9",
"name": "invocationCount1Hour",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "zx0hsiah",
"name": "invocationCount1Day",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "3umjdlx9",
"name": "invocationCount7Day",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "e6vw9wsl",
"name": "invocationCount30Day",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "ms888ft7",
"name": "invocationSeconds",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "bv2uips5",
"name": "invocationSeconds1Hour",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "zf8r0moy",
"name": "invocationSeconds1Day",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "ufpswspy",
"name": "invocationSeconds7Day",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "gd98rnvo",
"name": "invocationSeconds30Day",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}
],
"indexes": [],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {
"query": "select\n (ROW_NUMBER() OVER()) as id, \n (select julianday('now') - julianday( '2023-06-01' )) as daysUp,\n (select count(*) from users where verified=TRUE) as userCount,\n (select count(*) from instances where status='running') as runningInstanceCount,\n (select count(distinct instanceId) from invocations ) as instanceCount,\n (select count(distinct instanceId) from invocations where created > STRFTIME('%Y-%m-%d %H:%fZ', datetime('now','-1 hour'))) as instanceCount1Hour,\n (select count(distinct instanceId) from invocations where created > STRFTIME('%Y-%m-%d %H:%fZ', datetime('now','-1 day'))) as instanceCount1Day,\n (select count(distinct instanceId) from invocations where created > STRFTIME('%Y-%m-%d %H:%fZ', datetime('now','-7 day'))) as instanceCount7Day,\n (select count(distinct instanceId) from invocations where created > STRFTIME('%Y-%m-%d %H:%fZ', datetime('now','-30 day'))) as instanceCount30Day,\n (select count(*) from invocations) as invocationCount,\n (select count(*) from invocations where created > STRFTIME('%Y-%m-%d %H:%fZ', datetime('now','-1 hour'))) as invocationCount1Hour,\n(select count(*) from invocations where created > STRFTIME('%Y-%m-%d %H:%fZ', datetime('now','-1 day'))) as invocationCount1Day,\n(select count(*) from invocations where created > STRFTIME('%Y-%m-%d %H:%fZ', datetime('now','-7 day'))) as invocationCount7Day,\n(select count(*) from invocations where created > STRFTIME('%Y-%m-%d %H:%fZ', datetime('now','-30 day'))) as invocationCount30Day,\n (select sum(totalSeconds) from invocations) as invocationSeconds,\n (select sum(totalSeconds) from invocations where created > STRFTIME('%Y-%m-%d %H:%fZ', datetime('now','-1 hour'))) as invocationSeconds1Hour,\n (select sum(totalSeconds) from invocations where created > STRFTIME('%Y-%m-%d %H:%fZ', datetime('now','-1 day'))) as invocationSeconds1Day,\n (select sum(totalSeconds) from invocations where created > STRFTIME('%Y-%m-%d %H:%fZ', datetime('now','-7 day'))) as invocationSeconds7Day,\n (select sum(totalSeconds) from invocations where created > STRFTIME('%Y-%m-%d %H:%fZ', datetime('now','-30 day'))) as invocationSeconds30Day\n\n\n\n\n\n\n\n\n"
}
});
return Dao(db).saveCollection(collection);
})

View File

@ -1,128 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId("aiw8te7y7atklwn");
return dao.deleteCollection(collection);
}, (db) => {
const collection = new Collection({
"id": "aiw8te7y7atklwn",
"created": "2022-11-06 06:05:46.988Z",
"updated": "2023-10-02 10:58:44.665Z",
"name": "invocations",
"type": "base",
"system": false,
"schema": [
{
"system": false,
"id": "kmyokg1d",
"name": "uid",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "systemprofiles0",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
},
{
"system": false,
"id": "st9ydrbo",
"name": "instanceId",
"type": "relation",
"required": true,
"presentable": false,
"unique": false,
"options": {
"collectionId": "etae8tuiaxl6xfv",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
},
{
"system": false,
"id": "av4mpuyh",
"name": "startedAt",
"type": "date",
"required": true,
"presentable": false,
"unique": false,
"options": {
"min": "",
"max": ""
}
},
{
"system": false,
"id": "fnwatixg",
"name": "endedAt",
"type": "date",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": "",
"max": ""
}
},
{
"system": false,
"id": "awjozhbn",
"name": "pid",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
},
{
"system": false,
"id": "vdkfqege",
"name": "totalSeconds",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}
],
"indexes": [
"CREATE INDEX `idx_CTV52b6` ON `invocations` (`created`)",
"CREATE INDEX `idx_6rNZeTK` ON `invocations` (`instanceId`)",
"CREATE INDEX `idx_LTmqfbC` ON `invocations` (`totalSeconds`)",
"CREATE INDEX `idx_7YR9a3g` ON `invocations` (\n `instanceId`,\n `created`\n)",
"CREATE INDEX `idx_ntC1d1L` ON `invocations` (\n `totalSeconds`,\n `created`\n)",
"CREATE INDEX `idx_vViR75E` ON `invocations` (\n `created`,\n `totalSeconds`\n)",
"CREATE INDEX `idx_q9LanEj` ON `invocations` (\n `created`,\n `instanceId`\n)",
"CREATE INDEX `idx_ueUQe1N` ON `invocations` (`uid`)",
"CREATE INDEX `idx_gh6iEUG` ON `invocations` (\n `instanceId`,\n `startedAt`\n)",
"CREATE INDEX `idx_CUsNbfu` ON `invocations` (\n `uid`,\n `startedAt`\n)",
"CREATE INDEX `idx_O3bEfl0` ON `invocations` (`updated`)",
"CREATE INDEX `idx_qOyDhVG` ON `invocations` (`created`)",
"CREATE INDEX `idx_UM6cwSA` ON `invocations` (`instanceId`)",
"CREATE INDEX `idx_nMr318s` ON `invocations` (`totalSeconds`)"
],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {}
});
return Dao(db).saveCollection(collection);
})

View File

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

View File

@ -1,37 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("systemprofiles0")
collection.indexes = []
// remove
collection.schema.removeField("qz4cjamg")
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("systemprofiles0")
collection.indexes = [
"CREATE INDEX `idx_q4Kji47` ON `users` (`secondsThisMonth`)"
]
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "qz4cjamg",
"name": "secondsThisMonth",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
return dao.saveCollection(collection)
})

View File

@ -1,26 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv")
collection.indexes = [
"CREATE UNIQUE INDEX `idx_unique_qdtuuld1` ON `instances` (`subdomain`)",
"CREATE INDEX `idx_DKUSkMx` ON `instances` (`status`)",
"CREATE INDEX `idx_fhfKrpl` ON `instances` (`uid`)",
"CREATE INDEX `idx_TfdgNnO` ON `instances` (`maintenance`)",
"CREATE INDEX `idx_FrmHehp` ON `instances` (`created`)",
"CREATE INDEX `idx_tNMeylJ` ON `instances` (`updated`)"
]
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv")
collection.indexes = [
"CREATE UNIQUE INDEX `idx_unique_qdtuuld1` ON `instances` (`subdomain`)",
"CREATE INDEX `idx_DKUSkMx` ON `instances` (`status`)"
]
return dao.saveCollection(collection)
})

View File

@ -1,91 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId("v7s41iokt1vizxd");
return dao.deleteCollection(collection);
}, (db) => {
const collection = new Collection({
"id": "v7s41iokt1vizxd",
"created": "2022-11-15 03:28:33.097Z",
"updated": "2023-06-19 02:56:16.446Z",
"name": "rpc",
"type": "base",
"system": false,
"schema": [
{
"system": false,
"id": "yv38czcf",
"name": "userId",
"type": "relation",
"required": true,
"presentable": false,
"unique": false,
"options": {
"collectionId": "systemprofiles0",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
},
{
"system": false,
"id": "tgvaxwfv",
"name": "payload",
"type": "json",
"required": true,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "zede8pci",
"name": "status",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "nd7cwqmn",
"name": "result",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "2hlrcx5j",
"name": "cmd",
"type": "text",
"required": true,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}
],
"indexes": [],
"listRule": "userId = @request.auth.id",
"viewRule": "userId = @request.auth.id",
"createRule": "userId = @request.auth.id && status='' && result=''",
"updateRule": null,
"deleteRule": null,
"options": {}
});
return Dao(db).saveCollection(collection);
})

View File

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

View File

@ -1,44 +0,0 @@
/// <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": "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)
})

View File

@ -1,37 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("systemprofiles0")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "7jf2i4be",
"name": "subscription",
"type": "select",
"required": true,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"free",
"premium",
"lifetime",
"legacy"
]
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("systemprofiles0")
// remove
collection.schema.removeField("7jf2i4be")
return dao.saveCollection(collection)
})

View File

@ -1,8 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
db.newQuery("UPDATE users SET subscription = 'legacy'")
.execute()
}, (db) => {
})

View File

@ -1,27 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((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": {}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("systemprofiles0")
// remove
collection.schema.removeField("c1lrvx9q")
return dao.saveCollection(collection)
})

View File

@ -1,8 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
db.newQuery("UPDATE users SET isLegacy = true")
.execute()
}, (db) => {
})

View File

@ -1,27 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("systemprofiles0")
// 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)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("systemprofiles0")
// remove
collection.schema.removeField("wp3zam39")
return dao.saveCollection(collection)
})

View File

@ -1,183 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const collection = new Collection({
"id": "buq519uv711078p",
"created": "2023-12-13 12:27:18.834Z",
"updated": "2023-12-13 12:27:18.834Z",
"name": "stats",
"type": "view",
"system": false,
"schema": [
{
"system": false,
"id": "3yphuaaj",
"name": "total_users",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
},
{
"system": false,
"id": "38n3tegi",
"name": "total_verified_users",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
},
{
"system": false,
"id": "8f9f6zdu",
"name": "total_legacy_subscribers",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
},
{
"system": false,
"id": "zjwddaeq",
"name": "total_free_subscribers",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
},
{
"system": false,
"id": "uuokjxef",
"name": "total_pro_subscribers",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
},
{
"system": false,
"id": "mnldzliz",
"name": "total_lifetime_subscribers",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
},
{
"system": false,
"id": "ckwdam5b",
"name": "verified_instances",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
},
{
"system": false,
"id": "ymm1aa7u",
"name": "verified_instances_last_hour",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
},
{
"system": false,
"id": "mdn95zm0",
"name": "verified_instances_last_24_hours",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
},
{
"system": false,
"id": "sg7l3nmm",
"name": "verified_instances_last_7_days",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
},
{
"system": false,
"id": "oi12fxeb",
"name": "verified_instances_last_30_days",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}
],
"indexes": [],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {
"query": "SELECT\n (ROW_NUMBER() OVER()) as id,\n COUNT(DISTINCT users.id) AS total_users,\n COUNT(DISTINCT CASE WHEN users.verified = 1 THEN users.id END) AS total_verified_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= 'lifetime' THEN users.id END) AS total_lifetime_subscribers,\n COUNT(DISTINCT CASE WHEN users.verified = 1 THEN instances.id END) AS verified_instances,\n COUNT(DISTINCT CASE WHEN users.verified = 1 AND instances.updated > DATETIME('now', '-1 hour') THEN instances.id END) AS verified_instances_last_hour,\n COUNT(DISTINCT CASE WHEN users.verified = 1 AND instances.updated > DATETIME('now', '-24 hours') THEN instances.id END) AS verified_instances_last_24_hours,\n COUNT(DISTINCT CASE WHEN users.verified = 1 AND instances.updated > DATETIME('now', '-7 days') THEN instances.id END) AS verified_instances_last_7_days,\n COUNT(DISTINCT CASE WHEN users.verified = 1 AND instances.updated > DATETIME('now', '-30 days') THEN instances.id END) AS verified_instances_last_30_days\nFROM\n users\nLEFT JOIN\n instances ON users.id = instances.uid;\n"
}
});
return Dao(db).saveCollection(collection);
}, (db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId("buq519uv711078p");
return dao.deleteCollection(collection);
})

View File

@ -1,41 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const collection = new Collection({
"id": "aif4h1j462iqopo",
"created": "2023-12-14 09:01:33.345Z",
"updated": "2023-12-14 09:01:33.345Z",
"name": "settings",
"type": "base",
"system": false,
"schema": [
{
"system": false,
"id": "vuyscz1q",
"name": "founders_edition_count",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}
],
"indexes": [],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {}
});
return Dao(db).saveCollection(collection);
}, (db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId("aif4h1j462iqopo");
return dao.deleteCollection(collection);
})

View File

@ -1,73 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("aif4h1j462iqopo")
collection.indexes = [
"CREATE INDEX `idx_qMbeGsg` ON `settings` (`name`)"
]
// remove
collection.schema.removeField("vuyscz1q")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "a0gyirdi",
"name": "name",
"type": "text",
"required": true,
"presentable": true,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "xso1u0og",
"name": "value",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 2000000
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("aif4h1j462iqopo")
collection.indexes = []
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "vuyscz1q",
"name": "founders_edition_count",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// remove
collection.schema.removeField("a0gyirdi")
// remove
collection.schema.removeField("xso1u0og")
return dao.saveCollection(collection)
})

View File

@ -1,18 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("aif4h1j462iqopo")
collection.listRule = ""
collection.viewRule = ""
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("aif4h1j462iqopo")
collection.listRule = null
collection.viewRule = null
return dao.saveCollection(collection)
})

View File

@ -1,42 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const collection = new Collection({
"id": "4kshuv7r3jdrst4",
"created": "2023-12-14 15:47:15.041Z",
"updated": "2023-12-14 15:47:15.041Z",
"name": "verified_users",
"type": "view",
"system": false,
"schema": [
{
"system": false,
"id": "ztrckqeh",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}
],
"indexes": [],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {
"query": "select id, email,created,updated from users where verified = 1"
}
});
return Dao(db).saveCollection(collection);
}, (db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId("4kshuv7r3jdrst4");
return dao.deleteCollection(collection);
})

View File

@ -1,128 +0,0 @@
/// <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, isLegacy, isFounder,created,updated from users where verified = 1"
}
// remove
collection.schema.removeField("ztrckqeh")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "tnm1y7ix",
"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": "auwz1pdd",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "ub6x7vng",
"name": "subscription",
"type": "select",
"required": true,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"free",
"premium",
"lifetime",
"legacy"
]
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "knixwubq",
"name": "isLegacy",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "lwaiqdo7",
"name": "isFounder",
"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, email,created,updated from users where verified = 1"
}
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "ztrckqeh",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
// remove
collection.schema.removeField("tnm1y7ix")
// remove
collection.schema.removeField("auwz1pdd")
// remove
collection.schema.removeField("ub6x7vng")
// remove
collection.schema.removeField("knixwubq")
// remove
collection.schema.removeField("lwaiqdo7")
return dao.saveCollection(collection)
})

View File

@ -1,419 +0,0 @@
/// <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 ='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= 'lifetime' THEN users.id END) AS total_lifetime_subscribers,\n COUNT(DISTINCT instances.id ) AS instances,\n COUNT(DISTINCT CASE WHEN instances.updated > DATETIME('now', '-1 hour') THEN instances.id END) AS instances_last_hour,\n COUNT(DISTINCT CASE WHEN instances.updated > DATETIME('now', '-24 hours') THEN instances.id END) AS instances_last_24_hours,\n COUNT(DISTINCT CASE WHEN instances.updated > DATETIME('now', '-7 days') THEN instances.id END) AS instances_last_7_days,\n COUNT(DISTINCT CASE WHEN instances.updated > DATETIME('now', '-30 days') THEN instances.id END) AS instances_last_30_days\nFROM\n verified_users users\nLEFT JOIN\n instances ON users.id = instances.uid;\n"
}
// remove
collection.schema.removeField("gbusypds")
// remove
collection.schema.removeField("enlkpkjb")
// remove
collection.schema.removeField("uouawo7o")
// remove
collection.schema.removeField("rb1wzsv7")
// remove
collection.schema.removeField("whdajjy5")
// remove
collection.schema.removeField("xwxkyd41")
// remove
collection.schema.removeField("uyczm2an")
// remove
collection.schema.removeField("jsgangu8")
// remove
collection.schema.removeField("0dalcs71")
// remove
collection.schema.removeField("jzzbzyxy")
// remove
collection.schema.removeField("zj0otefi")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "gptgmwlu",
"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": "u6uelwdv",
"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": "aukds5ub",
"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": "8macz0ll",
"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": "61tap13r",
"name": "total_lifetime_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": "q5r9xzdu",
"name": "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": "dtknpqjw",
"name": "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": "afbuvawa",
"name": "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": "clggyuqh",
"name": "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": "q5tv92td",
"name": "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.verified = 1 THEN users.id END) AS total_verified_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= 'lifetime' THEN users.id END) AS total_lifetime_subscribers,\n COUNT(DISTINCT CASE WHEN users.verified = 1 THEN instances.id END) AS verified_instances,\n COUNT(DISTINCT CASE WHEN users.verified = 1 AND instances.updated > DATETIME('now', '-1 hour') THEN instances.id END) AS verified_instances_last_hour,\n COUNT(DISTINCT CASE WHEN users.verified = 1 AND instances.updated > DATETIME('now', '-24 hours') THEN instances.id END) AS verified_instances_last_24_hours,\n COUNT(DISTINCT CASE WHEN users.verified = 1 AND instances.updated > DATETIME('now', '-7 days') THEN instances.id END) AS verified_instances_last_7_days,\n COUNT(DISTINCT CASE WHEN users.verified = 1 AND instances.updated > DATETIME('now', '-30 days') THEN instances.id END) AS verified_instances_last_30_days\nFROM\n users\nLEFT JOIN\n instances ON users.id = instances.uid;\n"
}
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "gbusypds",
"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": "enlkpkjb",
"name": "total_verified_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": "uouawo7o",
"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": "rb1wzsv7",
"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": "whdajjy5",
"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": "xwxkyd41",
"name": "total_lifetime_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": "uyczm2an",
"name": "verified_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": "jsgangu8",
"name": "verified_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": "0dalcs71",
"name": "verified_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": "jzzbzyxy",
"name": "verified_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": "zj0otefi",
"name": "verified_instances_last_30_days",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// remove
collection.schema.removeField("gptgmwlu")
// remove
collection.schema.removeField("u6uelwdv")
// remove
collection.schema.removeField("aukds5ub")
// remove
collection.schema.removeField("8macz0ll")
// remove
collection.schema.removeField("61tap13r")
// remove
collection.schema.removeField("q5r9xzdu")
// remove
collection.schema.removeField("dtknpqjw")
// remove
collection.schema.removeField("afbuvawa")
// remove
collection.schema.removeField("clggyuqh")
// remove
collection.schema.removeField("q5tv92td")
return dao.saveCollection(collection)
})

View File

@ -1,476 +0,0 @@
/// <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 ='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= 'lifetime' THEN users.id END) AS total_lifetime_subscribers,\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\nFROM\n verified_users users\nLEFT JOIN\n instances ON users.id = instances.uid;\n"
}
// remove
collection.schema.removeField("gptgmwlu")
// remove
collection.schema.removeField("u6uelwdv")
// remove
collection.schema.removeField("aukds5ub")
// remove
collection.schema.removeField("8macz0ll")
// remove
collection.schema.removeField("61tap13r")
// remove
collection.schema.removeField("q5r9xzdu")
// remove
collection.schema.removeField("dtknpqjw")
// remove
collection.schema.removeField("afbuvawa")
// remove
collection.schema.removeField("clggyuqh")
// remove
collection.schema.removeField("q5tv92td")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "qxokezck",
"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": "nhnu96xj",
"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": "1ily0n9p",
"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": "8yxlysux",
"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": "twfa4xdq",
"name": "total_lifetime_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": "etzohhgx",
"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": "xw6z5two",
"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": "3kvrm6bs",
"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": "dv5s3tlf",
"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": "xi0zsmee",
"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": "tjjqxoin",
"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": "xt3tiocm",
"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": "8eknw7mm",
"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": "nrhmdzra",
"name": "total_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= 'lifetime' THEN users.id END) AS total_lifetime_subscribers,\n COUNT(DISTINCT instances.id ) AS instances,\n COUNT(DISTINCT CASE WHEN instances.updated > DATETIME('now', '-1 hour') THEN instances.id END) AS instances_last_hour,\n COUNT(DISTINCT CASE WHEN instances.updated > DATETIME('now', '-24 hours') THEN instances.id END) AS instances_last_24_hours,\n COUNT(DISTINCT CASE WHEN instances.updated > DATETIME('now', '-7 days') THEN instances.id END) AS instances_last_7_days,\n COUNT(DISTINCT CASE WHEN instances.updated > DATETIME('now', '-30 days') THEN instances.id END) AS instances_last_30_days\nFROM\n verified_users users\nLEFT JOIN\n instances ON users.id = instances.uid;\n"
}
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "gptgmwlu",
"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": "u6uelwdv",
"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": "aukds5ub",
"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": "8macz0ll",
"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": "61tap13r",
"name": "total_lifetime_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": "q5r9xzdu",
"name": "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": "dtknpqjw",
"name": "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": "afbuvawa",
"name": "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": "clggyuqh",
"name": "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": "q5tv92td",
"name": "instances_last_30_days",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// remove
collection.schema.removeField("qxokezck")
// remove
collection.schema.removeField("nhnu96xj")
// remove
collection.schema.removeField("1ily0n9p")
// remove
collection.schema.removeField("8yxlysux")
// remove
collection.schema.removeField("twfa4xdq")
// remove
collection.schema.removeField("etzohhgx")
// remove
collection.schema.removeField("xw6z5two")
// remove
collection.schema.removeField("3kvrm6bs")
// remove
collection.schema.removeField("dv5s3tlf")
// remove
collection.schema.removeField("xi0zsmee")
// remove
collection.schema.removeField("tjjqxoin")
// remove
collection.schema.removeField("xt3tiocm")
// remove
collection.schema.removeField("8eknw7mm")
// remove
collection.schema.removeField("nrhmdzra")
return dao.saveCollection(collection)
})

View File

@ -1,628 +0,0 @@
/// <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 ='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= 'lifetime' THEN users.id END) AS total_lifetime_subscribers,\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 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("qxokezck")
// remove
collection.schema.removeField("nhnu96xj")
// remove
collection.schema.removeField("1ily0n9p")
// remove
collection.schema.removeField("8yxlysux")
// remove
collection.schema.removeField("twfa4xdq")
// remove
collection.schema.removeField("etzohhgx")
// remove
collection.schema.removeField("xw6z5two")
// remove
collection.schema.removeField("3kvrm6bs")
// remove
collection.schema.removeField("dv5s3tlf")
// remove
collection.schema.removeField("xi0zsmee")
// remove
collection.schema.removeField("tjjqxoin")
// remove
collection.schema.removeField("xt3tiocm")
// remove
collection.schema.removeField("8eknw7mm")
// remove
collection.schema.removeField("nrhmdzra")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "gskg4kqa",
"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": "9b4pgxlv",
"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": "kgf9xbui",
"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": "2l3ym1mw",
"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": "bxhkaly6",
"name": "total_lifetime_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": "bmhsumvr",
"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": "jjlza3cn",
"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": "m51jsrba",
"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": "5jk6cpd0",
"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": "8fgyvqai",
"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": "ewoabx5r",
"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": "yjpzeew4",
"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": "l6d6mc8b",
"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": "i0pa9otz",
"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": "zgjkjocr",
"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": "vofl09ck",
"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": "aww4v82e",
"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": "pnko7ffx",
"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= 'lifetime' THEN users.id END) AS total_lifetime_subscribers,\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\nFROM\n verified_users users\nLEFT JOIN\n instances ON users.id = instances.uid;\n"
}
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "qxokezck",
"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": "nhnu96xj",
"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": "1ily0n9p",
"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": "8yxlysux",
"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": "twfa4xdq",
"name": "total_lifetime_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": "etzohhgx",
"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": "xw6z5two",
"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": "3kvrm6bs",
"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": "dv5s3tlf",
"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": "xi0zsmee",
"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": "tjjqxoin",
"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": "xt3tiocm",
"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": "8eknw7mm",
"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": "nrhmdzra",
"name": "total_instances_last_30_days",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// remove
collection.schema.removeField("gskg4kqa")
// remove
collection.schema.removeField("9b4pgxlv")
// remove
collection.schema.removeField("kgf9xbui")
// remove
collection.schema.removeField("2l3ym1mw")
// remove
collection.schema.removeField("bxhkaly6")
// remove
collection.schema.removeField("bmhsumvr")
// remove
collection.schema.removeField("jjlza3cn")
// remove
collection.schema.removeField("m51jsrba")
// remove
collection.schema.removeField("5jk6cpd0")
// remove
collection.schema.removeField("8fgyvqai")
// remove
collection.schema.removeField("ewoabx5r")
// remove
collection.schema.removeField("yjpzeew4")
// remove
collection.schema.removeField("l6d6mc8b")
// remove
collection.schema.removeField("i0pa9otz")
// remove
collection.schema.removeField("zgjkjocr")
// remove
collection.schema.removeField("vofl09ck")
// remove
collection.schema.removeField("aww4v82e")
// remove
collection.schema.removeField("pnko7ffx")
return dao.saveCollection(collection)
})

View File

@ -1,704 +0,0 @@
/// <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 \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= 'lifetime' THEN users.id END) AS total_lifetime_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("gskg4kqa")
// remove
collection.schema.removeField("9b4pgxlv")
// remove
collection.schema.removeField("kgf9xbui")
// remove
collection.schema.removeField("2l3ym1mw")
// remove
collection.schema.removeField("bxhkaly6")
// remove
collection.schema.removeField("bmhsumvr")
// remove
collection.schema.removeField("jjlza3cn")
// remove
collection.schema.removeField("m51jsrba")
// remove
collection.schema.removeField("5jk6cpd0")
// remove
collection.schema.removeField("8fgyvqai")
// remove
collection.schema.removeField("ewoabx5r")
// remove
collection.schema.removeField("yjpzeew4")
// remove
collection.schema.removeField("l6d6mc8b")
// remove
collection.schema.removeField("i0pa9otz")
// remove
collection.schema.removeField("zgjkjocr")
// remove
collection.schema.removeField("vofl09ck")
// remove
collection.schema.removeField("aww4v82e")
// remove
collection.schema.removeField("pnko7ffx")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "ocbcyask",
"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": "q5okyyvj",
"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": "a8mv3hbg",
"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": "bkn9fxd9",
"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": "qkyv0nvm",
"name": "total_lifetime_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": "g6hgzcbi",
"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": "6e2gep5p",
"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": "qdd2lgrg",
"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": "mdsqys16",
"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": "lz1oyvrc",
"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": "ntg2cv49",
"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": "o5o8e0a3",
"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": "bi4hgf4i",
"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": "e65bogl0",
"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": "uxq8augl",
"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": "w4k4qocm",
"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": "vpbfbm1f",
"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": "xactzvom",
"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= 'lifetime' THEN users.id END) AS total_lifetime_subscribers,\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 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": "gskg4kqa",
"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": "9b4pgxlv",
"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": "kgf9xbui",
"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": "2l3ym1mw",
"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": "bxhkaly6",
"name": "total_lifetime_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": "bmhsumvr",
"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": "jjlza3cn",
"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": "m51jsrba",
"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": "5jk6cpd0",
"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": "8fgyvqai",
"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": "ewoabx5r",
"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": "yjpzeew4",
"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": "l6d6mc8b",
"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": "i0pa9otz",
"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": "zgjkjocr",
"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": "vofl09ck",
"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": "aww4v82e",
"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": "pnko7ffx",
"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("ocbcyask")
// remove
collection.schema.removeField("q5okyyvj")
// remove
collection.schema.removeField("a8mv3hbg")
// remove
collection.schema.removeField("bkn9fxd9")
// remove
collection.schema.removeField("qkyv0nvm")
// remove
collection.schema.removeField("g6hgzcbi")
// remove
collection.schema.removeField("6e2gep5p")
// remove
collection.schema.removeField("qdd2lgrg")
// remove
collection.schema.removeField("mdsqys16")
// remove
collection.schema.removeField("lz1oyvrc")
// remove
collection.schema.removeField("ntg2cv49")
// remove
collection.schema.removeField("o5o8e0a3")
// remove
collection.schema.removeField("bi4hgf4i")
// remove
collection.schema.removeField("e65bogl0")
// remove
collection.schema.removeField("uxq8augl")
// remove
collection.schema.removeField("w4k4qocm")
// remove
collection.schema.removeField("vpbfbm1f")
// remove
collection.schema.removeField("xactzvom")
return dao.saveCollection(collection)
})

View File

@ -1,55 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const collection = new Collection({
"id": "7vzz1jr2us7mwmx",
"created": "2023-12-14 16:30:33.330Z",
"updated": "2023-12-14 16:30:33.330Z",
"name": "user_growth_by_month",
"type": "view",
"system": false,
"schema": [
{
"system": false,
"id": "r2f9pxks",
"name": "created_month",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 1
}
},
{
"system": false,
"id": "hfwcgpmi",
"name": "number_of_users",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}
],
"indexes": [],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {
"query": "SELECT \n (ROW_NUMBER() OVER()) as id,\n strftime('%Y-%m', created) AS created_month, \n COUNT(*) AS number_of_users \nFROM \n users \nGROUP BY \n created_month\n\torder by created_month asc\n"
}
});
return Dao(db).saveCollection(collection);
}, (db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId("7vzz1jr2us7mwmx");
return dao.deleteCollection(collection);
})

View File

@ -1,75 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("7vzz1jr2us7mwmx")
collection.options = {
"query": "SELECT \n (ROW_NUMBER() OVER()) as id,\n strftime('%Y-%m', created) AS created, \n COUNT(*) AS total \nFROM \n users \nGROUP BY \n created\n\torder by created asc\n"
}
// remove
collection.schema.removeField("r2f9pxks")
// remove
collection.schema.removeField("hfwcgpmi")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "q1td6nqz",
"name": "total",
"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("7vzz1jr2us7mwmx")
collection.options = {
"query": "SELECT \n (ROW_NUMBER() OVER()) as id,\n strftime('%Y-%m', created) AS created_month, \n COUNT(*) AS number_of_users \nFROM \n users \nGROUP BY \n created_month\n\torder by created_month asc\n"
}
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "r2f9pxks",
"name": "created_month",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 1
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "hfwcgpmi",
"name": "number_of_users",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// remove
collection.schema.removeField("q1td6nqz")
return dao.saveCollection(collection)
})

View File

@ -1,75 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("7vzz1jr2us7mwmx")
collection.options = {
"query": "SELECT \n (ROW_NUMBER() OVER()) as id,\n strftime('%Y-%m', created) AS t, \n COUNT(*) AS c \nFROM \n users \nGROUP BY \n t\n\torder by t asc\n"
}
// remove
collection.schema.removeField("q1td6nqz")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "6w2uyzd9",
"name": "t",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 1
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "ytpf0f1l",
"name": "c",
"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("7vzz1jr2us7mwmx")
collection.options = {
"query": "SELECT \n (ROW_NUMBER() OVER()) as id,\n strftime('%Y-%m', created) AS created, \n COUNT(*) AS total \nFROM \n users \nGROUP BY \n created\n\torder by created asc\n"
}
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "q1td6nqz",
"name": "total",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// remove
collection.schema.removeField("6w2uyzd9")
// remove
collection.schema.removeField("ytpf0f1l")
return dao.saveCollection(collection)
})

View File

@ -1,92 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("7vzz1jr2us7mwmx")
collection.options = {
"query": "SELECT \n (ROW_NUMBER() OVER()) as id,\n strftime('%Y-%m', created) AS t, \n COUNT(*) AS c \nFROM \n users \nGROUP BY \n t\n\torder by t desc\n"
}
// remove
collection.schema.removeField("6w2uyzd9")
// remove
collection.schema.removeField("ytpf0f1l")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "ee4obryu",
"name": "t",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 1
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "kq8xt1mi",
"name": "c",
"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("7vzz1jr2us7mwmx")
collection.options = {
"query": "SELECT \n (ROW_NUMBER() OVER()) as id,\n strftime('%Y-%m', created) AS t, \n COUNT(*) AS c \nFROM \n users \nGROUP BY \n t\n\torder by t asc\n"
}
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "6w2uyzd9",
"name": "t",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 1
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "ytpf0f1l",
"name": "c",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// remove
collection.schema.removeField("ee4obryu")
// remove
collection.schema.removeField("kq8xt1mi")
return dao.saveCollection(collection)
})

View File

@ -1,92 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("7vzz1jr2us7mwmx")
collection.options = {
"query": "SELECT \n (ROW_NUMBER() OVER()) as id,\n strftime('%Y-%m', created) AS t, \n COUNT(*) AS c \nFROM \n verified_users as users\nGROUP BY \n t\n\torder by t desc\n"
}
// remove
collection.schema.removeField("ee4obryu")
// remove
collection.schema.removeField("kq8xt1mi")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "pk5at00z",
"name": "t",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 1
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "3ybi74j4",
"name": "c",
"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("7vzz1jr2us7mwmx")
collection.options = {
"query": "SELECT \n (ROW_NUMBER() OVER()) as id,\n strftime('%Y-%m', created) AS t, \n COUNT(*) AS c \nFROM \n users \nGROUP BY \n t\n\torder by t desc\n"
}
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "ee4obryu",
"name": "t",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 1
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "kq8xt1mi",
"name": "c",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// remove
collection.schema.removeField("pk5at00z")
// remove
collection.schema.removeField("3ybi74j4")
return dao.saveCollection(collection)
})

View File

@ -1,94 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const collection = new Collection({
"id": "ledwhu6imoityio",
"created": "2023-12-15 13:31:50.847Z",
"updated": "2023-12-15 13:31:50.847Z",
"name": "unverified_users",
"type": "view",
"system": false,
"schema": [
{
"system": false,
"id": "a7hgqlhy",
"name": "username",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "z4l0bepp",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
},
{
"system": false,
"id": "mbqp64a3",
"name": "subscription",
"type": "select",
"required": true,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"free",
"premium",
"lifetime",
"legacy"
]
}
},
{
"system": false,
"id": "1dcezcd0",
"name": "isLegacy",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "enaepvse",
"name": "isFounder",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}
],
"indexes": [],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {
"query": "select id, username, email, subscription, isLegacy, isFounder,created,updated from users where verified = 0"
}
});
return Dao(db).saveCollection(collection);
}, (db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId("ledwhu6imoityio");
return dao.deleteCollection(collection);
})

View File

@ -1,57 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const collection = new Collection({
"id": "18rfmj8aklx6bjq",
"created": "2023-12-22 17:15:47.557Z",
"updated": "2023-12-22 17:15:47.557Z",
"name": "sent_messages",
"type": "base",
"system": false,
"schema": [
{
"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
}
},
{
"system": false,
"id": "yzvlcy7m",
"name": "message",
"type": "text",
"required": true,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}
],
"indexes": [],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {}
});
return Dao(db).saveCollection(collection);
}, (db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId("18rfmj8aklx6bjq");
return dao.deleteCollection(collection);
})

View File

@ -1,70 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const collection = new Collection({
"id": "4jyrkxcora6bl8r",
"created": "2023-12-24 03:51:53.315Z",
"updated": "2023-12-24 03:51:53.315Z",
"name": "legacy_users",
"type": "view",
"system": false,
"schema": [
{
"system": false,
"id": "dykdx1ap",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
},
{
"system": false,
"id": "9s5f1ghm",
"name": "isFounder",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "shqunnx6",
"name": "subscription",
"type": "select",
"required": true,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"free",
"premium",
"lifetime",
"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);
}, (db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId("4jyrkxcora6bl8r");
return dao.deleteCollection(collection);
})

View File

@ -1,61 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const collection = new Collection({
"id": "iff2jfzb89dwiov",
"created": "2023-12-24 17:21:14.169Z",
"updated": "2023-12-24 17:21:14.169Z",
"name": "stripe_payments",
"type": "base",
"system": false,
"schema": [
{
"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
}
},
{
"system": false,
"id": "tgaer8rx",
"name": "stripe_payment_id",
"type": "text",
"required": true,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}
],
"indexes": [
"CREATE INDEX `idx_DezkBvw` ON `stripe_payments` (`user`)",
"CREATE INDEX `idx_A5j325f` ON `stripe_payments` (`stripe_payment_id`)",
"CREATE INDEX `idx_qBPC3VW` ON `stripe_payments` (`created`)"
],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {}
});
return Dao(db).saveCollection(collection);
}, (db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId("iff2jfzb89dwiov");
return dao.deleteCollection(collection);
})

View File

@ -1,25 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("iff2jfzb89dwiov")
collection.indexes = [
"CREATE INDEX `idx_DezkBvw` ON `stripe_payments` (`user`)",
"CREATE INDEX `idx_A5j325f` ON `stripe_payments` (`stripe_payment_id`)",
"CREATE INDEX `idx_qBPC3VW` ON `stripe_payments` (`created`)",
"CREATE UNIQUE INDEX `idx_NPkwSnu` ON `stripe_payments` (`stripe_payment_id`)"
]
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("iff2jfzb89dwiov")
collection.indexes = [
"CREATE INDEX `idx_DezkBvw` ON `stripe_payments` (`user`)",
"CREATE INDEX `idx_A5j325f` ON `stripe_payments` (`stripe_payment_id`)",
"CREATE INDEX `idx_qBPC3VW` ON `stripe_payments` (`created`)"
]
return dao.saveCollection(collection)
})

View File

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

View File

@ -1,50 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv")
collection.indexes = [
"CREATE UNIQUE INDEX `idx_unique_qdtuuld1` ON `instances` (`subdomain`)",
"CREATE INDEX `idx_DKUSkMx` ON `instances` (`status`)",
"CREATE INDEX `idx_fhfKrpl` ON `instances` (`uid`)",
"CREATE INDEX `idx_TfdgNnO` ON `instances` (`maintenance`)",
"CREATE INDEX `idx_FrmHehp` ON `instances` (`created`)",
"CREATE INDEX `idx_tNMeylJ` ON `instances` (`updated`)",
"CREATE INDEX `idx_rBYwAXi` ON `instances` (`cname`)"
]
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "untde8eo",
"name": "cname",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv")
collection.indexes = [
"CREATE UNIQUE INDEX `idx_unique_qdtuuld1` ON `instances` (`subdomain`)",
"CREATE INDEX `idx_DKUSkMx` ON `instances` (`status`)",
"CREATE INDEX `idx_fhfKrpl` ON `instances` (`uid`)",
"CREATE INDEX `idx_TfdgNnO` ON `instances` (`maintenance`)",
"CREATE INDEX `idx_FrmHehp` ON `instances` (`created`)",
"CREATE INDEX `idx_tNMeylJ` ON `instances` (`updated`)"
]
// remove
collection.schema.removeField("untde8eo")
return dao.saveCollection(collection)
})

View File

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

View File

@ -1,32 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv")
collection.indexes = [
"CREATE UNIQUE INDEX `idx_unique_qdtuuld1` ON `instances` (`subdomain`)",
"CREATE INDEX `idx_DKUSkMx` ON `instances` (`status`)",
"CREATE INDEX `idx_fhfKrpl` ON `instances` (`uid`)",
"CREATE INDEX `idx_TfdgNnO` ON `instances` (`maintenance`)",
"CREATE INDEX `idx_FrmHehp` ON `instances` (`created`)",
"CREATE INDEX `idx_tNMeylJ` ON `instances` (`updated`)",
"CREATE UNIQUE INDEX `idx_rBYwAXi` ON `instances` (`cname`) WHERE cname != ''"
]
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv")
collection.indexes = [
"CREATE UNIQUE INDEX `idx_unique_qdtuuld1` ON `instances` (`subdomain`)",
"CREATE INDEX `idx_DKUSkMx` ON `instances` (`status`)",
"CREATE INDEX `idx_fhfKrpl` ON `instances` (`uid`)",
"CREATE INDEX `idx_TfdgNnO` ON `instances` (`maintenance`)",
"CREATE INDEX `idx_FrmHehp` ON `instances` (`created`)",
"CREATE INDEX `idx_tNMeylJ` ON `instances` (`updated`)",
"CREATE INDEX `idx_rBYwAXi` ON `instances` (`cname`)"
]
return dao.saveCollection(collection)
})

View File

@ -1,47 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv")
collection.indexes = [
"CREATE UNIQUE INDEX `idx_unique_qdtuuld1` ON `instances` (`subdomain`)",
"CREATE INDEX `idx_DKUSkMx` ON `instances` (`status`)",
"CREATE INDEX `idx_fhfKrpl` ON `instances` (`uid`)",
"CREATE INDEX `idx_TfdgNnO` ON `instances` (`maintenance`)",
"CREATE INDEX `idx_FrmHehp` ON `instances` (`created`)",
"CREATE INDEX `idx_tNMeylJ` ON `instances` (`updated`)",
"CREATE UNIQUE INDEX `idx_rBYwAXi` ON `instances` (`cname`) WHERE cname != ''"
]
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "hsoandop",
"name": "cname_active",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv")
collection.indexes = [
"CREATE UNIQUE INDEX `idx_unique_qdtuuld1` ON `instances` (`subdomain`)",
"CREATE INDEX `idx_DKUSkMx` ON `instances` (`status`)",
"CREATE INDEX `idx_fhfKrpl` ON `instances` (`uid`)",
"CREATE INDEX `idx_TfdgNnO` ON `instances` (`maintenance`)",
"CREATE INDEX `idx_FrmHehp` ON `instances` (`created`)",
"CREATE INDEX `idx_tNMeylJ` ON `instances` (`updated`)",
"CREATE UNIQUE INDEX `idx_rBYwAXi` ON `instances` (`cname`) WHERE cname != ''"
]
// remove
collection.schema.removeField("hsoandop")
return dao.saveCollection(collection)
})

View File

@ -1,27 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("systemprofiles0")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "stcfuecz",
"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("systemprofiles0")
// remove
collection.schema.removeField("stcfuecz")
return dao.saveCollection(collection)
})

View File

@ -1,113 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const collection = new Collection({
"id": "7n6rny9w7n52mvi",
"created": "2023-12-30 15:27:51.880Z",
"updated": "2023-12-30 15:27:51.880Z",
"name": "s3",
"type": "base",
"system": false,
"schema": [
{
"system": false,
"id": "yvy0exvk",
"name": "instance",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "etae8tuiaxl6xfv",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
},
{
"system": false,
"id": "kz6u1z1p",
"name": "endpoint",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "etcgfvgc",
"name": "access_key",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "fn8ulajr",
"name": "secret",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "kktzqpxi",
"name": "bucket",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "fysmrb1v",
"name": "region",
"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": {}
});
return Dao(db).saveCollection(collection);
}, (db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId("7n6rny9w7n52mvi");
return dao.deleteCollection(collection);
})

View File

@ -1,33 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "k7nxxzdr",
"name": "s3",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "7n6rny9w7n52mvi",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv")
// remove
collection.schema.removeField("k7nxxzdr")
return dao.saveCollection(collection)
})

View File

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

View File

@ -1,60 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("iff2jfzb89dwiov")
collection.name = "payments"
collection.indexes = [
"CREATE INDEX `idx_DezkBvw` ON `payments` (`user`)",
"CREATE INDEX `idx_A5j325f` ON `payments` (`payment_id`)",
"CREATE INDEX `idx_qBPC3VW` ON `payments` (`created`)",
"CREATE UNIQUE INDEX `idx_NPkwSnu` ON `payments` (`payment_id`)"
]
// update
collection.schema.addField(new SchemaField({
"system": false,
"id": "tgaer8rx",
"name": "payment_id",
"type": "text",
"required": true,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("iff2jfzb89dwiov")
collection.name = "stripe_payments"
collection.indexes = [
"CREATE INDEX `idx_DezkBvw` ON `stripe_payments` (`user`)",
"CREATE INDEX `idx_A5j325f` ON `stripe_payments` (`stripe_payment_id`)",
"CREATE INDEX `idx_qBPC3VW` ON `stripe_payments` (`created`)",
"CREATE UNIQUE INDEX `idx_NPkwSnu` ON `stripe_payments` (`stripe_payment_id`)"
]
// update
collection.schema.addField(new SchemaField({
"system": false,
"id": "tgaer8rx",
"name": "stripe_payment_id",
"type": "text",
"required": true,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}))
return dao.saveCollection(collection)
})

View File

@ -1,55 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("systemprofiles0")
collection.options = {
"allowEmailAuth": true,
"allowOAuth2Auth": true,
"allowUsernameAuth": false,
"exceptEmailDomains": null,
"manageRule": null,
"minPasswordLength": 8,
"onlyEmailDomains": null,
"onlyVerified": false,
"requireEmail": true
}
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "bbspvxke",
"name": "notifyMaintenanceMode",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}))
const res = dao.saveCollection(collection)
db.newQuery(`update users set notifyMaintenanceMode=1`).execute()
return res
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("systemprofiles0")
collection.options = {
"allowEmailAuth": true,
"allowOAuth2Auth": true,
"allowUsernameAuth": false,
"exceptEmailDomains": null,
"manageRule": null,
"minPasswordLength": 8,
"onlyEmailDomains": null,
"requireEmail": true
}
// remove
collection.schema.removeField("bbspvxke")
return dao.saveCollection(collection)
})

View File

@ -1,32 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "rofy4mta",
"name": "notifyMaintenanceMode",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}))
const res = dao.saveCollection(collection)
db.newQuery(`update instances set notifyMaintenanceMode=1`).execute()
return res
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv")
// remove
collection.schema.removeField("rofy4mta")
return dao.saveCollection(collection)
})

View File

@ -1,276 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const snapshot = [
{
"id": "18rfmj8aklx6bjq",
"created": "2023-12-22 17:15:47.557Z",
"updated": "2023-12-29 15:07:15.882Z",
"name": "sent_messages",
"type": "base",
"system": false,
"schema": [
{
"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
}
},
{
"system": false,
"id": "yzvlcy7m",
"name": "message",
"type": "text",
"required": true,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "kigwtdjb",
"name": "campaign",
"type": "relation",
"required": true,
"presentable": false,
"unique": false,
"options": {
"collectionId": "w1vjr1edr5tsam3",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}
],
"indexes": [],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {}
},
{
"id": "w1vjr1edr5tsam3",
"created": "2023-12-29 14:50:43.496Z",
"updated": "2024-01-05 09:13:27.720Z",
"name": "campaign_messages",
"type": "base",
"system": false,
"schema": [
{
"system": false,
"id": "4h2cqwha",
"name": "body",
"type": "editor",
"required": true,
"presentable": false,
"unique": false,
"options": {
"convertUrls": false
}
},
{
"system": false,
"id": "lxy9jyyk",
"name": "subject",
"type": "text",
"required": true,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "wsfnencj",
"name": "campaign",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "yfhnigik0uvyt4m",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}
],
"indexes": [],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {}
},
{
"id": "yfhnigik0uvyt4m",
"created": "2024-01-05 08:50:50.016Z",
"updated": "2024-01-05 09:08:00.316Z",
"name": "campaigns",
"type": "base",
"system": false,
"schema": [
{
"system": false,
"id": "1laswhyx",
"name": "name",
"type": "text",
"required": true,
"presentable": true,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "4fxgwtui",
"name": "vars",
"type": "json",
"required": true,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "tni65iyd",
"name": "usersQuery",
"type": "text",
"required": true,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}
],
"indexes": [],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {}
},
{
"id": "s00x84jumfjcuvc",
"created": "2024-01-05 08:59:19.802Z",
"updated": "2024-01-05 08:59:19.802Z",
"name": "subscribed_users",
"type": "view",
"system": false,
"schema": [
{
"system": false,
"id": "v2xqodbb",
"name": "username",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "r2ir7x1v",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
},
{
"system": false,
"id": "ngvopwyl",
"name": "subscription",
"type": "select",
"required": true,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"free",
"premium",
"lifetime",
"legacy"
]
}
},
{
"system": false,
"id": "a5yursiu",
"name": "isLegacy",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "wly2vqr5",
"name": "isFounder",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}
],
"indexes": [],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {
"query": "select id, username, email, subscription, isLegacy, isFounder,created,updated from users where verified=1 and unsubscribe=0"
}
}
];
const collections = snapshot.map((item) => new Collection(item));
return Dao(db).importCollections(collections, false, null);
}, (db) => {
return null;
})

View File

@ -1,67 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const collection = new Collection({
"id": "yfhnigik0uvyt4m",
"created": "2024-01-05 08:50:50.016Z",
"updated": "2024-01-05 17:03:19.348Z",
"name": "campaigns",
"type": "base",
"system": false,
"schema": [
{
"system": false,
"id": "1laswhyx",
"name": "name",
"type": "text",
"required": true,
"presentable": true,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "4fxgwtui",
"name": "vars",
"type": "json",
"required": true,
"presentable": false,
"unique": false,
"options": {
"maxSize": 20000
}
},
{
"system": false,
"id": "tni65iyd",
"name": "usersQuery",
"type": "text",
"required": true,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}
],
"indexes": [],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {}
});
return Dao(db).saveCollection(collection);
}, (db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId("yfhnigik0uvyt4m");
return dao.deleteCollection(collection);
})

View File

@ -1,69 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const collection = new Collection({
"id": "w1vjr1edr5tsam3",
"created": "2023-12-29 14:50:43.496Z",
"updated": "2024-01-05 17:05:50.218Z",
"name": "campaign_messages",
"type": "base",
"system": false,
"schema": [
{
"system": false,
"id": "wsfnencj",
"name": "campaign",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "yfhnigik0uvyt4m",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
},
{
"system": false,
"id": "lxy9jyyk",
"name": "subject",
"type": "text",
"required": true,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "4h2cqwha",
"name": "body",
"type": "editor",
"required": true,
"presentable": false,
"unique": false,
"options": {
"convertUrls": false
}
}
],
"indexes": [],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {}
});
return Dao(db).saveCollection(collection);
}, (db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId("w1vjr1edr5tsam3");
return dao.deleteCollection(collection);
})

View File

@ -1,44 +0,0 @@
/// <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": "qdtuuld1",
"name": "subdomain",
"type": "text",
"required": true,
"presentable": true,
"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-z0-9-]{2,39}$"
}
}))
return dao.saveCollection(collection)
})

View File

@ -1,48 +0,0 @@
/// <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": "kigwtdjb",
"name": "campaign_message",
"type": "relation",
"required": true,
"presentable": false,
"unique": false,
"options": {
"collectionId": "w1vjr1edr5tsam3",
"cascadeDelete": false,
"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": "kigwtdjb",
"name": "campaign",
"type": "relation",
"required": true,
"presentable": false,
"unique": false,
"options": {
"collectionId": "w1vjr1edr5tsam3",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))
return dao.saveCollection(collection)
})

View File

@ -1,57 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const collection = new Collection({
"id": "hsuwe2h3csch1yr",
"created": "2024-01-07 07:16:49.459Z",
"updated": "2024-01-07 07:16:49.459Z",
"name": "audit",
"type": "base",
"system": false,
"schema": [
{
"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
}
},
{
"system": false,
"id": "chqbmew7",
"name": "note",
"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": {}
});
return Dao(db).saveCollection(collection);
}, (db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId("hsuwe2h3csch1yr");
return dao.deleteCollection(collection);
})

View File

@ -1,31 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((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)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("hsuwe2h3csch1yr")
// remove
collection.schema.removeField("orqvyzje")
return dao.saveCollection(collection)
})

View File

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

View File

@ -1,49 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const collection = new Collection({
"id": "y5lqraz7c4jvisu",
"created": "2024-01-08 13:55:45.485Z",
"updated": "2024-01-08 13:55:45.485Z",
"name": "notifications",
"type": "base",
"system": false,
"schema": [
{
"system": false,
"id": "ezyqswtg",
"name": "payload",
"type": "json",
"required": true,
"presentable": false,
"unique": false,
"options": {
"maxSize": 2000000
}
},
{
"system": false,
"id": "as9ni2h6",
"name": "delivered",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}
],
"indexes": [],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {}
});
return Dao(db).saveCollection(collection);
}, (db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId("y5lqraz7c4jvisu");
return dao.deleteCollection(collection);
})

View File

@ -1,96 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y5lqraz7c4jvisu")
// add
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
}
}))
// 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": "message",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "w1vjr1edr5tsam3",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y5lqraz7c4jvisu")
// remove
collection.schema.removeField("ry5pnrld")
// remove
collection.schema.removeField("fksunfv1")
// remove
collection.schema.removeField("gmqwgamf")
// remove
collection.schema.removeField("crksfxsv")
return dao.saveCollection(collection)
})

View File

@ -1,33 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y5lqraz7c4jvisu")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "dwn9j8oo",
"name": "channel",
"type": "select",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"email",
"lemonbot"
]
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y5lqraz7c4jvisu")
// remove
collection.schema.removeField("dwn9j8oo")
return dao.saveCollection(collection)
})

View File

@ -1,136 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((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
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "9vjfnw4e",
"name": "raw_payload",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}))
return dao.saveCollection(collection)
}, (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")
// remove
collection.schema.removeField("9vjfnw4e")
return dao.saveCollection(collection)
})

View File

@ -1,45 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y5lqraz7c4jvisu")
// remove
collection.schema.removeField("as9ni2h6")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "sgeq9rbv",
"name": "delivered",
"type": "date",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": "",
"max": ""
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y5lqraz7c4jvisu")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "as9ni2h6",
"name": "delivered",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}))
// remove
collection.schema.removeField("sgeq9rbv")
return dao.saveCollection(collection)
})

View File

@ -1,33 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y5lqraz7c4jvisu")
// 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)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y5lqraz7c4jvisu")
// remove
collection.schema.removeField("cmkxbt9j")
return dao.saveCollection(collection)
})

View File

@ -1,69 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y5lqraz7c4jvisu")
// 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
}
}))
// update
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
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y5lqraz7c4jvisu")
// remove
collection.schema.removeField("qoshryii")
// update
collection.schema.addField(new SchemaField({
"system": false,
"id": "crksfxsv",
"name": "message",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "w1vjr1edr5tsam3",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))
return dao.saveCollection(collection)
})

View File

@ -1,69 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const collection = new Collection({
"id": "6m8h2sy0nutig46",
"created": "2024-01-08 18:12:45.214Z",
"updated": "2024-01-08 18:12:45.214Z",
"name": "message_templates",
"type": "base",
"system": false,
"schema": [
{
"system": false,
"id": "si53ohkr",
"name": "slug",
"type": "text",
"required": true,
"presentable": true,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "zarqosgs",
"name": "subject",
"type": "text",
"required": true,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "woodsq1c",
"name": "body_html",
"type": "editor",
"required": false,
"presentable": false,
"unique": false,
"options": {
"convertUrls": false
}
}
],
"indexes": [
"CREATE UNIQUE INDEX `idx_7e53x5A` ON `message_templates` (`slug`)"
],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {}
});
return Dao(db).saveCollection(collection);
}, (db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId("6m8h2sy0nutig46");
return dao.deleteCollection(collection);
})

View File

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

View File

@ -1,29 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y5lqraz7c4jvisu")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "zoqchc2l",
"name": "message_template_vars",
"type": "json",
"required": true,
"presentable": false,
"unique": false,
"options": {
"maxSize": 2000000
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y5lqraz7c4jvisu")
// remove
collection.schema.removeField("zoqchc2l")
return dao.saveCollection(collection)
})

View File

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

View File

@ -1,55 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const collection = new Collection({
"id": "h055gvw3oqi2fs0",
"created": "2024-01-12 11:12:59.598Z",
"updated": "2024-01-12 11:12:59.598Z",
"name": "duplicate_emails",
"type": "view",
"system": false,
"schema": [
{
"system": false,
"id": "9hblghvi",
"name": "domain",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 1
}
},
{
"system": false,
"id": "csleeffq",
"name": "user_count",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}
],
"indexes": [],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {
"query": "SELECT (ROW_NUMBER() OVER()) as id, SUBSTR(email, INSTR(email, '@')) AS domain, COUNT(*) AS user_count\nFROM users\nGROUP BY domain\nORDER BY user_count DESC;\n"
}
});
return Dao(db).saveCollection(collection);
}, (db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId("h055gvw3oqi2fs0");
return dao.deleteCollection(collection);
})

View File

@ -1,92 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("h055gvw3oqi2fs0")
collection.options = {
"query": "SELECT (ROW_NUMBER() OVER()) as id, SUBSTR(email, INSTR(email, '@')) AS domain, COUNT(*) AS user_count\nFROM users\n WHERE email LIKE '%+%'\nGROUP BY domain\nORDER BY user_count DESC;\n"
}
// remove
collection.schema.removeField("9hblghvi")
// remove
collection.schema.removeField("csleeffq")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "wwltpcoc",
"name": "domain",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 1
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "yy0kkdim",
"name": "user_count",
"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("h055gvw3oqi2fs0")
collection.options = {
"query": "SELECT (ROW_NUMBER() OVER()) as id, SUBSTR(email, INSTR(email, '@')) AS domain, COUNT(*) AS user_count\nFROM users\nGROUP BY domain\nORDER BY user_count DESC;\n"
}
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "9hblghvi",
"name": "domain",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 1
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "csleeffq",
"name": "user_count",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// remove
collection.schema.removeField("wwltpcoc")
// remove
collection.schema.removeField("yy0kkdim")
return dao.saveCollection(collection)
})

View File

@ -1,92 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("h055gvw3oqi2fs0")
collection.options = {
"query": "SELECT (ROW_NUMBER() OVER()) as id, SUBSTR(email, INSTR(email, '@')) AS domain, COUNT(*) AS user_count\nFROM users\n WHERE email LIKE '%+%'\nORDER BY user_count DESC;\n"
}
// remove
collection.schema.removeField("wwltpcoc")
// remove
collection.schema.removeField("yy0kkdim")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "juo93d3a",
"name": "domain",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 1
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "whrph450",
"name": "user_count",
"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("h055gvw3oqi2fs0")
collection.options = {
"query": "SELECT (ROW_NUMBER() OVER()) as id, SUBSTR(email, INSTR(email, '@')) AS domain, COUNT(*) AS user_count\nFROM users\n WHERE email LIKE '%+%'\nGROUP BY domain\nORDER BY user_count DESC;\n"
}
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "wwltpcoc",
"name": "domain",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 1
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "yy0kkdim",
"name": "user_count",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// remove
collection.schema.removeField("juo93d3a")
// remove
collection.schema.removeField("whrph450")
return dao.saveCollection(collection)
})

View File

@ -1,74 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("h055gvw3oqi2fs0")
collection.options = {
"query": "SELECT (ROW_NUMBER() OVER()) as id, email\nFROM users\n WHERE email LIKE '%+%'\n"
}
// remove
collection.schema.removeField("juo93d3a")
// remove
collection.schema.removeField("whrph450")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "92iigwzl",
"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("h055gvw3oqi2fs0")
collection.options = {
"query": "SELECT (ROW_NUMBER() OVER()) as id, SUBSTR(email, INSTR(email, '@')) AS domain, COUNT(*) AS user_count\nFROM users\n WHERE email LIKE '%+%'\nORDER BY user_count DESC;\n"
}
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "juo93d3a",
"name": "domain",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 1
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "whrph450",
"name": "user_count",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// remove
collection.schema.removeField("92iigwzl")
return dao.saveCollection(collection)
})

View File

@ -1,91 +0,0 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("h055gvw3oqi2fs0")
collection.options = {
"query": "SELECT \n (ROW_NUMBER() OVER()) as id,\n SUBSTR(email, 1, INSTR(email, '@') - 1) AS email_prefix,\n SUBSTR(email, INSTR(email, '@')) AS email_domain,\n COUNT(*) AS count\nFROM \n (SELECT \n CASE \n WHEN INSTR(SUBSTR(email, 1, INSTR(email, '@') - 1), '+') > 0 \n THEN SUBSTR(email, 1, INSTR(SUBSTR(email, 1, INSTR(email, '@') - 1), '+') - 1) || SUBSTR(email, INSTR(email, '@')) \n ELSE email \n END AS email \n FROM users)\nGROUP BY \n email_prefix, email_domain;\n"
}
// remove
collection.schema.removeField("92iigwzl")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "y2akvv89",
"name": "email_prefix",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 1
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "za7mr8gw",
"name": "email_domain",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 1
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "zjwougcm",
"name": "count",
"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("h055gvw3oqi2fs0")
collection.options = {
"query": "SELECT (ROW_NUMBER() OVER()) as id, email\nFROM users\n WHERE email LIKE '%+%'\n"
}
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "92iigwzl",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
// remove
collection.schema.removeField("y2akvv89")
// remove
collection.schema.removeField("za7mr8gw")
// remove
collection.schema.removeField("zjwougcm")
return dao.saveCollection(collection)
})

File diff suppressed because it is too large Load Diff