3 namespace Application\Migrations
;
5 use Doctrine\DBAL\Schema\Schema
;
6 use Wallabag\CoreBundle\Doctrine\WallabagMigration
;
9 * Methods and properties removed from `FOS\UserBundle\Model\User`.
12 * - `$credentialsExpired`
13 * - `setExpired()` (use `setExpiresAt(\DateTime::now()` instead)
14 * - `setCredentialsExpired()` (use `setCredentialsExpireAt(\DateTime::now()` instead)
16 * You need to drop the fields `expired` and `credentials_expired` from your database
17 * schema, because they aren't mapped anymore.
19 class Version20161122203647
extends WallabagMigration
22 * @param Schema $schema
24 public function up(Schema
$schema)
26 $userTable = $schema->getTable($this->getTable('user'));
28 $this->skipIf(false === $userTable->hasColumn('expired') || false === $userTable->hasColumn('credentials_expired'), 'It seems that you already played this migration.');
30 $userTable->dropColumn('expired');
31 $userTable->dropColumn('credentials_expired');
35 * @param Schema $schema
37 public function down(Schema
$schema)
39 $userTable = $schema->getTable($this->getTable('user'));
41 $this->skipIf(true === $userTable->hasColumn('expired') || true === $userTable->hasColumn('credentials_expired'), 'It seems that you already played this migration.');
43 $userTable->addColumn('expired', 'smallint', ['notnull' => false]);
44 $userTable->addColumn('credentials_expired', 'smallint', ['notnull' => false]);