diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2017-01-26 13:15:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-26 13:15:06 +0100 |
commit | 463cb376e357d50c5913452fba68a70bf43492c9 (patch) | |
tree | ec6ae907d00b7637c0a3238943e6ffcb78802924 /app/DoctrineMigrations | |
parent | 012b2d453e0cbe1ab478c2868559f919ea805db2 (diff) | |
parent | 5d916d03afaec6fbe32d2a95624628096325744e (diff) | |
download | wallabag-463cb376e357d50c5913452fba68a70bf43492c9.tar.gz wallabag-463cb376e357d50c5913452fba68a70bf43492c9.tar.zst wallabag-463cb376e357d50c5913452fba68a70bf43492c9.zip |
Merge pull request #2646 from wallabag/explain-migrations-in-doc
Added explanations about migrations
Diffstat (limited to 'app/DoctrineMigrations')
-rw-r--r-- | app/DoctrineMigrations/Version20160410190541.php | 3 | ||||
-rw-r--r-- | app/DoctrineMigrations/Version20160812120952.php | 3 | ||||
-rw-r--r-- | app/DoctrineMigrations/Version20160911214952.php | 3 | ||||
-rw-r--r-- | app/DoctrineMigrations/Version20160916201049.php | 3 | ||||
-rw-r--r-- | app/DoctrineMigrations/Version20161001072726.php | 4 | ||||
-rw-r--r-- | app/DoctrineMigrations/Version20161022134138.php | 3 | ||||
-rw-r--r-- | app/DoctrineMigrations/Version20161024212538.php | 19 | ||||
-rw-r--r-- | app/DoctrineMigrations/Version20161031132655.php | 3 | ||||
-rw-r--r-- | app/DoctrineMigrations/Version20161104073720.php | 3 | ||||
-rw-r--r-- | app/DoctrineMigrations/Version20161106113822.php | 8 | ||||
-rw-r--r-- | app/DoctrineMigrations/Version20161117071626.php | 3 | ||||
-rw-r--r-- | app/DoctrineMigrations/Version20161118134328.php | 7 | ||||
-rw-r--r-- | app/DoctrineMigrations/Version20161122203647.php | 7 | ||||
-rw-r--r-- | app/DoctrineMigrations/Version20161128131503.php | 2 |
14 files changed, 63 insertions, 8 deletions
diff --git a/app/DoctrineMigrations/Version20160410190541.php b/app/DoctrineMigrations/Version20160410190541.php index f166a325..ebf4135f 100644 --- a/app/DoctrineMigrations/Version20160410190541.php +++ b/app/DoctrineMigrations/Version20160410190541.php | |||
@@ -7,6 +7,9 @@ use Doctrine\DBAL\Schema\Schema; | |||
7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; | 7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; |
8 | use Symfony\Component\DependencyInjection\ContainerInterface; | 8 | use Symfony\Component\DependencyInjection\ContainerInterface; |
9 | 9 | ||
10 | /** | ||
11 | * Added foreign keys for account resetting | ||
12 | */ | ||
10 | class Version20160410190541 extends AbstractMigration implements ContainerAwareInterface | 13 | class Version20160410190541 extends AbstractMigration implements ContainerAwareInterface |
11 | { | 14 | { |
12 | /** | 15 | /** |
diff --git a/app/DoctrineMigrations/Version20160812120952.php b/app/DoctrineMigrations/Version20160812120952.php index 053b8d88..bd6e8d63 100644 --- a/app/DoctrineMigrations/Version20160812120952.php +++ b/app/DoctrineMigrations/Version20160812120952.php | |||
@@ -7,6 +7,9 @@ use Doctrine\DBAL\Schema\Schema; | |||
7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; | 7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; |
8 | use Symfony\Component\DependencyInjection\ContainerInterface; | 8 | use Symfony\Component\DependencyInjection\ContainerInterface; |
9 | 9 | ||
10 | /** | ||
11 | * Added name field on wallabag_oauth2_clients | ||
12 | */ | ||
10 | class Version20160812120952 extends AbstractMigration implements ContainerAwareInterface | 13 | class Version20160812120952 extends AbstractMigration implements ContainerAwareInterface |
11 | { | 14 | { |
12 | /** | 15 | /** |
diff --git a/app/DoctrineMigrations/Version20160911214952.php b/app/DoctrineMigrations/Version20160911214952.php index 6ddeb767..edef81ed 100644 --- a/app/DoctrineMigrations/Version20160911214952.php +++ b/app/DoctrineMigrations/Version20160911214952.php | |||
@@ -7,6 +7,9 @@ use Doctrine\DBAL\Schema\Schema; | |||
7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; | 7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; |
8 | use Symfony\Component\DependencyInjection\ContainerInterface; | 8 | use Symfony\Component\DependencyInjection\ContainerInterface; |
9 | 9 | ||
10 | /** | ||
11 | * Added settings for RabbitMQ and Redis imports | ||
12 | */ | ||
10 | class Version20160911214952 extends AbstractMigration implements ContainerAwareInterface | 13 | class Version20160911214952 extends AbstractMigration implements ContainerAwareInterface |
11 | { | 14 | { |
12 | /** | 15 | /** |
diff --git a/app/DoctrineMigrations/Version20160916201049.php b/app/DoctrineMigrations/Version20160916201049.php index 8b42bb87..9f8e77e7 100644 --- a/app/DoctrineMigrations/Version20160916201049.php +++ b/app/DoctrineMigrations/Version20160916201049.php | |||
@@ -7,6 +7,9 @@ use Doctrine\DBAL\Schema\Schema; | |||
7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; | 7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; |
8 | use Symfony\Component\DependencyInjection\ContainerInterface; | 8 | use Symfony\Component\DependencyInjection\ContainerInterface; |
9 | 9 | ||
10 | /** | ||
11 | * Added pocket_consumer_key field on wallabag_config | ||
12 | */ | ||
10 | class Version20160916201049 extends AbstractMigration implements ContainerAwareInterface | 13 | class Version20160916201049 extends AbstractMigration implements ContainerAwareInterface |
11 | { | 14 | { |
12 | /** | 15 | /** |
diff --git a/app/DoctrineMigrations/Version20161001072726.php b/app/DoctrineMigrations/Version20161001072726.php index f6930778..f247c236 100644 --- a/app/DoctrineMigrations/Version20161001072726.php +++ b/app/DoctrineMigrations/Version20161001072726.php | |||
@@ -6,7 +6,11 @@ use Doctrine\DBAL\Migrations\AbstractMigration; | |||
6 | use Doctrine\DBAL\Schema\Schema; | 6 | use Doctrine\DBAL\Schema\Schema; |
7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; | 7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; |
8 | use Symfony\Component\DependencyInjection\ContainerInterface; | 8 | use Symfony\Component\DependencyInjection\ContainerInterface; |
9 | use Doctrine\DBAL\Migrations\SkipMigrationException; | ||
9 | 10 | ||
11 | /** | ||
12 | * Added pocket_consumer_key field on wallabag_config | ||
13 | */ | ||
10 | class Version20161001072726 extends AbstractMigration implements ContainerAwareInterface | 14 | class Version20161001072726 extends AbstractMigration implements ContainerAwareInterface |
11 | { | 15 | { |
12 | /** | 16 | /** |
diff --git a/app/DoctrineMigrations/Version20161022134138.php b/app/DoctrineMigrations/Version20161022134138.php index d0e5cb3f..c71166a0 100644 --- a/app/DoctrineMigrations/Version20161022134138.php +++ b/app/DoctrineMigrations/Version20161022134138.php | |||
@@ -7,6 +7,9 @@ use Doctrine\DBAL\Schema\Schema; | |||
7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; | 7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; |
8 | use Symfony\Component\DependencyInjection\ContainerInterface; | 8 | use Symfony\Component\DependencyInjection\ContainerInterface; |
9 | 9 | ||
10 | /** | ||
11 | * Converted database to utf8mb4 encoding (for MySQL only) | ||
12 | */ | ||
10 | class Version20161022134138 extends AbstractMigration implements ContainerAwareInterface | 13 | class Version20161022134138 extends AbstractMigration implements ContainerAwareInterface |
11 | { | 14 | { |
12 | /** | 15 | /** |
diff --git a/app/DoctrineMigrations/Version20161024212538.php b/app/DoctrineMigrations/Version20161024212538.php index 75ff86f1..ecb872d1 100644 --- a/app/DoctrineMigrations/Version20161024212538.php +++ b/app/DoctrineMigrations/Version20161024212538.php | |||
@@ -7,6 +7,9 @@ use Doctrine\DBAL\Schema\Schema; | |||
7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; | 7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; |
8 | use Symfony\Component\DependencyInjection\ContainerInterface; | 8 | use Symfony\Component\DependencyInjection\ContainerInterface; |
9 | 9 | ||
10 | /** | ||
11 | * Added user_id column on oauth2_clients to prevent users to delete API clients from other users | ||
12 | */ | ||
10 | class Version20161024212538 extends AbstractMigration implements ContainerAwareInterface | 13 | class Version20161024212538 extends AbstractMigration implements ContainerAwareInterface |
11 | { | 14 | { |
12 | /** | 15 | /** |
@@ -14,6 +17,8 @@ class Version20161024212538 extends AbstractMigration implements ContainerAwareI | |||
14 | */ | 17 | */ |
15 | private $container; | 18 | private $container; |
16 | 19 | ||
20 | private $constraintName = 'IDX_user_oauth_client'; | ||
21 | |||
17 | public function setContainer(ContainerInterface $container = null) | 22 | public function setContainer(ContainerInterface $container = null) |
18 | { | 23 | { |
19 | $this->container = $container; | 24 | $this->container = $container; |
@@ -33,13 +38,14 @@ class Version20161024212538 extends AbstractMigration implements ContainerAwareI | |||
33 | 38 | ||
34 | $this->skipIf($clientsTable->hasColumn('user_id'), 'It seems that you already played this migration.'); | 39 | $this->skipIf($clientsTable->hasColumn('user_id'), 'It seems that you already played this migration.'); |
35 | 40 | ||
36 | $clientsTable->addColumn('user_id', 'integer'); | 41 | $clientsTable->addColumn('user_id', 'integer', ['notnull' => false]); |
37 | 42 | ||
38 | $clientsTable->addForeignKeyConstraint( | 43 | $clientsTable->addForeignKeyConstraint( |
39 | $this->getTable('user'), | 44 | $this->getTable('user'), |
40 | ['user_id'], | 45 | ['user_id'], |
41 | ['id'], | 46 | ['id'], |
42 | ['onDelete' => 'CASCADE'] | 47 | ['onDelete' => 'CASCADE'], |
48 | $this->constraintName | ||
43 | ); | 49 | ); |
44 | } | 50 | } |
45 | 51 | ||
@@ -48,5 +54,14 @@ class Version20161024212538 extends AbstractMigration implements ContainerAwareI | |||
48 | */ | 54 | */ |
49 | public function down(Schema $schema) | 55 | public function down(Schema $schema) |
50 | { | 56 | { |
57 | $clientsTable = $schema->getTable($this->getTable('oauth2_clients')); | ||
58 | |||
59 | $this->skipIf(!$clientsTable->hasColumn('user_id'), 'It seems that you already played this migration.'); | ||
60 | |||
61 | $clientsTable->dropColumn('user_id', 'integer'); | ||
62 | |||
63 | if ($this->connection->getDatabasePlatform()->getName() != 'sqlite') { | ||
64 | $clientsTable->removeForeignKey($this->constraintName); | ||
65 | } | ||
51 | } | 66 | } |
52 | } | 67 | } |
diff --git a/app/DoctrineMigrations/Version20161031132655.php b/app/DoctrineMigrations/Version20161031132655.php index f81898ff..83b97ca9 100644 --- a/app/DoctrineMigrations/Version20161031132655.php +++ b/app/DoctrineMigrations/Version20161031132655.php | |||
@@ -7,6 +7,9 @@ use Doctrine\DBAL\Schema\Schema; | |||
7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; | 7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; |
8 | use Symfony\Component\DependencyInjection\ContainerInterface; | 8 | use Symfony\Component\DependencyInjection\ContainerInterface; |
9 | 9 | ||
10 | /** | ||
11 | * Added the internal setting to enable/disable downloading pictures | ||
12 | */ | ||
10 | class Version20161031132655 extends AbstractMigration implements ContainerAwareInterface | 13 | class Version20161031132655 extends AbstractMigration implements ContainerAwareInterface |
11 | { | 14 | { |
12 | /** | 15 | /** |
diff --git a/app/DoctrineMigrations/Version20161104073720.php b/app/DoctrineMigrations/Version20161104073720.php index 4721426a..fb8f5fa1 100644 --- a/app/DoctrineMigrations/Version20161104073720.php +++ b/app/DoctrineMigrations/Version20161104073720.php | |||
@@ -7,6 +7,9 @@ use Doctrine\DBAL\Schema\Schema; | |||
7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; | 7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; |
8 | use Symfony\Component\DependencyInjection\ContainerInterface; | 8 | use Symfony\Component\DependencyInjection\ContainerInterface; |
9 | 9 | ||
10 | /** | ||
11 | * Added created_at index on entry table | ||
12 | */ | ||
10 | class Version20161104073720 extends AbstractMigration implements ContainerAwareInterface | 13 | class Version20161104073720 extends AbstractMigration implements ContainerAwareInterface |
11 | { | 14 | { |
12 | /** | 15 | /** |
diff --git a/app/DoctrineMigrations/Version20161106113822.php b/app/DoctrineMigrations/Version20161106113822.php index 55bd87a2..de3702a4 100644 --- a/app/DoctrineMigrations/Version20161106113822.php +++ b/app/DoctrineMigrations/Version20161106113822.php | |||
@@ -7,6 +7,9 @@ use Doctrine\DBAL\Schema\Schema; | |||
7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; | 7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; |
8 | use Symfony\Component\DependencyInjection\ContainerInterface; | 8 | use Symfony\Component\DependencyInjection\ContainerInterface; |
9 | 9 | ||
10 | /** | ||
11 | * Added action_mark_as_read field on config table | ||
12 | */ | ||
10 | class Version20161106113822 extends AbstractMigration implements ContainerAwareInterface | 13 | class Version20161106113822 extends AbstractMigration implements ContainerAwareInterface |
11 | { | 14 | { |
12 | /** | 15 | /** |
@@ -45,6 +48,9 @@ class Version20161106113822 extends AbstractMigration implements ContainerAwareI | |||
45 | public function down(Schema $schema) | 48 | public function down(Schema $schema) |
46 | { | 49 | { |
47 | $configTable = $schema->getTable($this->getTable('config')); | 50 | $configTable = $schema->getTable($this->getTable('config')); |
48 | $userTable->dropColumn('action_mark_as_read'); | 51 | |
52 | $this->skipIf(!$configTable->hasColumn('action_mark_as_read'), 'It seems that you already played this migration.'); | ||
53 | |||
54 | $configTable->dropColumn('action_mark_as_read'); | ||
49 | } | 55 | } |
50 | } | 56 | } |
diff --git a/app/DoctrineMigrations/Version20161117071626.php b/app/DoctrineMigrations/Version20161117071626.php index d864888f..8daa2142 100644 --- a/app/DoctrineMigrations/Version20161117071626.php +++ b/app/DoctrineMigrations/Version20161117071626.php | |||
@@ -7,6 +7,9 @@ use Doctrine\DBAL\Schema\Schema; | |||
7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; | 7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; |
8 | use Symfony\Component\DependencyInjection\ContainerInterface; | 8 | use Symfony\Component\DependencyInjection\ContainerInterface; |
9 | 9 | ||
10 | /** | ||
11 | * Added the internal setting to share articles to unmark.it | ||
12 | */ | ||
10 | class Version20161117071626 extends AbstractMigration implements ContainerAwareInterface | 13 | class Version20161117071626 extends AbstractMigration implements ContainerAwareInterface |
11 | { | 14 | { |
12 | /** | 15 | /** |
diff --git a/app/DoctrineMigrations/Version20161118134328.php b/app/DoctrineMigrations/Version20161118134328.php index f168cb53..7b2eeb7b 100644 --- a/app/DoctrineMigrations/Version20161118134328.php +++ b/app/DoctrineMigrations/Version20161118134328.php | |||
@@ -47,7 +47,10 @@ class Version20161118134328 extends AbstractMigration implements ContainerAwareI | |||
47 | */ | 47 | */ |
48 | public function down(Schema $schema) | 48 | public function down(Schema $schema) |
49 | { | 49 | { |
50 | $userTable = $schema->getTable($this->getTable('entry')); | 50 | $entryTable = $schema->getTable($this->getTable('entry')); |
51 | $userTable->dropColumn('http_status'); | 51 | |
52 | $this->skipIf(!$entryTable->hasColumn('http_status'), 'It seems that you already played this migration.'); | ||
53 | |||
54 | $entryTable->dropColumn('http_status'); | ||
52 | } | 55 | } |
53 | } | 56 | } |
diff --git a/app/DoctrineMigrations/Version20161122203647.php b/app/DoctrineMigrations/Version20161122203647.php index 94197193..9b17d6ef 100644 --- a/app/DoctrineMigrations/Version20161122203647.php +++ b/app/DoctrineMigrations/Version20161122203647.php | |||
@@ -54,7 +54,10 @@ class Version20161122203647 extends AbstractMigration implements ContainerAwareI | |||
54 | public function down(Schema $schema) | 54 | public function down(Schema $schema) |
55 | { | 55 | { |
56 | $userTable = $schema->getTable($this->getTable('user')); | 56 | $userTable = $schema->getTable($this->getTable('user')); |
57 | $userTable->addColumn('expired', 'smallint'); | 57 | |
58 | $userTable->addColumn('credentials_expired', 'smallint'); | 58 | $this->skipIf(true === $userTable->hasColumn('expired') || true === $userTable->hasColumn('credentials_expired'), 'It seems that you already played this migration.'); |
59 | |||
60 | $userTable->addColumn('expired', 'smallint', ['notnull' => false]); | ||
61 | $userTable->addColumn('credentials_expired', 'smallint', ['notnull' => false]); | ||
59 | } | 62 | } |
60 | } | 63 | } |
diff --git a/app/DoctrineMigrations/Version20161128131503.php b/app/DoctrineMigrations/Version20161128131503.php index f0e016c8..b71aa38b 100644 --- a/app/DoctrineMigrations/Version20161128131503.php +++ b/app/DoctrineMigrations/Version20161128131503.php | |||
@@ -55,7 +55,7 @@ class Version20161128131503 extends AbstractMigration implements ContainerAwareI | |||
55 | 55 | ||
56 | foreach ($this->fields as $field => $type) { | 56 | foreach ($this->fields as $field => $type) { |
57 | $this->skipIf($userTable->hasColumn($field), 'It seems that you already played this migration.'); | 57 | $this->skipIf($userTable->hasColumn($field), 'It seems that you already played this migration.'); |
58 | $userTable->addColumn($field, $type); | 58 | $userTable->addColumn($field, $type, ['notnull' => false]); |
59 | } | 59 | } |
60 | } | 60 | } |
61 | } | 61 | } |