]> git.immae.eu Git - github/wallabag/wallabag.git/blame - app/DoctrineMigrations/Version20170511115400.php
Merge pull request #4151 from ldidry/fix-4060
[github/wallabag/wallabag.git] / app / DoctrineMigrations / Version20170511115400.php
CommitLineData
dda6a6ad
NL
1<?php
2
3namespace Application\Migrations;
4
dda6a6ad 5use Doctrine\DBAL\Schema\Schema;
bfe7a692 6use Wallabag\CoreBundle\Doctrine\WallabagMigration;
dda6a6ad
NL
7
8/**
9 * Added `headers` field in entry table.
10 */
bfe7a692 11class Version20170511115400 extends WallabagMigration
dda6a6ad 12{
dda6a6ad
NL
13 public function up(Schema $schema)
14 {
15 $entryTable = $schema->getTable($this->getTable('entry'));
16
17 $this->skipIf($entryTable->hasColumn('headers'), 'It seems that you already played this migration.');
18
19 $entryTable->addColumn('headers', 'text', [
20 'notnull' => false,
21 ]);
22 }
23
dda6a6ad
NL
24 public function down(Schema $schema)
25 {
26 $entryTable = $schema->getTable($this->getTable('entry'));
27
28 $this->skipIf(!$entryTable->hasColumn('headers'), 'It seems that you already played this migration.');
29
30 $entryTable->dropColumn('headers');
31 }
32}