From dbf6128747ac5b4b1c46d0bb41e821c1ee6af571 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 26 Jan 2021 17:56:57 +0100 Subject: [PATCH 1/2] Fix AddNameToUsersMigration not calling callbacks --- src/auth/migrations/AddNameToUsersMigration.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/auth/migrations/AddNameToUsersMigration.ts b/src/auth/migrations/AddNameToUsersMigration.ts index a9eadc6..cf513ab 100644 --- a/src/auth/migrations/AddNameToUsersMigration.ts +++ b/src/auth/migrations/AddNameToUsersMigration.ts @@ -15,10 +15,12 @@ export default class AddNameToUsersMigration extends Migration { // Give every user a random name const users = await User.select().get(this.getCurrentConnection()); + const callbacks: (() => Promise)[] = []; await Promise.all(users.map(user => { user.name = nanoid(); - return user.save(this.getCurrentConnection()); + return user.save(this.getCurrentConnection(), c => callbacks.push(c)); })); + await Promise.all(callbacks); await this.query(`ALTER TABLE users ADD CONSTRAINT UNIQUE (name)`); From 9d5fa9d937f1ce9b2b117dd02cceb85ba18a49d8 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 26 Jan 2021 17:57:17 +0100 Subject: [PATCH 2/2] Version 0.23.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a453599..381ffd4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "swaf", - "version": "0.23.4", + "version": "0.23.5", "description": "Structure Web Application Framework.", "repository": "https://eternae.ink/arisu/swaf", "author": "Alice Gaudon ",