<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20220523152832 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->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE assurance ADD lang_id INT DEFAULT NULL, ADD assurance VARCHAR(255) NOT NULL, ADD formule VARCHAR(255) NOT NULL, ADD code_traduction VARCHAR(255) NOT NULL, ADD url_garanties VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE assurance ADD CONSTRAINT FK_386829AEB213FA4 FOREIGN KEY (lang_id) REFERENCES language (id)');
$this->addSql('CREATE INDEX IDX_386829AEB213FA4 ON assurance (lang_id)');
$this->addSql('UPDATE `compte` SET `roles` = \'a:1:{i:0;s:13:\"ROLE_CUSTOMER\";}\'');
}
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 assurance DROP FOREIGN KEY FK_386829AEB213FA4');
$this->addSql('DROP INDEX IDX_386829AEB213FA4 ON assurance');
$this->addSql('ALTER TABLE assurance DROP lang_id, DROP code_traduction, DROP assurance, DROP formule, DROP url_garanties');
$this->addSql('UPDATE `compte` SET `roles` = \'a:1:{i:0;s:9:\"ROLE_USER\";}\'');
}
}