update pocketbase,

This commit is contained in:
louiscklaw
2025-04-18 03:06:06 +08:00
parent d863d6d469
commit 03313dfc65
993 changed files with 71724 additions and 19 deletions

View File

@@ -0,0 +1,25 @@
// pb_migrations/0000000001_create_superuser.js
migrate(
(app) => {
const superusers_collection = app.findCollectionByNameOrId("_superusers");
const record = new Record(superusers_collection);
record.set("email", "admin@123.com");
record.set("password", "Aa12345678");
app.save(record);
console.log("Superuser admin@123.com created via migration");
},
(app) => {
try {
const record = app.findAuthRecordByEmail(
"_superusers",
"admin@example.com"
);
app.delete(record);
} catch {
// silent errors (probably already deleted)
}
}
);