diff --git a/1687801090_sutty_initial_admin.js b/1687801090_sutty_initial_admin.js deleted file mode 100644 index bdfc4cb..0000000 --- a/1687801090_sutty_initial_admin.js +++ /dev/null @@ -1,28 +0,0 @@ -// https://pocketbase.io/docs/js-migrations/#creating-new-admin -const email = "pocketbase@sutty.nl"; -migrate( - (db) => { - const dao = new Dao(db); - - const adminPwEnv = $os.getenv("ADMIN_PASSWORD"); - if (adminPwEnv) { - const admin = new Admin(); - admin.email = email; - admin.setPassword(adminPwEnv); - - dao.saveAdmin(admin); - } - }, - (db) => { - // optional revert - const dao = new Dao(db); - - try { - const admin = dao.findAdminByEmail(email); - - dao.deleteAdmin(admin); - } catch (_) { - /* most likely already deleted */ - } - }, -);