<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Migration: fix User table after symfony5.4 upgrade, now using nucleos user bundle instead of FOS
*/
class Version20220606060606 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE user DROP `locked`, DROP `expired`, DROP `credentials_expired`');
$this->addSql('ALTER TABLE user ADD `locale` VARCHAR(255) DEFAULT NULL, ADD `timezone` VARCHAR(255) DEFAULT NULL;');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE user ADD `locked` TINYINT(1) NOT NULL, ADD `expired` TINYINT(1) NOT NULL, ADD `credentials_expired` TINYINT(1) NOT NULL;');
$this->addSql('ALTER TABLE user DROP `locale`, DROP `timezone`;');
}
}