Skip to content

Commit

Permalink
Use journal_persistence_ids for maxJournalSequenceQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagomota committed Oct 13, 2021
1 parent 33e9cb2 commit ec8dabf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ class ReadJournalQueries(val readJournalConfig: ReadJournalConfig) {
val orderingByOrdering = Compiled(_journalSequenceQuery _)

val maxOrdering = Compiled {
journalTable.map(_.ordering).max.getOrElse(0L)
journalPersistenceIdsTable.map(_.maxOrdering).max.getOrElse(0L)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ReadJournalQueriesTest extends BaseQueryTest {
}

it should "create SQL query for maxJournalSequenceQuery" in withReadJournalQueries { queries =>
queries.maxOrdering shouldBeSQL """select max("ordering") from "journal""""
queries.maxOrdering shouldBeSQL """select max("max_ordering") from "journal_persistence_ids""""
}

private def withReadJournalQueries(f: ReadJournalQueries => Unit): Unit = {
Expand Down

0 comments on commit ec8dabf

Please sign in to comment.