mirror of
https://github.com/walkxcode/dashboard-icons.git
synced 2025-10-27 05:29:03 +08:00
feat(web): add PocketBase backend with migrations and database
This commit is contained in:
22
web/backend/pb_migrations/1759324878_updated_users.js
Normal file
22
web/backend/pb_migrations/1759324878_updated_users.js
Normal 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({
|
||||
"listRule": "id = @request.auth.id || @request.auth.admin = true",
|
||||
"manageRule": "@request.auth.admin = true"
|
||||
}, collection)
|
||||
|
||||
return app.save(collection)
|
||||
}, (app) => {
|
||||
const collection = app.findCollectionByNameOrId("_pb_users_auth_")
|
||||
|
||||
// update collection data
|
||||
unmarshal({
|
||||
"listRule": "id = @request.auth.id || @request.body.admin = true",
|
||||
"manageRule": null
|
||||
}, collection)
|
||||
|
||||
return app.save(collection)
|
||||
})
|
||||
Reference in New Issue
Block a user