mirror of
https://github.com/pockethost/pockethost.git
synced 2025-06-05 05:36:51 +00:00
feat: suspension mode
This commit is contained in:
parent
2c8429bd54
commit
c504112f0c
@ -0,0 +1,31 @@
|
||||
/// <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": "7bi0jspk",
|
||||
"name": "suspension",
|
||||
"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")
|
||||
|
||||
// remove
|
||||
collection.schema.removeField("7bi0jspk")
|
||||
|
||||
return dao.saveCollection(collection)
|
||||
})
|
@ -520,6 +520,14 @@ export const instanceService = mkSingleton(
|
||||
throw new Error(`Instance owner is invalid`)
|
||||
}
|
||||
|
||||
/*
|
||||
Suspension check
|
||||
*/
|
||||
dbg(`Checking for suspension`)
|
||||
if (instance.suspension) {
|
||||
throw new Error(instance.suspension)
|
||||
}
|
||||
|
||||
/*
|
||||
Maintenance check
|
||||
*/
|
||||
|
@ -27,6 +27,7 @@ export type InstanceFields = BaseFields & {
|
||||
version: VersionId
|
||||
secrets: InstanceSecretCollection | null
|
||||
maintenance: boolean
|
||||
suspension: string
|
||||
syncAdmin: boolean
|
||||
cname: string
|
||||
dev: boolean
|
||||
|
Loading…
x
Reference in New Issue
Block a user