diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/DoctrineMigrations/Version20160401000000.php | 2 | ||||
-rwxr-xr-x | app/DoctrineMigrations/Version20180405182455.php | 21 | ||||
-rw-r--r-- | app/DoctrineMigrations/Version20181029131313.php | 38 | ||||
-rw-r--r-- | app/config/config.yml | 3 |
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 |
66 | CREATE 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; | 66 | CREATE 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; |
67 | CREATE 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; | 67 | CREATE 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; |
68 | CREATE 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; | 68 | CREATE 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; |
69 | CREATE 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; | 69 | CREATE 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 | ||
3 | namespace Application\Migrations; | 3 | namespace Application\Migrations; |
4 | 4 | ||
5 | use Doctrine\DBAL\Migrations\AbstractMigration; | ||
6 | use Doctrine\DBAL\Schema\Schema; | 5 | use Doctrine\DBAL\Schema\Schema; |
7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; | 6 | use Wallabag\CoreBundle\Doctrine\WallabagMigration; |
8 | use 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 | */ |
13 | class Version20180405182455 extends AbstractMigration implements ContainerAwareInterface | 11 | class 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 | |||
3 | declare(strict_types=1); | ||
4 | |||
5 | namespace Application\Migrations; | ||
6 | |||
7 | use Doctrine\DBAL\Schema\Schema; | ||
8 | use Wallabag\CoreBundle\Doctrine\WallabagMigration; | ||
9 | |||
10 | /** | ||
11 | * Force utf8mb4 on craue_config_setting. | ||
12 | */ | ||
13 | final 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: | |||
365 | sensio_framework_extra: | 365 | sensio_framework_extra: |
366 | router: | 366 | router: |
367 | annotations: false | 367 | annotations: false |
368 | |||
369 | craue_config: | ||
370 | entity_name: Wallabag\CoreBundle\Entity\InternalSetting | ||