diff options
Diffstat (limited to 'app/DoctrineMigrations/Version20161122203647.php')
-rw-r--r-- | app/DoctrineMigrations/Version20161122203647.php | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/app/DoctrineMigrations/Version20161122203647.php b/app/DoctrineMigrations/Version20161122203647.php index 354a10e8..9c1557eb 100644 --- a/app/DoctrineMigrations/Version20161122203647.php +++ b/app/DoctrineMigrations/Version20161122203647.php | |||
@@ -40,15 +40,15 @@ class Version20161122203647 extends AbstractMigration implements ContainerAwareI | |||
40 | */ | 40 | */ |
41 | public function up(Schema $schema) | 41 | public function up(Schema $schema) |
42 | { | 42 | { |
43 | $this->skipIf($this->connection->getDatabasePlatform()->getName() === 'sqlite', 'This up migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); | 43 | $userTable = $schema->getTable($this->getTable('user')); |
44 | 44 | ||
45 | $this->skipIf(false === $schema->getTable($this->getTable('user'))->hasColumn('expired'), 'It seems that you already played this migration.'); | 45 | $this->skipIf(false === $userTable->hasColumn('expired'), 'It seems that you already played this migration.'); |
46 | 46 | ||
47 | $this->addSql('ALTER TABLE '.$this->getTable('user').' DROP expired'); | 47 | $userTable->dropColumn('expired'); |
48 | 48 | ||
49 | $this->skipIf(false === $schema->getTable($this->getTable('user'))->hasColumn('credentials_expired'), 'It seems that you already played this migration.'); | 49 | $this->skipIf(false === $userTable->hasColumn('credentials_expired'), 'It seems that you already played this migration.'); |
50 | 50 | ||
51 | $this->addSql('ALTER TABLE '.$this->getTable('user').' DROP credentials_expired'); | 51 | $userTable->dropColumn('credentials_expired'); |
52 | } | 52 | } |
53 | 53 | ||
54 | /** | 54 | /** |
@@ -56,7 +56,8 @@ class Version20161122203647 extends AbstractMigration implements ContainerAwareI | |||
56 | */ | 56 | */ |
57 | public function down(Schema $schema) | 57 | public function down(Schema $schema) |
58 | { | 58 | { |
59 | $this->addSql('ALTER TABLE '.$this->getTable('user').' ADD expired tinyint(1) NULL DEFAULT 0'); | 59 | $userTable = $schema->getTable($this->getTable('user')); |
60 | $this->addSql('ALTER TABLE '.$this->getTable('user').' ADD credentials_expired tinyint(1) NULL DEFAULT 0'); | 60 | $userTable->addColumn('expired', 'smallint'); |
61 | $userTable->addColumn('credentials_expired', 'smallint'); | ||
61 | } | 62 | } |
62 | } | 63 | } |