aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/DoctrineMigrations/Version20161122203647.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2016-11-25 17:43:28 +0100
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2016-11-28 14:28:35 +0100
commit18d7bc3a353d8737c64a0f9e1c9fdcb7a756c3e5 (patch)
tree0127c73f45fc5341e42882a421fbd01417a0f721 /app/DoctrineMigrations/Version20161122203647.php
parent986cb536457e921dacf7ab5c7bc16ad4b2108781 (diff)
downloadwallabag-18d7bc3a353d8737c64a0f9e1c9fdcb7a756c3e5.tar.gz
wallabag-18d7bc3a353d8737c64a0f9e1c9fdcb7a756c3e5.tar.zst
wallabag-18d7bc3a353d8737c64a0f9e1c9fdcb7a756c3e5.zip
Added checks on migrations
Diffstat (limited to 'app/DoctrineMigrations/Version20161122203647.php')
-rw-r--r--app/DoctrineMigrations/Version20161122203647.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/DoctrineMigrations/Version20161122203647.php b/app/DoctrineMigrations/Version20161122203647.php
index ea2703b6..2cb990e1 100644
--- a/app/DoctrineMigrations/Version20161122203647.php
+++ b/app/DoctrineMigrations/Version20161122203647.php
@@ -8,7 +8,7 @@ use Symfony\Component\DependencyInjection\ContainerAwareInterface;
8use Symfony\Component\DependencyInjection\ContainerInterface; 8use Symfony\Component\DependencyInjection\ContainerInterface;
9 9
10/** 10/**
11 * Methods and properties removed from `FOS\UserBundle\Model\User` 11 * Methods and properties removed from `FOS\UserBundle\Model\User`.
12 * 12 *
13 * - `$expired` 13 * - `$expired`
14 * - `$credentialsExpired` 14 * - `$credentialsExpired`
@@ -32,7 +32,7 @@ class Version20161122203647 extends AbstractMigration implements ContainerAwareI
32 32
33 private function getTable($tableName) 33 private function getTable($tableName)
34 { 34 {
35 return $this->container->getParameter('database_table_prefix') . $tableName; 35 return $this->container->getParameter('database_table_prefix').$tableName;
36 } 36 }
37 37
38 /** 38 /**
@@ -42,7 +42,12 @@ class Version20161122203647 extends AbstractMigration implements ContainerAwareI
42 { 42 {
43 $this->abortIf($this->connection->getDatabasePlatform()->getName() === 'sqlite', 'This up migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); 43 $this->abortIf($this->connection->getDatabasePlatform()->getName() === 'sqlite', 'This up migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.');
44 44
45 $this->skipIf(false === $schema->getTable($this->getTable('user'))->hasColumn('expired'), 'It seems that you already played this migration.');
46
45 $this->addSql('ALTER TABLE '.$this->getTable('user').' DROP expired'); 47 $this->addSql('ALTER TABLE '.$this->getTable('user').' DROP expired');
48
49 $this->skipIf(false === $schema->getTable($this->getTable('user'))->hasColumn('credentials_expired'), 'It seems that you already played this migration.');
50
46 $this->addSql('ALTER TABLE '.$this->getTable('user').' DROP credentials_expired'); 51 $this->addSql('ALTER TABLE '.$this->getTable('user').' DROP credentials_expired');
47 } 52 }
48 53