I have two tables. notas_cabecera
and vehiculos
.
These are my tables structures:
notas_cabecera
table:
vehiculos
table:
but when I add a foreign key:
ALTER TABLE notas_cabecera
ADD CONSTRAINT chapa_vehiculo_fk
FOREIGN KEY (chapa_vehiculo)
REFERENCES vehiculos(chapa_vehiculo);
I'm getting this error:
Error Code: 1215. Cannot add foreign key constraint
What does this mean?