aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/DoctrineMigrations
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2016-12-13 10:31:53 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-12-19 10:35:25 +0100
commitd44016b072ebe146f3f875f6bf3e9268b367867e (patch)
tree725b18d32f2eb83022458312cd59b8fe72115e2a /app/DoctrineMigrations
parent3ad4061dbab52a17cc961bef15abad181e352448 (diff)
downloadwallabag-d44016b072ebe146f3f875f6bf3e9268b367867e.tar.gz
wallabag-d44016b072ebe146f3f875f6bf3e9268b367867e.tar.zst
wallabag-d44016b072ebe146f3f875f6bf3e9268b367867e.zip
Use actual database name
We can't retrieve the environment within the migration. And when we ran migration on Travis, database name isn't `database_name` but `test_database_name`. Retrieve the database name from the connection is more accurate
Diffstat (limited to 'app/DoctrineMigrations')
-rw-r--r--app/DoctrineMigrations/Version20161022134138.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/DoctrineMigrations/Version20161022134138.php b/app/DoctrineMigrations/Version20161022134138.php
index 3ac8cc5b..22469f63 100644
--- a/app/DoctrineMigrations/Version20161022134138.php
+++ b/app/DoctrineMigrations/Version20161022134138.php
@@ -31,7 +31,7 @@ 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 35
36 // convert field length for utf8mb4 36 // convert field length for utf8mb4
37 // http://stackoverflow.com/a/31474509/569101 37 // http://stackoverflow.com/a/31474509/569101
@@ -62,7 +62,7 @@ class Version20161022134138 extends AbstractMigration implements ContainerAwareI
62 { 62 {
63 $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');
64 64
65 $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;');
66 66
67 $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;');
68 $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;');