enh: add subscription quantity to users

This commit is contained in:
Ben Allfree 2025-01-10 11:46:20 +00:00
parent 2194576a1e
commit c151c32097

View File

@ -0,0 +1,31 @@
/// <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": "u4ckg6um",
"name": "subscription_quantity",
"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")
// remove
collection.schema.removeField("u4ckg6um")
return dao.saveCollection(collection)
})