From 7735e67f50be2a6abc6cea9db909eb4763cb0078 Mon Sep 17 00:00:00 2001 From: Avris Date: Sat, 4 Dec 2021 22:19:45 +0100 Subject: [PATCH] [db] fix migration async execution issue --- server/migrate.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/server/migrate.js b/server/migrate.js index 85895106..02319de4 100644 --- a/server/migrate.js +++ b/server/migrate.js @@ -7,17 +7,3 @@ async function migrate() { } migrate(); - -// temporary code for a non-sqlite migration: -const normalise = s => s.trim().toLowerCase(); - -async function populateUsernameNorm() { - const db = await dbConnection(); - for ({id, username} of await db.all(`SELECT id, username FROM users WHERE usernameNorm IS NULL`)) { - const norm = normalise(username); // username is safe, so so will be norm - console.log(username, norm) - await db.all(`UPDATE users SET usernameNorm = '${norm}' WHERE id = '${id}'`); - } - await db.close(); -} -populateUsernameNorm();