Advertisement
Guest User

Untitled

a guest
Apr 29th, 2015
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.63 KB | None | 0 0
  1. class Permissions(tag: Tag) extends Table[Permission](tag, "permissions") {
  2.   def id = column[Long]("id", O.PrimaryKey, O.AutoInc)
  3.  
  4.   def value = column[String]("value", O.NotNull)
  5.  
  6.   def description = column[Option[String]]("description", O.Nullable)
  7.  
  8.   def created = column[Timestamp]("created", O.NotNull, O.DBType("timestamp default now()"))
  9.  
  10.   def lastUpdated = column[Timestamp]("last_updated", O.NotNull, O.DBType("timestamp default now()"))
  11.  
  12.   def idx = index("unique_permission_name", (value), unique = true)
  13.  
  14.   def * = (id, value, description, created, lastUpdated) <>((Permission.apply _).tupled, Permission.unapply _)
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement