feat: modify group collection in pocketbase to include a "members" value
This commit is contained in:
parent
3391a5ab7d
commit
ca78e4f38e
1 changed files with 33 additions and 0 deletions
33
pb_migrations/1730640520_updated_groups.js
Normal file
33
pb_migrations/1730640520_updated_groups.js
Normal 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)
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue