3 namespace Application\Migrations
;
5 use Doctrine\DBAL\Schema\Schema
;
6 use Wallabag\CoreBundle\Doctrine\WallabagMigration
;
9 * Add 2fa OTP (named google authenticator).
11 final class Version20181202073750
extends WallabagMigration
13 public function up(Schema
$schema): void
15 $tableName = $this->getTable('annotation');
17 switch ($this->connection
->getDatabasePlatform()->getName()) {
21 $this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD googleAuthenticatorSecret VARCHAR(191) DEFAULT NULL, CHANGE twoFactorAuthentication emailTwoFactor BOOLEAN NOT NULL, DROP trusted, ADD backupCodes LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json_array)\'');
28 public function down(Schema
$schema): void
30 switch ($this->connection
->getDatabasePlatform()->getName()) {
34 $this->addSql('ALTER TABLE `' . $this->getTable('user') . '` DROP googleAuthenticatorSecret, CHANGE emailtwofactor twoFactorAuthentication BOOLEAN NOT NULL, ADD trusted TEXT DEFAULT NULL, DROP backupCodes');