50 lines
2.7 KiB
PHP
50 lines
2.7 KiB
PHP
<?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 Version20241119101002 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 lieu ADD CONSTRAINT FK_2F577D59A73F0036 FOREIGN KEY (ville_id) REFERENCES ville (idVille)');
|
|
$this->addSql('DROP INDEX IDX_D79F6B11F6BD1646 ON participant');
|
|
$this->addSql('ALTER TABLE participant ADD id_site CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', ADD email VARCHAR(255) NOT NULL, DROP site_id, DROP mail');
|
|
$this->addSql('ALTER TABLE participant ADD CONSTRAINT FK_D79F6B11E26315E6 FOREIGN KEY (id_site) REFERENCES site (id_site)');
|
|
$this->addSql('CREATE INDEX IDX_D79F6B11E26315E6 ON participant (id_site)');
|
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_IDENTIFIER_EMAIL ON participant (email)');
|
|
$this->addSql('ALTER TABLE sortie ADD CONSTRAINT FK_3C3FD3F2F6BD1646 FOREIGN KEY (site_id) REFERENCES site (idSite)');
|
|
$this->addSql('ALTER TABLE sortie ADD CONSTRAINT FK_3C3FD3F29D1C3019 FOREIGN KEY (participant_id) REFERENCES participant (idParticipant)');
|
|
$this->addSql('ALTER TABLE sortie ADD CONSTRAINT FK_3C3FD3F26AB213CC FOREIGN KEY (lieu_id) REFERENCES lieu (idLieu)');
|
|
$this->addSql('ALTER TABLE sortie ADD CONSTRAINT FK_3C3FD3F2D5E86FF FOREIGN KEY (etat_id) REFERENCES etat (idEtat)');
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
// this down() migration is auto-generated, please modify it to your needs
|
|
$this->addSql('ALTER TABLE lieu DROP FOREIGN KEY FK_2F577D59A73F0036');
|
|
$this->addSql('ALTER TABLE sortie DROP FOREIGN KEY FK_3C3FD3F2F6BD1646');
|
|
$this->addSql('ALTER TABLE sortie DROP FOREIGN KEY FK_3C3FD3F29D1C3019');
|
|
$this->addSql('ALTER TABLE sortie DROP FOREIGN KEY FK_3C3FD3F26AB213CC');
|
|
$this->addSql('ALTER TABLE sortie DROP FOREIGN KEY FK_3C3FD3F2D5E86FF');
|
|
$this->addSql('ALTER TABLE participant DROP FOREIGN KEY FK_D79F6B11E26315E6');
|
|
$this->addSql('DROP INDEX IDX_D79F6B11E26315E6 ON participant');
|
|
$this->addSql('DROP INDEX UNIQ_IDENTIFIER_EMAIL ON participant');
|
|
$this->addSql('ALTER TABLE participant ADD site_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', ADD mail VARCHAR(255) DEFAULT NULL, DROP id_site, DROP email');
|
|
$this->addSql('CREATE INDEX IDX_D79F6B11F6BD1646 ON participant (site_id)');
|
|
}
|
|
}
|