migrations/Version20230718125337.php line 1
<?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 Version20230718125337 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('CREATE TABLE serveur (id INT AUTO_INCREMENT NOT NULL, hebergeur VARCHAR(255) DEFAULT NULL, ip VARCHAR(255) DEFAULT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE client_nom_de_domaine DROP FOREIGN KEY FK_643BFEB7B72FEAC7');
$this->addSql('ALTER TABLE client_nom_de_domaine DROP FOREIGN KEY FK_643BFEB719EB6921');
$this->addSql('DROP TABLE client_nom_de_domaine');
$this->addSql('ALTER TABLE file DROP FOREIGN KEY FK_8C9F3610537A1329');
$this->addSql('ALTER TABLE file DROP FOREIGN KEY FK_8C9F3610700047D2');
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F3610537A1329 FOREIGN KEY (message_id) REFERENCES message (id)');
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F3610700047D2 FOREIGN KEY (ticket_id) REFERENCES ticket (id)');
$this->addSql('ALTER TABLE history CHANGE changes changes LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE message DROP FOREIGN KEY FK_B6BD307F700047D2');
$this->addSql('ALTER TABLE message ADD CONSTRAINT FK_B6BD307F700047D2 FOREIGN KEY (ticket_id) REFERENCES ticket (id)');
$this->addSql('ALTER TABLE regie_update DROP FOREIGN KEY FK_35AD68D271F7E88B');
$this->addSql('ALTER TABLE regie_update DROP FOREIGN KEY FK_35AD68D246F21B0B');
$this->addSql('ALTER TABLE regie_update DROP FOREIGN KEY FK_35AD68D2700047D2');
$this->addSql('ALTER TABLE regie_update ADD CONSTRAINT FK_35AD68D271F7E88B FOREIGN KEY (event_id) REFERENCES event (id)');
$this->addSql('ALTER TABLE regie_update ADD CONSTRAINT FK_35AD68D246F21B0B FOREIGN KEY (regie_id) REFERENCES regie (id)');
$this->addSql('ALTER TABLE regie_update ADD CONSTRAINT FK_35AD68D2700047D2 FOREIGN KEY (ticket_id) REFERENCES ticket (id)');
$this->addSql('ALTER TABLE site CHANGE messagerie messagerie LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE ticket DROP FOREIGN KEY FK_97A0ADA31823061F');
$this->addSql('ALTER TABLE ticket CHANGE projet_id projet_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE ticket ADD CONSTRAINT FK_97A0ADA31823061F FOREIGN KEY (contrat_id) REFERENCES type_intervention (id)');
$this->addSql('ALTER TABLE user CHANGE roles roles LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\', CHANGE enabled enabled TINYINT(1) DEFAULT 1 NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE client_nom_de_domaine (client_id INT NOT NULL, nom_de_domaine_id INT NOT NULL, INDEX IDX_643BFEB719EB6921 (client_id), INDEX IDX_643BFEB7B72FEAC7 (nom_de_domaine_id), PRIMARY KEY(client_id, nom_de_domaine_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE client_nom_de_domaine ADD CONSTRAINT FK_643BFEB7B72FEAC7 FOREIGN KEY (nom_de_domaine_id) REFERENCES nom_de_domaine (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE client_nom_de_domaine ADD CONSTRAINT FK_643BFEB719EB6921 FOREIGN KEY (client_id) REFERENCES client (id) ON DELETE CASCADE');
$this->addSql('DROP TABLE serveur');
$this->addSql('ALTER TABLE regie_update DROP FOREIGN KEY FK_35AD68D2700047D2');
$this->addSql('ALTER TABLE regie_update DROP FOREIGN KEY FK_35AD68D271F7E88B');
$this->addSql('ALTER TABLE regie_update DROP FOREIGN KEY FK_35AD68D246F21B0B');
$this->addSql('ALTER TABLE regie_update ADD CONSTRAINT FK_35AD68D2700047D2 FOREIGN KEY (ticket_id) REFERENCES ticket (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE regie_update ADD CONSTRAINT FK_35AD68D271F7E88B FOREIGN KEY (event_id) REFERENCES event (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE regie_update ADD CONSTRAINT FK_35AD68D246F21B0B FOREIGN KEY (regie_id) REFERENCES regie (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE user CHANGE roles roles LONGTEXT NOT NULL COLLATE `utf8mb4_bin`, CHANGE enabled enabled TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE ticket DROP FOREIGN KEY FK_97A0ADA31823061F');
$this->addSql('ALTER TABLE ticket CHANGE projet_id projet_id INT NOT NULL');
$this->addSql('ALTER TABLE ticket ADD CONSTRAINT FK_97A0ADA31823061F FOREIGN KEY (contrat_id) REFERENCES type_intervention (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE site CHANGE messagerie messagerie LONGTEXT NOT NULL COLLATE `utf8mb4_bin`');
$this->addSql('ALTER TABLE file DROP FOREIGN KEY FK_8C9F3610700047D2');
$this->addSql('ALTER TABLE file DROP FOREIGN KEY FK_8C9F3610537A1329');
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F3610700047D2 FOREIGN KEY (ticket_id) REFERENCES ticket (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F3610537A1329 FOREIGN KEY (message_id) REFERENCES message (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE history CHANGE changes changes LONGTEXT NOT NULL COLLATE `utf8mb4_bin`');
$this->addSql('ALTER TABLE message DROP FOREIGN KEY FK_B6BD307F700047D2');
$this->addSql('ALTER TABLE message ADD CONSTRAINT FK_B6BD307F700047D2 FOREIGN KEY (ticket_id) REFERENCES ticket (id) ON DELETE CASCADE');
}
}