feat: modify group collection in pocketbase to include a "members" value

This commit is contained in:
HerozDotExe 2024-11-03 14:38:54 +01:00
parent 3391a5ab7d
commit ca78e4f38e

View file

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