From e674458f22f453b23d0a9c813339064f48111208 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sat, 19 Jul 2025 03:15:31 +0200 Subject: [PATCH] fixup! Add a two-step setup of OTP Signed-off-by: Kevin Decherf --- migrations/Version20250413133131.php | 7 ++++--- src/Entity/User.php | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/migrations/Version20250413133131.php b/migrations/Version20250413133131.php index 19186aef2..ff6e1411a 100644 --- a/migrations/Version20250413133131.php +++ b/migrations/Version20250413133131.php @@ -12,13 +12,14 @@ use Wallabag\Doctrine\WallabagMigration; */ final class Version20250413133131 extends WallabagMigration { + public function up(Schema $schema): void { $userTable = $schema->getTable($this->getTable('user')); - $this->skipIf($userTable->hasColumn('googleauthenticator'), 'It seems that you already played this migration.'); + $this->skipIf($userTable->hasColumn('google_authenticator'), 'It seems that you already played this migration.'); - $userTable->addColumn('googleauthenticator', 'boolean', [ + $userTable->addColumn('google_authenticator', 'boolean', [ 'default' => false, 'notnull' => true, ]); @@ -27,6 +28,6 @@ final class Version20250413133131 extends WallabagMigration public function down(Schema $schema): void { $userTable = $schema->getTable($this->getTable('user')); - $userTable->dropColumn('googleauthenticator'); + $userTable->dropColumn('google_authenticator'); } } diff --git a/src/Entity/User.php b/src/Entity/User.php index b3117762d..532f56160 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -147,7 +147,7 @@ class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorI #[ORM\Column(name: 'googleAuthenticatorSecret', type: 'string', nullable: true)] private $googleAuthenticatorSecret; - #[ORM\Column(name: 'googleAuthenticator', type: 'boolean')] + #[ORM\Column(name: 'google_authenticator', type: 'boolean')] private $googleAuthenticator = false; /**