nineskeletor/migrations/Version20230111095833.php

65 lines
3.9 KiB
PHP
Raw Normal View History

2023-01-12 16:14:31 +01:00
<?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 Version20230111095833 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 alertniveau01 DROP CONSTRAINT fk_87e7389c17fd46c1');
$this->addSql('ALTER TABLE alertniveau01 DROP CONSTRAINT fk_87e7389c6dfc7e23');
$this->addSql('ALTER TABLE itemniveau01 DROP CONSTRAINT fk_12e9b90a1f1b251e');
$this->addSql('ALTER TABLE itemniveau01 DROP CONSTRAINT fk_12e9b90a6dfc7e23');
$this->addSql('ALTER TABLE alertitem DROP CONSTRAINT fk_873c473817fd46c1');
$this->addSql('ALTER TABLE alertitem DROP CONSTRAINT fk_873c47381f1b251e');
$this->addSql('DROP TABLE alertniveau01');
$this->addSql('DROP TABLE itemniveau01');
$this->addSql('DROP TABLE alertitem');
$this->addSql('ALTER TABLE groupe ADD pagetemplate_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE groupe ADD CONSTRAINT FK_4B98C216D71CE5E FOREIGN KEY (pagetemplate_id) REFERENCES page (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX IDX_4B98C216D71CE5E ON groupe (pagetemplate_id)');
$this->addSql('ALTER TABLE item DROP badgeurl');
$this->addSql('ALTER TABLE item DROP ssoitem');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('CREATE TABLE alertniveau01 (alert INT NOT NULL, niveau01 INT NOT NULL, PRIMARY KEY(alert, niveau01))');
$this->addSql('CREATE INDEX idx_87e7389c6dfc7e23 ON alertniveau01 (niveau01)');
$this->addSql('CREATE INDEX idx_87e7389c17fd46c1 ON alertniveau01 (alert)');
$this->addSql('CREATE TABLE itemniveau01 (item INT NOT NULL, niveau01 INT NOT NULL, PRIMARY KEY(item, niveau01))');
$this->addSql('CREATE INDEX idx_12e9b90a6dfc7e23 ON itemniveau01 (niveau01)');
$this->addSql('CREATE INDEX idx_12e9b90a1f1b251e ON itemniveau01 (item)');
$this->addSql('CREATE TABLE alertitem (alert INT NOT NULL, item INT NOT NULL, PRIMARY KEY(alert, item))');
$this->addSql('CREATE INDEX idx_873c47381f1b251e ON alertitem (item)');
$this->addSql('CREATE INDEX idx_873c473817fd46c1 ON alertitem (alert)');
$this->addSql('ALTER TABLE alertniveau01 ADD CONSTRAINT fk_87e7389c17fd46c1 FOREIGN KEY (alert) REFERENCES alert (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE alertniveau01 ADD CONSTRAINT fk_87e7389c6dfc7e23 FOREIGN KEY (niveau01) REFERENCES niveau01 (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE itemniveau01 ADD CONSTRAINT fk_12e9b90a1f1b251e FOREIGN KEY (item) REFERENCES item (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE itemniveau01 ADD CONSTRAINT fk_12e9b90a6dfc7e23 FOREIGN KEY (niveau01) REFERENCES niveau01 (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE alertitem ADD CONSTRAINT fk_873c473817fd46c1 FOREIGN KEY (alert) REFERENCES alert (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE alertitem ADD CONSTRAINT fk_873c47381f1b251e FOREIGN KEY (item) REFERENCES item (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE groupe DROP CONSTRAINT FK_4B98C216D71CE5E');
$this->addSql('DROP INDEX IDX_4B98C216D71CE5E');
$this->addSql('ALTER TABLE groupe DROP pagetemplate_id');
$this->addSql('ALTER TABLE item ADD badgeurl VARCHAR(250) DEFAULT NULL');
$this->addSql('ALTER TABLE item ADD ssoitem VARCHAR(255) DEFAULT NULL');
}
}