diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-12-23 09:31:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-23 09:31:41 +0100 |
commit | 771934632833720c4d0560dc589f22d4f1bdb55e (patch) | |
tree | f7811a5f8d918f51030d2aadafe55226370a93e3 /app/DoctrineMigrations/Version20161022134138.php | |
parent | cd77a7e7eff5d6940a7037387062aa5dde64128c (diff) | |
parent | a72f3dc308f2e4386f73e88af41db919ba0acaf3 (diff) | |
download | wallabag-771934632833720c4d0560dc589f22d4f1bdb55e.tar.gz wallabag-771934632833720c4d0560dc589f22d4f1bdb55e.tar.zst wallabag-771934632833720c4d0560dc589f22d4f1bdb55e.zip |
Merge pull request #2696 from wallabag/run-migration
Run migration on each test
Diffstat (limited to 'app/DoctrineMigrations/Version20161022134138.php')
-rw-r--r-- | app/DoctrineMigrations/Version20161022134138.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/app/DoctrineMigrations/Version20161022134138.php b/app/DoctrineMigrations/Version20161022134138.php index b3d02b40..d0e5cb3f 100644 --- a/app/DoctrineMigrations/Version20161022134138.php +++ b/app/DoctrineMigrations/Version20161022134138.php | |||
@@ -31,7 +31,13 @@ class Version20161022134138 extends AbstractMigration implements ContainerAwareI | |||
31 | { | 31 | { |
32 | $this->skipIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'This migration only apply to MySQL'); | 32 | $this->skipIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'This migration only apply to MySQL'); |
33 | 33 | ||
34 | $this->addSql('ALTER DATABASE '.$this->container->getParameter('database_name').' CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;'); | 34 | $this->addSql('ALTER DATABASE '.$this->connection->getParams()['dbname'].' CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;'); |
35 | |||
36 | // convert field length for utf8mb4 | ||
37 | // http://stackoverflow.com/a/31474509/569101 | ||
38 | $this->addSql('ALTER TABLE '.$this->getTable('user').' CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT NULL;'); | ||
39 | $this->addSql('ALTER TABLE '.$this->getTable('user').' CHANGE salt salt VARCHAR(180) NOT NULL;'); | ||
40 | $this->addSql('ALTER TABLE '.$this->getTable('user').' CHANGE password password VARCHAR(180) NOT NULL;'); | ||
35 | 41 | ||
36 | $this->addSql('ALTER TABLE '.$this->getTable('annotation').' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); | 42 | $this->addSql('ALTER TABLE '.$this->getTable('annotation').' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); |
37 | $this->addSql('ALTER TABLE '.$this->getTable('entry').' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); | 43 | $this->addSql('ALTER TABLE '.$this->getTable('entry').' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); |
@@ -56,7 +62,7 @@ class Version20161022134138 extends AbstractMigration implements ContainerAwareI | |||
56 | { | 62 | { |
57 | $this->skipIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'This migration only apply to MySQL'); | 63 | $this->skipIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'This migration only apply to MySQL'); |
58 | 64 | ||
59 | $this->addSql('ALTER DATABASE '.$this->container->getParameter('database_name').' CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;'); | 65 | $this->addSql('ALTER DATABASE '.$this->connection->getParams()['dbname'].' CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;'); |
60 | 66 | ||
61 | $this->addSql('ALTER TABLE '.$this->getTable('annotation').' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); | 67 | $this->addSql('ALTER TABLE '.$this->getTable('annotation').' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); |
62 | $this->addSql('ALTER TABLE '.$this->getTable('entry').' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); | 68 | $this->addSql('ALTER TABLE '.$this->getTable('entry').' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); |