]>
Commit | Line | Data |
---|---|---|
a42f38d9 NL |
1 | <?php |
2 | ||
3 | namespace Application\Migrations; | |
4 | ||
a42f38d9 | 5 | use Doctrine\DBAL\Schema\Schema; |
bfe7a692 | 6 | use Wallabag\CoreBundle\Doctrine\WallabagMigration; |
a42f38d9 | 7 | |
b87f1712 | 8 | /** |
01736b5a | 9 | * Added action_mark_as_read field on config table. |
b87f1712 | 10 | */ |
bfe7a692 | 11 | class Version20161106113822 extends WallabagMigration |
a42f38d9 | 12 | { |
a42f38d9 NL |
13 | /** |
14 | * @param Schema $schema | |
15 | */ | |
16 | public function up(Schema $schema) | |
17 | { | |
84c6a48d | 18 | $configTable = $schema->getTable($this->getTable('config')); |
18d7bc3a | 19 | |
84c6a48d NL |
20 | $this->skipIf($configTable->hasColumn('action_mark_as_read'), 'It seems that you already played this migration.'); |
21 | ||
22 | $configTable->addColumn('action_mark_as_read', 'integer', [ | |
23 | 'default' => 0, | |
3ef75cc4 | 24 | 'notnull' => false, |
84c6a48d | 25 | ]); |
a42f38d9 NL |
26 | } |
27 | ||
28 | /** | |
29 | * @param Schema $schema | |
30 | */ | |
31 | public function down(Schema $schema) | |
32 | { | |
84c6a48d | 33 | $configTable = $schema->getTable($this->getTable('config')); |
4acbeb93 NL |
34 | |
35 | $this->skipIf(!$configTable->hasColumn('action_mark_as_read'), 'It seems that you already played this migration.'); | |
36 | ||
37 | $configTable->dropColumn('action_mark_as_read'); | |
a42f38d9 NL |
38 | } |
39 | } |