Skip to content
This repository has been archived by the owner on Dec 8, 2019. It is now read-only.

Commit

Permalink
Updated slick to avoid crashes at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Nutomic committed Sep 22, 2016
1 parent c4ee46c commit e9da8cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'scala'
dependencies {
compile 'org.scala-lang:scala-library:2.11.7'
compile 'com.h2database:h2:1.4.192'
compile 'com.typesafe.slick:slick_2.11:3.1.1'
compile 'com.typesafe.slick:slick_2.11:3.2.0-M1'
compile 'com.typesafe.scala-logging:scala-logging_2.11:3.5.0'
compile 'joda-time:joda-time:2.9.4'
testCompile 'junit:junit:4.12'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import com.nutomic.ensichat.core.routing.Address
import com.typesafe.scalalogging.Logger
import org.joda.time
import org.joda.time.DateTime
import slick.driver.H2Driver.api._
import slick.jdbc.H2Profile.api._

import scala.concurrent.Await
import scala.concurrent.duration.Duration
Expand Down Expand Up @@ -40,7 +40,7 @@ class Database(path: File, settings: SettingsInterface, callbackInterface: Callb
def date = column[Long]("date")
def tokens = column[Int]("tokens")
def confirmedDelivered = column[Boolean]("confirmed_delivered")
def * = (origin, target, messageId, text, date, tokens, confirmedDelivered) <> [(Message, Boolean), (String, String, Long, String, Long, Int, Boolean)]( {
def * = (origin, target, messageId, text, date, tokens, confirmedDelivered) <> [(Message, Boolean)]( {
tuple =>
val header = new ContentHeader(new Address(tuple._1),
new Address(tuple._2),
Expand All @@ -63,15 +63,15 @@ class Database(path: File, settings: SettingsInterface, callbackInterface: Callb
def address = column[String]("address", O.PrimaryKey)
def name = column[String]("name")
def status = column[String]("status")
def wrappedAddress = address <> [Address, String](new Address(_), a => Option(a.toString))
def wrappedAddress = address <> [Address](new Address(_), a => Option(a.toString))
def * = (wrappedAddress, name, status) <> (User.tupled, User.unapply)
}
private val contacts = TableQuery[Contacts]

private class KnownDevices(tag: Tag) extends Table[(Address, time.Duration)](tag, "KNOWN_DEVICES") {
def address = column[String]("address", O.PrimaryKey)
def totalConnectionSeconds = column[Long]("total_connection_seconds")
def * = (address, totalConnectionSeconds) <> [(Address, time.Duration), (String, Long)](
def * = (address, totalConnectionSeconds) <> [(Address, time.Duration)](
tuple => (new Address(tuple._1), time.Duration.standardSeconds(tuple._2)),
tuple => Option((tuple._1.toString, tuple._2.getStandardSeconds)))
}
Expand Down

0 comments on commit e9da8cd

Please sign in to comment.