addSql('ALTER TABLE notification ADD related_ticket_id INT DEFAULT NULL'); $this->addSql('ALTER TABLE notification ADD CONSTRAINT FK_BF5476CA98F144DB FOREIGN KEY (related_ticket_id) REFERENCES client_ticket (id) ON DELETE SET NULL NOT DEFERRABLE'); $this->addSql('CREATE INDEX idx_notification_related_ticket ON notification (related_ticket_id)'); $this->addSql("COMMENT ON COLUMN notification.related_ticket_id IS 'Ticket client lie a la notification (FK client_ticket, SET NULL). null = notification non liee a un ticket.'"); } public function down(Schema $schema): void { $this->addSql('ALTER TABLE notification DROP CONSTRAINT FK_BF5476CA98F144DB'); $this->addSql('DROP INDEX idx_notification_related_ticket'); $this->addSql('ALTER TABLE notification DROP related_ticket_id'); } }