aboutsummaryrefslogtreecommitdiffhomepage
path: root/app
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2018-10-29 14:33:41 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2018-10-29 14:33:41 +0100
commit48c802da124ccb44f9602ae05af3bf1d2082a8d0 (patch)
treee3c1d7acf3cc9ac9582880210671c6253928af77 /app
parent2e1c165316102a622f6f57bcb3422aaa76962043 (diff)
downloadwallabag-48c802da124ccb44f9602ae05af3bf1d2082a8d0.tar.gz
wallabag-48c802da124ccb44f9602ae05af3bf1d2082a8d0.tar.zst
wallabag-48c802da124ccb44f9602ae05af3bf1d2082a8d0.zip
fixup! Debug MySQL failing
Diffstat (limited to 'app')
-rw-r--r--app/DoctrineMigrations/Version20160401000000.php2
-rwxr-xr-xapp/DoctrineMigrations/Version20180405182455.php21
-rw-r--r--app/DoctrineMigrations/Version20181029131313.php38
-rw-r--r--app/config/config.yml3
4 files changed, 44 insertions, 20 deletions
diff --git a/app/DoctrineMigrations/Version20160401000000.php b/app/DoctrineMigrations/Version20160401000000.php
index c80e3e1f..9a6aeed6 100644
--- a/app/DoctrineMigrations/Version20160401000000.php
+++ b/app/DoctrineMigrations/Version20160401000000.php
@@ -63,7 +63,7 @@ SQL
63 break; 63 break;
64 case 'mysql': 64 case 'mysql':
65 $sql = <<<SQL 65 $sql = <<<SQL
66CREATE TABLE {$this->getTable('craue_config_setting')} (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_5D9649505E237E06 (name), PRIMARY KEY(name)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; 66CREATE TABLE {$this->getTable('craue_config_setting')} (name VARCHAR(191) NOT NULL, value VARCHAR(191) DEFAULT NULL, section VARCHAR(191) DEFAULT NULL, UNIQUE INDEX UNIQ_5D9649505E237E06 (name), PRIMARY KEY(name)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
67CREATE TABLE {$this->getTable('entry')} (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, title LONGTEXT DEFAULT NULL, url LONGTEXT DEFAULT NULL, is_archived TINYINT(1) NOT NULL, is_starred TINYINT(1) NOT NULL, content LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype LONGTEXT DEFAULT NULL, language LONGTEXT DEFAULT NULL, reading_time INT DEFAULT NULL, domain_name LONGTEXT DEFAULT NULL, preview_picture LONGTEXT DEFAULT NULL, is_public TINYINT(1) DEFAULT '0', INDEX IDX_F4D18282A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; 67CREATE TABLE {$this->getTable('entry')} (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, title LONGTEXT DEFAULT NULL, url LONGTEXT DEFAULT NULL, is_archived TINYINT(1) NOT NULL, is_starred TINYINT(1) NOT NULL, content LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype LONGTEXT DEFAULT NULL, language LONGTEXT DEFAULT NULL, reading_time INT DEFAULT NULL, domain_name LONGTEXT DEFAULT NULL, preview_picture LONGTEXT DEFAULT NULL, is_public TINYINT(1) DEFAULT '0', INDEX IDX_F4D18282A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
68CREATE TABLE {$this->getTable('entry_tag')} (entry_id INT NOT NULL, tag_id INT NOT NULL, INDEX IDX_C9F0DD7CBA364942 (entry_id), INDEX IDX_C9F0DD7CBAD26311 (tag_id), PRIMARY KEY(entry_id, tag_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; 68CREATE TABLE {$this->getTable('entry_tag')} (entry_id INT NOT NULL, tag_id INT NOT NULL, INDEX IDX_C9F0DD7CBA364942 (entry_id), INDEX IDX_C9F0DD7CBAD26311 (tag_id), PRIMARY KEY(entry_id, tag_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
69CREATE TABLE {$this->getTable('config')} (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, theme VARCHAR(255) NOT NULL, items_per_page INT NOT NULL, language VARCHAR(255) NOT NULL, rss_token VARCHAR(255) DEFAULT NULL, rss_limit INT DEFAULT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, UNIQUE INDEX UNIQ_87E64C53A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; 69CREATE TABLE {$this->getTable('config')} (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, theme VARCHAR(255) NOT NULL, items_per_page INT NOT NULL, language VARCHAR(255) NOT NULL, rss_token VARCHAR(255) DEFAULT NULL, rss_limit INT DEFAULT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, UNIQUE INDEX UNIQ_87E64C53A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
diff --git a/app/DoctrineMigrations/Version20180405182455.php b/app/DoctrineMigrations/Version20180405182455.php
index 71879c0e..50fe97c7 100755
--- a/app/DoctrineMigrations/Version20180405182455.php
+++ b/app/DoctrineMigrations/Version20180405182455.php
@@ -2,27 +2,15 @@
2 2
3namespace Application\Migrations; 3namespace Application\Migrations;
4 4
5use Doctrine\DBAL\Migrations\AbstractMigration;
6use Doctrine\DBAL\Schema\Schema; 5use Doctrine\DBAL\Schema\Schema;
7use Symfony\Component\DependencyInjection\ContainerAwareInterface; 6use Wallabag\CoreBundle\Doctrine\WallabagMigration;
8use Symfony\Component\DependencyInjection\ContainerInterface;
9 7
10/** 8/**
11 * Add archived_at column and set its value to updated_at for is_archived entries. 9 * Add archived_at column and set its value to updated_at for is_archived entries.
12 */ 10 */
13class Version20180405182455 extends AbstractMigration implements ContainerAwareInterface 11class Version20180405182455 extends WallabagMigration
14{ 12{
15 /** 13 /**
16 * @var ContainerInterface
17 */
18 private $container;
19
20 public function setContainer(ContainerInterface $container = null)
21 {
22 $this->container = $container;
23 }
24
25 /**
26 * @param Schema $schema 14 * @param Schema $schema
27 */ 15 */
28 public function up(Schema $schema) 16 public function up(Schema $schema)
@@ -60,9 +48,4 @@ class Version20180405182455 extends AbstractMigration implements ContainerAwareI
60 48
61 $entryTable->dropColumn('archived_at'); 49 $entryTable->dropColumn('archived_at');
62 } 50 }
63
64 private function getTable($tableName)
65 {
66 return $this->container->getParameter('database_table_prefix') . $tableName;
67 }
68} 51}
diff --git a/app/DoctrineMigrations/Version20181029131313.php b/app/DoctrineMigrations/Version20181029131313.php
new file mode 100644
index 00000000..328dc80e
--- /dev/null
+++ b/app/DoctrineMigrations/Version20181029131313.php
@@ -0,0 +1,38 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Application\Migrations;
6
7use Doctrine\DBAL\Schema\Schema;
8use Wallabag\CoreBundle\Doctrine\WallabagMigration;
9
10/**
11 * Force utf8mb4 on craue_config_setting.
12 */
13final class Version20181029131313 extends WallabagMigration
14{
15 public function up(Schema $schema): void
16 {
17 $this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' RENAME TO ' . $this->getTable('internal_setting') . ';');
18
19 if ('mysql' === $this->connection->getDatabasePlatform()->getName()) {
20 $this->addSql('ALTER TABLE ' . $this->getTable('internal_setting') . ' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;');
21
22 $this->addSql('ALTER TABLE ' . $this->getTable('internal_setting') . ' CHANGE `name` `name` VARCHAR(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;');
23 $this->addSql('ALTER TABLE ' . $this->getTable('internal_setting') . ' CHANGE `section` `section` VARCHAR(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;');
24 }
25 }
26
27 public function down(Schema $schema): void
28 {
29 $this->addSql('ALTER TABLE ' . $this->getTable('internal_setting') . ' RENAME TO ' . $this->getTable('craue_config_setting') . ';');
30
31 if ('mysql' === $this->connection->getDatabasePlatform()->getName()) {
32 $this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;');
33
34 $this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' CHANGE `name` `name` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci;');
35 $this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' CHANGE `section` `section` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci;');
36 }
37 }
38}
diff --git a/app/config/config.yml b/app/config/config.yml
index 092f3ec0..b2ab0092 100644
--- a/app/config/config.yml
+++ b/app/config/config.yml
@@ -365,3 +365,6 @@ jms_serializer:
365sensio_framework_extra: 365sensio_framework_extra:
366 router: 366 router:
367 annotations: false 367 annotations: false
368
369craue_config:
370 entity_name: Wallabag\CoreBundle\Entity\InternalSetting