first commit

This commit is contained in:
Kevand
2026-02-04 00:21:37 +00:00
commit 58925b1ac0
18 changed files with 1086 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("_pb_users_auth_")
// update collection data
unmarshal({
"indexes": [
"CREATE UNIQUE INDEX `idx_tokenKey__pb_users_auth_` ON `users` (`tokenKey`)",
"CREATE UNIQUE INDEX `idx_email__pb_users_auth_` ON `users` (`email`) WHERE `email` != ''",
"CREATE UNIQUE INDEX `idx_gMjTpwYqPW` ON `users` (`name`)"
],
"passwordAuth": {
"identityFields": [
"email",
"name"
]
}
}, collection)
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("_pb_users_auth_")
// update collection data
unmarshal({
"indexes": [
"CREATE UNIQUE INDEX `idx_tokenKey__pb_users_auth_` ON `users` (`tokenKey`)",
"CREATE UNIQUE INDEX `idx_email__pb_users_auth_` ON `users` (`email`) WHERE `email` != ''"
],
"passwordAuth": {
"identityFields": [
"email"
]
}
}, collection)
return app.save(collection)
})