<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20220701094134 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE user ADD creation_date DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, ADD update_date DATETIME DEFAULT NULL, CHANGE civility_code civility_code VARCHAR(100) DEFAULT NULL, CHANGE roles roles LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D6499F38C70E FOREIGN KEY (civility_code) REFERENCES parameter_value (code)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D649E7927C74 ON user (email)');
$this->addSql('CREATE INDEX IDX_8D93D6499F38C70E ON user (civility_code)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D6499F38C70E');
$this->addSql('DROP INDEX UNIQ_8D93D649E7927C74 ON user');
$this->addSql('DROP INDEX IDX_8D93D6499F38C70E ON user');
$this->addSql('ALTER TABLE user DROP creation_date, DROP update_date, CHANGE civility_code civility_code VARCHAR(100) NOT NULL, CHANGE roles roles VARCHAR(100) NOT NULL');
}
}