Hi all,
I have to log result into an existing MySQL database (I can't modify schema) :
CREATE TABLE `produits` (
`Pr_Id` int(10) NOT NULL AUTO_INCREMENT,
`Pr_Num_Serie` int(10) DEFAULT NULL,
`Pr_Designation` varchar(128) DEFAULT NULL,
PRIMARY KEY (`Pr_Id`),
KEY `Num_Serie` (`Pr_Num_Serie`)
) ENGINE=InnoDB AUTO_INCREMENT=1337786388 DEFAULT CHARSET=latin1;
CREATE TABLE `passage_baie` (
`Pb_Id` int(10) NOT NULL AUTO_INCREMENT,
`Pb_Pr_Id` int(10) DEFAULT NULL,
PRIMARY KEY (`Pb_Id`),
KEY `ProduitsPassage_Baie` (`Pb_Pr_Id`),
KEY `Pb_Id` (`Pb_Id`,`Pb_Pr_Id`),
CONSTRAINT `FK_passage_baie_produits` FOREIGN KEY (`Pb_Pr_Id`) REFERENCES `produits` (`Pr_Id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=462299 DEFAULT CHARSET=latin1;
I have some issues linked to "auto_increment" and "foreign key".
I see other discussions for this kind of issue, but quite old.
How can I resolve my issues?
Thanks
Maxime