Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package models
- import scala.slick.driver.PostgresDriver.simple._
- import com.football.models.User.{DAO => UserDAO}
- import com.football.models.util.RandomString
- case class UserSession(
- sessionId: String = RandomString.randomAlphanumericString(32),
- userId: Int,
- expiration: Long
- )
- object UserSession {
- object DAO extends Table[UserSession]("user_sessions") {
- def sessionId = column[String]("id", O.PrimaryKey)
- def userId = column[Int]("user_id")
- def expiration = column[Long]("expiration")
- def * = sessionId ~ userId ~ expiration <> (UserSession.apply _, UserSession.unapply _)
- def user = foreignKey("user_fk", userId, UserDAO)(_.id)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement