]>
Commit | Line | Data |
---|---|---|
1 | <?php | |
2 | ||
3 | namespace Application\Migrations; | |
4 | ||
5 | use Doctrine\DBAL\Schema\Schema; | |
6 | use Wallabag\CoreBundle\Doctrine\WallabagMigration; | |
7 | ||
8 | /** | |
9 | * Added list_mode in user config. | |
10 | */ | |
11 | class Version20161128084725 extends WallabagMigration | |
12 | { | |
13 | /** | |
14 | * @param Schema $schema | |
15 | */ | |
16 | public function up(Schema $schema) | |
17 | { | |
18 | $configTable = $schema->getTable($this->getTable('config')); | |
19 | $this->skipIf($configTable->hasColumn('list_mode'), 'It seems that you already played this migration.'); | |
20 | ||
21 | $configTable->addColumn('list_mode', 'integer', ['notnull' => false]); | |
22 | } | |
23 | ||
24 | /** | |
25 | * @param Schema $schema | |
26 | */ | |
27 | public function down(Schema $schema) | |
28 | { | |
29 | $configTable = $schema->getTable($this->getTable('config')); | |
30 | $configTable->dropColumn('list_mode'); | |
31 | } | |
32 | } |