migration
This commit is contained in:
31
migrations/Version20241119100530.php
Normal file
31
migrations/Version20241119100530.php
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<?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 Version20241119100530 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
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this down() migration is auto-generated, please modify it to your needs
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
31
migrations/Version20241119100721.php
Normal file
31
migrations/Version20241119100721.php
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<?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 Version20241119100721 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
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this down() migration is auto-generated, please modify it to your needs
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
49
migrations/Version20241119101002.php
Normal file
49
migrations/Version20241119101002.php
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<?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)');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -45,7 +45,7 @@ class Participant implements UserInterface, PasswordAuthenticatedUserInterface
|
|||||||
private ?string $password = null;
|
private ?string $password = null;
|
||||||
|
|
||||||
#[ORM\ManyToOne(targetEntity: Site::class, inversedBy: 'participants')]
|
#[ORM\ManyToOne(targetEntity: Site::class, inversedBy: 'participants')]
|
||||||
#[ORM\JoinColumn(name: 'site_id', referencedColumnName: 'idSite', nullable: true)]
|
#[ORM\JoinColumn(name: 'id_site', referencedColumnName: 'id_site', nullable: true)]
|
||||||
private ?Site $site = null;
|
private ?Site $site = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user