]> git.immae.eu Git - github/wallabag/wallabag.git/blob - app/DoctrineMigrations/Version20170407200919.php
Update deps
[github/wallabag/wallabag.git] / app / DoctrineMigrations / Version20170407200919.php
1 <?php
2
3 namespace Application\Migrations;
4
5 use Doctrine\DBAL\Schema\Schema;
6 use Wallabag\CoreBundle\Doctrine\WallabagMigration;
7
8 /**
9 * Remove isPublic in Entry Table.
10 */
11 class Version20170407200919 extends WallabagMigration
12 {
13 public function up(Schema $schema)
14 {
15 $entryTable = $schema->getTable($this->getTable('entry'));
16 $this->skipIf(!$entryTable->hasColumn('is_public'), 'It seems that you already played this migration.');
17
18 $entryTable->dropColumn('is_public');
19 }
20
21 public function down(Schema $schema)
22 {
23 $entryTable = $schema->getTable($this->getTable('entry'));
24 $this->skipIf($entryTable->hasColumn('is_public'), 'It seems that you already played this migration.');
25
26 $entryTable->addColumn('is_public', 'boolean', ['notnull' => false, 'default' => 0]);
27 }
28 }