Skip to content

Commit

Permalink
fix core query to return empty values when refering to old tables
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmpp committed Oct 7, 2022
1 parent b6a4d40 commit 87ab554
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,7 @@ trait CoreRepositoryQueries extends LazyLogging with CoreDBMappings with Persist

@deprecated("Do not use anymore. Only kept because it was used in migration script oo656.")
protected def queryLatestPersistenceMessageByPersistenceIdQuery = {
sql"""SELECT l.persistence_id, l.persistence_key, l.sequence_nr, j.message FROM
persistence_journal j INNER JOIN (
SELECT j.persistence_key, m.persistence_id, max(j.sequence_nr) sequence_nr
FROM persistence_journal j JOIN persistence_metadata m ON j.persistence_key=m.persistence_key group by j.persistence_key, m.persistence_id) l
ON j.persistence_key=l.persistence_key AND j.sequence_nr=l.sequence_nr
""".map { rs =>
sql"""select 'persistence_id', 'sequence_nr', 'message' limit 0""".map { rs =>
val persistenceId = rs.string("persistence_id")
val seqNr = rs.long("sequence_nr")
val message = persistentEventBinder.apply(rs.underlying, "message")
Expand Down

0 comments on commit 87ab554

Please sign in to comment.