feat(web): add PocketBase backend with migrations and database

This commit is contained in:
Thomas Camlong
2025-10-01 15:47:15 +02:00
parent a93034d5b5
commit b8920b912a
39 changed files with 24653 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("_pb_users_auth_")
// update collection data
unmarshal({
"createRule": "@request.body.admin = false || @request.body.admin = null",
"updateRule": "id = @request.auth.id && (@request.body.admin = false || @request.body.admin = admin)"
}, collection)
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("_pb_users_auth_")
// update collection data
unmarshal({
"createRule": "",
"updateRule": "id = @request.auth.id && (@request.body.admin = null || @request.body.admin = admin)"
}, collection)
return app.save(collection)
})