3 namespace Application\Migrations
;
5 use Doctrine\DBAL\Schema\Schema
;
6 use Wallabag\CoreBundle\Doctrine\WallabagMigration
;
9 * Add published_at and published_by in `entry` table.
11 class Version20170405182620
extends WallabagMigration
13 public function up(Schema
$schema)
15 $entryTable = $schema->getTable($this->getTable('entry'));
17 $this->skipIf($entryTable->hasColumn('published_at'), 'It seems that you already played this migration.');
19 $entryTable->addColumn('published_at', 'datetime', [
23 $this->skipIf($entryTable->hasColumn('published_by'), 'It seems that you already played this migration.');
25 $entryTable->addColumn('published_by', 'text', [
30 public function down(Schema
$schema)
32 $entryTable = $schema->getTable($this->getTable('entry'));
34 $this->skipIf(!$entryTable->hasColumn('published_at'), 'It seems that you already played this migration.');
36 $entryTable->dropColumn('published_at');
38 $this->skipIf(!$entryTable->hasColumn('published_by'), 'It seems that you already played this migration.');
40 $entryTable->dropColumn('published_by');