mirror of
https://github.com/pockethost/pockethost.git
synced 2025-11-29 00:23:05 +00:00
enh: imrpoved paid users view
This commit is contained in:
parent
80d3e531ac
commit
cdf7bf2e5d
@ -0,0 +1,94 @@
|
||||
/// <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)
|
||||
})
|
||||
Loading…
x
Reference in New Issue
Block a user