errno: 150 "Foreign key constraint is incorrectly formed" when migrating RH-SSO from 7.0 to 7.2 with MySQL
Issue
The migration failed and the following stacktrace was shown:
Caused by: java.sql.SQLException: Can't create table `RHSSO70to72`.`#sql-96c_2f` (errno: 150 "Foreign key constraint is incorrectly formed")
Query is: ALTER TABLE RHSSO70to72.COMPONENT ADD CONSTRAINT FK_COMPONENT_REALM FOREIGN KEY (REALM_ID) REFERENCES RHSSO70to72.REALM (ID)
at org.mariadb.jdbc.internal.util.LogQueryTool.exceptionWithQuery(LogQueryTool.java:113)
at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:168)
at org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:337)
... 68 more
Environment
- Red Hat Single Sign-on 7.0, 7.2
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.