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
14 * @param Schema $schema
16 public function up(Schema
$schema)
18 $entryTable = $schema->getTable($this->getTable('entry'));
20 $this->skipIf($entryTable->hasColumn('published_at'), 'It seems that you already played this migration.');
22 $entryTable->addColumn('published_at', 'datetime', [
26 $this->skipIf($entryTable->hasColumn('published_by'), 'It seems that you already played this migration.');
28 $entryTable->addColumn('published_by', 'text', [
34 * @param Schema $schema
36 public function down(Schema
$schema)
38 $entryTable = $schema->getTable($this->getTable('entry'));
40 $this->skipIf(!$entryTable->hasColumn('published_at'), 'It seems that you already played this migration.');
42 $entryTable->dropColumn('published_at');
44 $this->skipIf(!$entryTable->hasColumn('published_by'), 'It seems that you already played this migration.');
46 $entryTable->dropColumn('published_by');