Et rebelote, le bug:
En essayant de supprimer une entreprise:
SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`serviceproviders2`.`company_startup_received_funding_type`, CONSTRAINT `company_startup_received_funding_type_ibfk_6` FOREIGN KEY (`startup_id`) REFERENCES `company` (`id`))
Le SQL pour company:
1 2 3
| CREATE TABLE company (id INT AUTO_INCREMENT, type VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, year_founded VARCHAR(4) NOT NULL, url VARCHAR(255),
[...]
updated_at DATETIME NOT NULL, INDEX company_type_idx (type), UNIQUE INDEX sluggable_idx (slug), INDEX state_id_idx (state_id), INDEX country_id_idx (country_id), PRIMARY KEY(id)) ENGINE = INNODB; |
Le SQL pour company_startup_received_funding_type:
CREATE TABLE company_startup_received_funding_type (startup_id INT, funding_id INT, PRIMARY KEY(startup_id, funding_id)) ENGINE = INNODB;
Le SQL pour company_startup_received_funding_type_ibfk_6:
ALTER TABLE company_startup_received_funding_type ADD CONSTRAINT company_startup_received_funding_type_startup_id_company_id FOREIGN KEY (startup_id) REFERENCES company(id) ON DELETE CASCADE;
Merci par avance !!
Partager