]> git.immae.eu Git - github/wallabag/wallabag.git/blame - app/DoctrineMigrations/Version20161118134328.php
Fixed migrations with dash into db name
[github/wallabag/wallabag.git] / app / DoctrineMigrations / Version20161118134328.php
CommitLineData
10b35097
NL
1<?php
2
3namespace Application\Migrations;
4
10b35097 5use Doctrine\DBAL\Schema\Schema;
bfe7a692 6use Wallabag\CoreBundle\Doctrine\WallabagMigration;
10b35097
NL
7
8/**
18d7bc3a 9 * Add http_status in `entry_table`.
10b35097 10 */
bfe7a692 11class Version20161118134328 extends WallabagMigration
10b35097 12{
10b35097
NL
13 /**
14 * @param Schema $schema
15 */
16 public function up(Schema $schema)
17 {
84c6a48d 18 $entryTable = $schema->getTable($this->getTable('entry'));
18d7bc3a 19
84c6a48d
NL
20 $this->skipIf($entryTable->hasColumn('http_status'), 'It seems that you already played this migration.');
21
22 $entryTable->addColumn('http_status', 'string', [
23 'length' => 3,
24 'notnull' => false,
25 ]);
10b35097
NL
26 }
27
28 /**
29 * @param Schema $schema
30 */
31 public function down(Schema $schema)
32 {
4acbeb93
NL
33 $entryTable = $schema->getTable($this->getTable('entry'));
34
35 $this->skipIf(!$entryTable->hasColumn('http_status'), 'It seems that you already played this migration.');
36
37 $entryTable->dropColumn('http_status');
10b35097
NL
38 }
39}