]>
Commit | Line | Data |
---|---|---|
15e4aea6 M |
1 | <?php |
2 | ||
3 | namespace Application\Migrations; | |
4 | ||
15e4aea6 | 5 | use Doctrine\DBAL\Schema\Schema; |
bfe7a692 | 6 | use Wallabag\CoreBundle\Doctrine\WallabagMigration; |
15e4aea6 M |
7 | |
8 | /** | |
01736b5a | 9 | * Remove isPublic in Entry Table. |
15e4aea6 | 10 | */ |
bfe7a692 | 11 | class Version20170407200919 extends WallabagMigration |
15e4aea6 | 12 | { |
15e4aea6 M |
13 | /** |
14 | * @param Schema $schema | |
15 | */ | |
16 | public function up(Schema $schema) | |
17 | { | |
18 | $entryTable = $schema->getTable($this->getTable('entry')); | |
19 | $this->skipIf(!$entryTable->hasColumn('is_public'), 'It seems that you already played this migration.'); | |
20 | ||
21 | $entryTable->dropColumn('is_public'); | |
22 | } | |
23 | ||
24 | /** | |
25 | * @param Schema $schema | |
26 | */ | |
27 | public function down(Schema $schema) | |
28 | { | |
29 | $entryTable = $schema->getTable($this->getTable('entry')); | |
30 | $this->skipIf($entryTable->hasColumn('is_public'), 'It seems that you already played this migration.'); | |
31 | ||
32 | $entryTable->addColumn('is_public', 'boolean', ['notnull' => false, 'default' => 0]); | |
33 | } | |
34 | } |