]> git.immae.eu Git - github/wallabag/wallabag.git/blame - app/DoctrineMigrations/Version20170511115400.php
Fixed migrations with dash into db name
[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 /**
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}