Ho creato il seguente script SQL:
Cerco di eseguirlo ma ottengo il seguente errore:codice:CREATE TABLE responsabili ( id INT NOT NULL AUTO_INCREMENT, FK_RESPONSABILI_ID VARCHAR(255), EMAIL VARCHAR(255), NOME VARCHAR(100), COGNOME VARCHAR(100), PRIMARY KEY(id,FK_RESPONSABILI_ID), FOREIGN KEY(FK_RESPONSABILI_ID) REFERENCES animali (responsabile) ON UPDATE CASCADE ON DELETE RESTRICT )ENGINE='InnoDB';
Dove sta il problema?codice:Error Code: 1822. Failed to add the foreign key constraint. Missing index for constraint 'responsabili_ibfk_1' in the referenced table 'animali'
Grazie
tulipan

Rispondi quotando