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

Commit e9da8cd

Browse files
committed
Updated slick to avoid crashes at startup
1 parent c4ee46c commit e9da8cd

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

core/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apply plugin: 'scala'
33
dependencies {
44
compile 'org.scala-lang:scala-library:2.11.7'
55
compile 'com.h2database:h2:1.4.192'
6-
compile 'com.typesafe.slick:slick_2.11:3.1.1'
6+
compile 'com.typesafe.slick:slick_2.11:3.2.0-M1'
77
compile 'com.typesafe.scala-logging:scala-logging_2.11:3.5.0'
88
compile 'joda-time:joda-time:2.9.4'
99
testCompile 'junit:junit:4.12'

core/src/main/scala/com/nutomic/ensichat/core/util/Database.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import com.nutomic.ensichat.core.routing.Address
1111
import com.typesafe.scalalogging.Logger
1212
import org.joda.time
1313
import org.joda.time.DateTime
14-
import slick.driver.H2Driver.api._
14+
import slick.jdbc.H2Profile.api._
1515

1616
import scala.concurrent.Await
1717
import scala.concurrent.duration.Duration
@@ -40,7 +40,7 @@ class Database(path: File, settings: SettingsInterface, callbackInterface: Callb
4040
def date = column[Long]("date")
4141
def tokens = column[Int]("tokens")
4242
def confirmedDelivered = column[Boolean]("confirmed_delivered")
43-
def * = (origin, target, messageId, text, date, tokens, confirmedDelivered) <> [(Message, Boolean), (String, String, Long, String, Long, Int, Boolean)]( {
43+
def * = (origin, target, messageId, text, date, tokens, confirmedDelivered) <> [(Message, Boolean)]( {
4444
tuple =>
4545
val header = new ContentHeader(new Address(tuple._1),
4646
new Address(tuple._2),
@@ -63,15 +63,15 @@ class Database(path: File, settings: SettingsInterface, callbackInterface: Callb
6363
def address = column[String]("address", O.PrimaryKey)
6464
def name = column[String]("name")
6565
def status = column[String]("status")
66-
def wrappedAddress = address <> [Address, String](new Address(_), a => Option(a.toString))
66+
def wrappedAddress = address <> [Address](new Address(_), a => Option(a.toString))
6767
def * = (wrappedAddress, name, status) <> (User.tupled, User.unapply)
6868
}
6969
private val contacts = TableQuery[Contacts]
7070

7171
private class KnownDevices(tag: Tag) extends Table[(Address, time.Duration)](tag, "KNOWN_DEVICES") {
7272
def address = column[String]("address", O.PrimaryKey)
7373
def totalConnectionSeconds = column[Long]("total_connection_seconds")
74-
def * = (address, totalConnectionSeconds) <> [(Address, time.Duration), (String, Long)](
74+
def * = (address, totalConnectionSeconds) <> [(Address, time.Duration)](
7575
tuple => (new Address(tuple._1), time.Duration.standardSeconds(tuple._2)),
7676
tuple => Option((tuple._1.toString, tuple._2.getStandardSeconds)))
7777
}

0 commit comments

Comments
 (0)