From 2dc5710e0658878e5d2c697e384eaea3e263c154 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 12 Aug 2025 13:39:32 +0200 Subject: [PATCH] Visualisation Utilisateurs --- migrations/Version20250812113220.php | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 migrations/Version20250812113220.php diff --git a/migrations/Version20250812113220.php b/migrations/Version20250812113220.php new file mode 100644 index 0000000..3537134 --- /dev/null +++ b/migrations/Version20250812113220.php @@ -0,0 +1,38 @@ +addSql('CREATE TABLE apps_organizations (apps_id INT NOT NULL, organizations_id INT NOT NULL, PRIMARY KEY(apps_id, organizations_id))'); + $this->addSql('CREATE INDEX IDX_FFE659D5A2D76671 ON apps_organizations (apps_id)'); + $this->addSql('CREATE INDEX IDX_FFE659D586288A55 ON apps_organizations (organizations_id)'); + $this->addSql('ALTER TABLE apps_organizations ADD CONSTRAINT FK_FFE659D5A2D76671 FOREIGN KEY (apps_id) REFERENCES apps (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE apps_organizations ADD CONSTRAINT FK_FFE659D586288A55 FOREIGN KEY (organizations_id) REFERENCES organizations (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + } + + 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('ALTER TABLE apps_organizations DROP CONSTRAINT FK_FFE659D5A2D76671'); + $this->addSql('ALTER TABLE apps_organizations DROP CONSTRAINT FK_FFE659D586288A55'); + $this->addSql('DROP TABLE apps_organizations'); + } +}