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'); } }