Last active
August 29, 2015 14:22
-
-
Save cameronhotchkies/d0dd502bb6214e115a9d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.joda.time.DateTime | |
import play.api.db.slick.DatabaseConfigProvider | |
import slick.driver.JdbcProfile | |
import play.api.Play.current | |
object SlickMapping { | |
protected val dbConfig = DatabaseConfigProvider.get[JdbcProfile](current) | |
import dbConfig._ | |
import dbConfig.driver.api._ | |
implicit val jodaDateTimeMapping() = { | |
MappedColumnType.base[DateTime, Long]( | |
dt => dt.getMillis, | |
ts => new DateTime(ts)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment