fp/services/pocketbase/pb_migrations/1762157776_updated_users.js
2025-11-05 20:49:00 -09:00

35 lines
725 B
JavaScript

/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("_pb_users_auth_")
// add field
collection.fields.addAt(8, new Field({
"hidden": false,
"id": "select66088533",
"maxSelect": 1,
"name": "supporter",
"presentable": false,
"required": false,
"system": false,
"type": "select",
"values": [
"free",
"tier1",
"tier2",
"tier3",
"tier4",
"tier5",
"tier6"
]
}))
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("_pb_users_auth_")
// remove field
collection.fields.removeById("select66088533")
return app.save(collection)
})