diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-11-25 17:43:28 +0100 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-11-28 14:28:35 +0100 |
commit | 18d7bc3a353d8737c64a0f9e1c9fdcb7a756c3e5 (patch) | |
tree | 0127c73f45fc5341e42882a421fbd01417a0f721 /app/DoctrineMigrations/Version20161118134328.php | |
parent | 986cb536457e921dacf7ab5c7bc16ad4b2108781 (diff) | |
download | wallabag-18d7bc3a353d8737c64a0f9e1c9fdcb7a756c3e5.tar.gz wallabag-18d7bc3a353d8737c64a0f9e1c9fdcb7a756c3e5.tar.zst wallabag-18d7bc3a353d8737c64a0f9e1c9fdcb7a756c3e5.zip |
Added checks on migrations
Diffstat (limited to 'app/DoctrineMigrations/Version20161118134328.php')
-rw-r--r-- | app/DoctrineMigrations/Version20161118134328.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/DoctrineMigrations/Version20161118134328.php b/app/DoctrineMigrations/Version20161118134328.php index 390e89ce..76dd9074 100644 --- a/app/DoctrineMigrations/Version20161118134328.php +++ b/app/DoctrineMigrations/Version20161118134328.php | |||
@@ -8,7 +8,7 @@ use Symfony\Component\DependencyInjection\ContainerAwareInterface; | |||
8 | use Symfony\Component\DependencyInjection\ContainerInterface; | 8 | use Symfony\Component\DependencyInjection\ContainerInterface; |
9 | 9 | ||
10 | /** | 10 | /** |
11 | * Add http_status in `entry_table` | 11 | * Add http_status in `entry_table`. |
12 | */ | 12 | */ |
13 | class Version20161118134328 extends AbstractMigration implements ContainerAwareInterface | 13 | class Version20161118134328 extends AbstractMigration implements ContainerAwareInterface |
14 | { | 14 | { |
@@ -24,7 +24,7 @@ class Version20161118134328 extends AbstractMigration implements ContainerAwareI | |||
24 | 24 | ||
25 | private function getTable($tableName) | 25 | private function getTable($tableName) |
26 | { | 26 | { |
27 | return $this->container->getParameter('database_table_prefix') . $tableName; | 27 | return $this->container->getParameter('database_table_prefix').$tableName; |
28 | } | 28 | } |
29 | 29 | ||
30 | /** | 30 | /** |
@@ -32,6 +32,8 @@ class Version20161118134328 extends AbstractMigration implements ContainerAwareI | |||
32 | */ | 32 | */ |
33 | public function up(Schema $schema) | 33 | public function up(Schema $schema) |
34 | { | 34 | { |
35 | $this->skipIf($schema->getTable($this->getTable('entry'))->hasColumn('http_status'), 'It seems that you already played this migration.'); | ||
36 | |||
35 | $this->addSql('ALTER TABLE '.$this->getTable('entry').' ADD http_status VARCHAR(3) DEFAULT NULL'); | 37 | $this->addSql('ALTER TABLE '.$this->getTable('entry').' ADD http_status VARCHAR(3) DEFAULT NULL'); |
36 | } | 38 | } |
37 | 39 | ||