From 1576905e0357ef96cd852ea3c1ff4216af195c34 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Thu, 8 Aug 2019 15:19:53 +0200 Subject: Rename internal settings table In fact it's not _just_ a rename. We are now able to use our own entity with the CraueConfigBundle which allow us to enforce a custom length on string field and avoid error with utf8mb4 on MySQL. To fix that issue before we were in need to fork CraueConfigBundle to hard apply these length changes. The recent 2.3.0 release fix that issue. That's why we are in need to rename the table (getting rid of the bundle name from it) Also updating deps: - Updating symfony/polyfill-mbstring (v1.11.0 => v1.12.0) - Updating symfony/polyfill-ctype (v1.11.0 => v1.12.0) - Updating symfony/polyfill-php70 (v1.11.0 => v1.12.0) - Updating symfony/polyfill-util (v1.11.0 => v1.12.0) - Updating symfony/polyfill-php56 (v1.11.0 => v1.12.0) - Updating symfony/polyfill-intl-icu (v1.11.0 => v1.12.0) - Updating symfony/polyfill-apcu (v1.11.0 => v1.12.0) - Updating j0k3r/graby-site-config (1.0.88 => 1.0.89) - Updating php-http/message (1.7.2 => 1.8.0) - Updating symfony/polyfill-php73 (v1.11.0 => v1.12.0) - Updating symfony/http-client (v4.3.2 => v4.3.3) - Updating symfony/polyfill-php72 (v1.11.0 => v1.12.0) - Updating symfony/polyfill-intl-idn (v1.11.0 => v1.12.0) - Updating symfony/mime (v4.3.2 => v4.3.3) - Updating craue/config-bundle (dev-utf8mb4 46cfd37 => 2.3.0) - Updating masterminds/html5 (2.6.0 => 2.7.0) - Updating nette/di (v3.0.0 => v3.0.1) - Updating symfony/polyfill-iconv (v1.11.0 => v1.12.0) - Updating wallabag/php-mobi (1.0.1 => 1.1.0) --- app/DoctrineMigrations/Version20190808124957.php | 42 ++++++++++++++++++++++++ app/config/config.yml | 4 +++ 2 files changed, 46 insertions(+) create mode 100644 app/DoctrineMigrations/Version20190808124957.php (limited to 'app') diff --git a/app/DoctrineMigrations/Version20190808124957.php b/app/DoctrineMigrations/Version20190808124957.php new file mode 100644 index 00000000..4e12e995 --- /dev/null +++ b/app/DoctrineMigrations/Version20190808124957.php @@ -0,0 +1,42 @@ +connection->getDatabasePlatform()->getName()) { + case 'sqlite': + $this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting', true) . ' RENAME TO ' . $this->getTable('internal_setting', true)); + break; + case 'mysql': + $this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' RENAME ' . $this->getTable('internal_setting')); + break; + case 'postgresql': + $this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' RENAME TO ' . $this->getTable('internal_setting')); + break; + } + } + + public function down(Schema $schema): void + { + switch ($this->connection->getDatabasePlatform()->getName()) { + case 'sqlite': + $this->addSql('ALTER TABLE ' . $this->getTable('internal_setting', true) . ' RENAME TO ' . $this->getTable('craue_config_setting', true)); + break; + case 'mysql': + $this->addSql('ALTER TABLE ' . $this->getTable('internal_setting') . ' RENAME ' . $this->getTable('craue_config_setting')); + break; + case 'postgresql': + $this->addSql('ALTER TABLE ' . $this->getTable('internal_setting') . ' RENAME TO ' . $this->getTable('craue_config_setting')); + break; + } + } +} diff --git a/app/config/config.yml b/app/config/config.yml index bbcc682f..642e198d 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -392,3 +392,7 @@ httplug: 'X-Accept': 'application/json' discovery: client: false + +# define custom entity so we can override length attribute to fix utf8mb4 issue +craue_config: + entity_name: Wallabag\CoreBundle\Entity\InternalSetting -- cgit v1.2.3