]> git.immae.eu Git - github/wallabag/wallabag.git/blob - app/DoctrineMigrations/Version20170511115400.php
Jump to 2.3.6-dev and update release process
[github/wallabag/wallabag.git] / app / DoctrineMigrations / Version20170511115400.php
1 <?php
2
3 namespace Application\Migrations;
4
5 use Doctrine\DBAL\Schema\Schema;
6 use Wallabag\CoreBundle\Doctrine\WallabagMigration;
7
8 /**
9 * Added `headers` field in entry table.
10 */
11 class Version20170511115400 extends WallabagMigration
12 {
13 /**
14 * @param Schema $schema
15 */
16 public function up(Schema $schema)
17 {
18 $entryTable = $schema->getTable($this->getTable('entry'));
19
20 $this->skipIf($entryTable->hasColumn('headers'), 'It seems that you already played this migration.');
21
22 $entryTable->addColumn('headers', 'text', [
23 'notnull' => false,
24 ]);
25 }
26
27 /**
28 * @param Schema $schema
29 */
30 public function down(Schema $schema)
31 {
32 $entryTable = $schema->getTable($this->getTable('entry'));
33
34 $this->skipIf(!$entryTable->hasColumn('headers'), 'It seems that you already played this migration.');
35
36 $entryTable->dropColumn('headers');
37 }
38 }