diff options
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 | ||