]>
Commit | Line | Data |
---|---|---|
10b35097 NL |
1 | <?php |
2 | ||
3 | namespace Application\Migrations; | |
4 | ||
10b35097 | 5 | use Doctrine\DBAL\Schema\Schema; |
bfe7a692 | 6 | use Wallabag\CoreBundle\Doctrine\WallabagMigration; |
10b35097 NL |
7 | |
8 | /** | |
18d7bc3a | 9 | * Add http_status in `entry_table`. |
10b35097 | 10 | */ |
bfe7a692 | 11 | class Version20161118134328 extends WallabagMigration |
10b35097 | 12 | { |
10b35097 NL |
13 | public function up(Schema $schema) |
14 | { | |
84c6a48d | 15 | $entryTable = $schema->getTable($this->getTable('entry')); |
18d7bc3a | 16 | |
84c6a48d NL |
17 | $this->skipIf($entryTable->hasColumn('http_status'), 'It seems that you already played this migration.'); |
18 | ||
19 | $entryTable->addColumn('http_status', 'string', [ | |
20 | 'length' => 3, | |
21 | 'notnull' => false, | |
22 | ]); | |
10b35097 NL |
23 | } |
24 | ||
10b35097 NL |
25 | public function down(Schema $schema) |
26 | { | |
4acbeb93 NL |
27 | $entryTable = $schema->getTable($this->getTable('entry')); |
28 | ||
29 | $this->skipIf(!$entryTable->hasColumn('http_status'), 'It seems that you already played this migration.'); | |
30 | ||
31 | $entryTable->dropColumn('http_status'); | |
10b35097 NL |
32 | } |
33 | } |