<?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 Version20220503160314 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 banque DROP FOREIGN KEY FK_B1F6CB3CC0B0E75A');
$this->addSql('ALTER TABLE banque ADD CONSTRAINT FK_B1F6CB3CC0B0E75A FOREIGN KEY (identreprise) REFERENCES entreprise (id)');
$this->addSql('ALTER TABLE client DROP FOREIGN KEY FK_C7440455DD34B831');
$this->addSql('ALTER TABLE client CHANGE identreprise_id identreprise_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE client ADD CONSTRAINT FK_C7440455DD34B831 FOREIGN KEY (identreprise_id) REFERENCES entreprise (id)');
$this->addSql('ALTER TABLE entreprise CHANGE id_user_id id_user_id INT DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE banque DROP FOREIGN KEY FK_B1F6CB3CC0B0E75A');
$this->addSql('ALTER TABLE banque ADD CONSTRAINT FK_B1F6CB3CC0B0E75A FOREIGN KEY (identreprise) REFERENCES entreprise (id) ON UPDATE NO ACTION ON DELETE CASCADE');
$this->addSql('ALTER TABLE client DROP FOREIGN KEY FK_C7440455DD34B831');
$this->addSql('ALTER TABLE client CHANGE identreprise_id identreprise_id INT NOT NULL');
$this->addSql('ALTER TABLE client ADD CONSTRAINT FK_C7440455DD34B831 FOREIGN KEY (identreprise_id) REFERENCES entreprise (id) ON UPDATE NO ACTION ON DELETE CASCADE');
$this->addSql('ALTER TABLE entreprise CHANGE id_user_id id_user_id INT NOT NULL');
}
}