MySQL Foreign key error
Created by: tsodring
Commit #169dce17 has a strange error in it. We are seeing a '150 foreign key constraint' error on Series, Record, DocumentDescription, Class and File. The error can be forced to be more descriptive by setting (in application-mysql.yaml)
hbm2ddl.auto: update
The error we see then is:
Hibernate: alter table document_description add constraint foreign key (pk_document_description_id) references document_description (pk_document_description_id)
This is a little baffling as it makes no sense for this error to occur. Hibernate seems to be trying to create a foreign key relationship from the primary key back to the primary key. SO has not been of any help so far. But it seems that the error has no consequence anyway. The attempt to add the FK fails and everything continues.
The error is not occurring in H2 or postgres.
The other errors are:
Hibernate: alter table class add constraint foreign key (pk_class_id) references class (pk_class_id)
Hibernate: alter table file add constraint foreign key (pk_file_id) references file (pk_file_id)
Hibernate: alter table record add constraint foreign key (pk_record_id) references record (pk_record_id)
Hibernate: alter table series add constraint foreign key (pk_series_id) references series (pk_series_id)