aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/DoctrineMigrations
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2018-12-03 06:51:06 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2019-01-23 13:28:03 +0100
commitdfd0a7bc5feb4fd7b77d7e2f3a25c5c3febc1eba (patch)
tree112b4403052b0420804dc8a7bcba199f534d902e /app/DoctrineMigrations
parent6e4fc956abc909232044e7af0fa37cbb1b510f18 (diff)
downloadwallabag-dfd0a7bc5feb4fd7b77d7e2f3a25c5c3febc1eba.tar.gz
wallabag-dfd0a7bc5feb4fd7b77d7e2f3a25c5c3febc1eba.tar.zst
wallabag-dfd0a7bc5feb4fd7b77d7e2f3a25c5c3febc1eba.zip
Add backup codes
Diffstat (limited to 'app/DoctrineMigrations')
-rw-r--r--app/DoctrineMigrations/Version20181202073750.php22
1 files changed, 20 insertions, 2 deletions
diff --git a/app/DoctrineMigrations/Version20181202073750.php b/app/DoctrineMigrations/Version20181202073750.php
index a2308b99..b6ad8bd7 100644
--- a/app/DoctrineMigrations/Version20181202073750.php
+++ b/app/DoctrineMigrations/Version20181202073750.php
@@ -12,11 +12,29 @@ final class Version20181202073750 extends WallabagMigration
12{ 12{
13 public function up(Schema $schema): void 13 public function up(Schema $schema): void
14 { 14 {
15 $this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD googleAuthenticatorSecret VARCHAR(191) DEFAULT NULL, CHANGE twoFactorAuthentication emailTwoFactor BOOLEAN NOT NULL, DROP trusted'); 15 $tableName = $this->getTable('annotation');
16
17 switch ($this->connection->getDatabasePlatform()->getName()) {
18 case 'sqlite':
19 break;
20 case 'mysql':
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)\'');
22 break;
23 case 'postgresql':
24 break;
25 }
16 } 26 }
17 27
18 public function down(Schema $schema): void 28 public function down(Schema $schema): void
19 { 29 {
20 $this->addSql('ALTER TABLE `' . $this->getTable('user') . '` DROP googleAuthenticatorSecret, CHANGE emailtwofactor twoFactorAuthentication BOOLEAN NOT NULL, ADD trusted TEXT DEFAULT NULL'); 30 switch ($this->connection->getDatabasePlatform()->getName()) {
31 case 'sqlite':
32 break;
33 case 'mysql':
34 $this->addSql('ALTER TABLE `' . $this->getTable('user') . '` DROP googleAuthenticatorSecret, CHANGE emailtwofactor twoFactorAuthentication BOOLEAN NOT NULL, ADD trusted TEXT DEFAULT NULL, DROP backupCodes');
35 break;
36 case 'postgresql':
37 break;
38 }
21 } 39 }
22} 40}