minichat/pb_migrations/1730468576_updated_users.js
2024-11-01 15:11:56 +01:00

48 lines
1.1 KiB
JavaScript

/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("_pb_users_auth_")
// update
collection.schema.addField(new SchemaField({
"system": false,
"id": "zypmidzx",
"name": "groups",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "b3bw2apayoyh7um",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": null,
"displayFields": null
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("_pb_users_auth_")
// update
collection.schema.addField(new SchemaField({
"system": false,
"id": "zypmidzx",
"name": "field",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "b3bw2apayoyh7um",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": null,
"displayFields": null
}
}))
return dao.saveCollection(collection)
})