]> git.immae.eu Git - github/wallabag/wallabag.git/blame - app/DoctrineMigrations/Version20171105202000.php
Fixed migrations with dash into db name
[github/wallabag/wallabag.git] / app / DoctrineMigrations / Version20171105202000.php
CommitLineData
e0ef1a1c
KD
1<?php
2
3namespace Application\Migrations;
4
e0ef1a1c 5use Doctrine\DBAL\Schema\Schema;
bfe7a692 6use Wallabag\CoreBundle\Doctrine\WallabagMigration;
e0ef1a1c
KD
7
8/**
eae8138b 9 * Add origin_url column.
e0ef1a1c 10 */
bfe7a692 11class Version20171105202000 extends WallabagMigration
e0ef1a1c 12{
e0ef1a1c
KD
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('origin_url'), 'It seems that you already played this migration.');
21
22 $entryTable->addColumn('origin_url', '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('origin_url'), 'It seems that you already played this migration.');
35
36 $entryTable->dropColumn('origin_url');
37 }
e0ef1a1c 38}