diff options
Diffstat (limited to 'app/DoctrineMigrations')
-rw-r--r-- | app/DoctrineMigrations/Version20181202073750.php | 22 |
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 | } |