3 namespace Application\Migrations
;
5 use Doctrine\DBAL\Schema\Schema
;
6 use Wallabag\CoreBundle\Doctrine\WallabagMigration
;
9 * Removed locked, credentials_expire_at and expires_at.
11 class Version20161128131503
extends WallabagMigration
14 'locked' => 'smallint',
15 'credentials_expire_at' => 'datetime',
16 'expires_at' => 'datetime',
20 * @param Schema $schema
22 public function up(Schema
$schema)
24 $userTable = $schema->getTable($this->getTable('user'));
26 foreach ($this->fields
as $field => $type) {
27 $this->skipIf(!$userTable->hasColumn($field), 'It seems that you already played this migration.');
28 $userTable->dropColumn($field);
33 * @param Schema $schema
35 public function down(Schema
$schema)
37 $userTable = $schema->getTable($this->getTable('user'));
39 foreach ($this->fields
as $field => $type) {
40 $this->skipIf($userTable->hasColumn($field), 'It seems that you already played this migration.');
41 $userTable->addColumn($field, $type, ['notnull' => false]);