mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
fixup! Add a two-step setup of OTP
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
This commit is contained in:
parent
342d87d022
commit
69399b1c10
1 changed files with 14 additions and 1 deletions
|
@ -22,8 +22,21 @@ final class Version20250413133131 extends WallabagMigration
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'notnull' => true,
|
'notnull' => true,
|
||||||
]);
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
$this->addSql("UPDATE " . $this->getTable('user') . " SET google_authenticator = 1 WHERE googleAuthenticatorSecret IS NOT NULL AND googleAuthenticatorSecret <> '';");
|
/**
|
||||||
|
* Query to update data in user table, as it's not possible to perform this in the `up` method.
|
||||||
|
*/
|
||||||
|
public function postUp(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->skipIf(!$schema->getTable($this->getTable('user'))->hasColumn('google_authenticator'), 'Unable to update google_authenticator column');
|
||||||
|
$this->connection->executeQuery(
|
||||||
|
'UPDATE ' . $this->getTable('user') . ' SET google_authenticator = :googleAuthenticator WHERE googleAuthenticatorSecret IS NOT NULL AND googleAuthenticatorSecret <> :emptyString',
|
||||||
|
[
|
||||||
|
'googleAuthenticator' => true,
|
||||||
|
'emptyString' => '',
|
||||||
|
]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue