]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - app/DoctrineMigrations/Version20161022134138.php
Use actual database name
[github/wallabag/wallabag.git] / app / DoctrineMigrations / Version20161022134138.php
index 3ac8cc5b4a520f94417b131bdbd7f5bd01f064e3..22469f632ffe867fa317757c0a4a40244dd54aaa 100644 (file)
@@ -31,7 +31,7 @@ class Version20161022134138 extends AbstractMigration implements ContainerAwareI
     {
         $this->skipIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'This migration only apply to MySQL');
 
-        $this->addSql('ALTER DATABASE '.$this->container->getParameter('database_name').' CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;');
+        $this->addSql('ALTER DATABASE '.$this->connection->getParams()['dbname'].' CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;');
 
         // convert field length for utf8mb4
         // http://stackoverflow.com/a/31474509/569101
@@ -62,7 +62,7 @@ class Version20161022134138 extends AbstractMigration implements ContainerAwareI
     {
         $this->skipIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'This migration only apply to MySQL');
 
-        $this->addSql('ALTER DATABASE '.$this->container->getParameter('database_name').' CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;');
+        $this->addSql('ALTER DATABASE '.$this->connection->getParams()['dbname'].' CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;');
 
         $this->addSql('ALTER TABLE '.$this->getTable('annotation').' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;');
         $this->addSql('ALTER TABLE '.$this->getTable('entry').' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;');