- $this->addSql('ALTER TABLE '.$this->getTable('user').' ADD expired tinyint(1) NULL DEFAULT 0');
- $this->addSql('ALTER TABLE '.$this->getTable('user').' ADD credentials_expired tinyint(1) NULL DEFAULT 0');
+ $userTable = $schema->getTable($this->getTable('user'));
+
+ $this->skipIf(true === $userTable->hasColumn('expired') || true === $userTable->hasColumn('credentials_expired'), 'It seems that you already played this migration.');
+
+ $userTable->addColumn('expired', 'smallint', ['notnull' => false]);
+ $userTable->addColumn('credentials_expired', 'smallint', ['notnull' => false]);