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

33 lines
803 B
JavaScript

/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("_pb_users_auth_")
// add
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)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("_pb_users_auth_")
// remove
collection.schema.removeField("zypmidzx")
return dao.saveCollection(collection)
})