Ao tentar atualizar um módulo com estrutura, estou tomando o seguinte erro:
Caused by: java.lang.RuntimeException: org.hibernate.exception.ConstraintViolationException: could not insert: [lumis.portal.structure.sync.model.global.InterfaceStyle]
at lumis.portal.structure.sync.SyncInProcessor.syncIn(SyncInProcessor.java:1236)
at lumis.portal.structure.sync.SyncInProcessor.syncIn(SyncInProcessor.java:989)
... 126 more
Caused by: org.hibernate.exception.ConstraintViolationException: could not insert: [lumis.portal.structure.sync.model.global.InterfaceStyle]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2285)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2678)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
at lumis.portal.structure.sync.ParallelExecutor.awaitExecutions(ParallelExecutor.java:525)
at lumis.portal.structure.sync.SyncInProcessor.syncIn(SyncInProcessor.java:1072)
... 127 more
Caused by: java.sql.SQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`lumisportal`.`lum_interfacestyle`, CONSTRAINT `LUM_FK_INTERFACESTYLE` FOREIGN KEY (`interfaceId`) REFERENCES `lum_interface` (`interfaceId`))
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:117)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:974)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1113)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1061)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1381)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:1046)
at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:46)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2265)
... 137 more
Em algum momento, com o Kishnan, foi dito que poderia excluir as chaves estrangeiras da tabela lum_InterfaceStyle, com isso o deploy é executado normalmente, depois é só voltar as chaves estrangeiras.
As chaves seriam as: LUM_IDX_INTERFACESTYLE1 e LUM_IDX_INTERFACESTYLE2?