From 45674db0b5e1350a4389a02058e025b2fc8f2412 Mon Sep 17 00:00:00 2001 From: f Date: Tue, 12 Dec 2023 11:06:35 -0300 Subject: [PATCH] BREAKING CHANGE: migrations are deployed separately --- 1687801090_sutty_initial_admin.js | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 1687801090_sutty_initial_admin.js 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 */ - } - }, -);