Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use snapshot table name in its primary key name #181

Merged
merged 2 commits into from Apr 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -35,8 +35,8 @@ trait JournalTables {
val deleted: Rep[Boolean] = column[Boolean](journalTableCfg.columnNames.deleted, O.Default(false))
val tags: Rep[Option[String]] = column[Option[String]](journalTableCfg.columnNames.tags, O.Length(255, varying = true))
val message: Rep[Array[Byte]] = column[Array[Byte]](journalTableCfg.columnNames.message)
val pk = primaryKey("journal_pk", (persistenceId, sequenceNumber))
val orderingIdx = index("journal_ordering_idx", ordering, unique = true)
val pk = primaryKey(s"${tableName}_pk", (persistenceId, sequenceNumber))
val orderingIdx = index(s"${tableName}_ordering_idx", ordering, unique = true)
}

lazy val JournalTable = new TableQuery(tag => new Journal(tag))
Expand Down
Expand Up @@ -43,7 +43,7 @@ trait SnapshotTables {
val sequenceNumber: Rep[Long] = column[Long](snapshotTableCfg.columnNames.sequenceNumber)
val created: Rep[Long] = column[Long](snapshotTableCfg.columnNames.created)
val snapshot: Rep[Array[Byte]] = column[Array[Byte]](snapshotTableCfg.columnNames.snapshot)
val pk = primaryKey("snapshot_pk", (persistenceId, sequenceNumber))
val pk = primaryKey(s"${tableName}_pk", (persistenceId, sequenceNumber))
}

case class OracleSnapshot(_tableTag: Tag) extends Snapshot(_tableTag) {
Expand All @@ -58,4 +58,4 @@ trait SnapshotTables {
}

lazy val SnapshotTable = new TableQuery(tag => if (isOracleDriver(profile)) OracleSnapshot(tag) else new Snapshot(tag))
}
}