Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // this code works ok
- val id = (models returning models.map(_.id)) += Dashboard.makeObject(name = newModel.name, description = newModel.maybeDescription)
- containers += Container.makeObject(1, defaultlayoutId, id)
- // ...
- // table definition for Dashboard
- class Dashboards(tag: Tag) extends Table[Dashboard](tag, "dashboards") {
- def id = column[Long]("id", O.PrimaryKey, O.AutoInc)
- def name = column[String]("name", O.NotNull)
- def description = column[Option[String]]("description", O.Nullable)
- def created = column[Timestamp]("created", O.NotNull, O.DBType("timestamp default now()"))
- def lastUpdated = column[Timestamp]("last_updated", O.NotNull, O.DBType("timestamp default now()"))
- def idx = index("dashboards_unique_name", (name), unique = true)
- //define the "shape" of a single data record
- //we're telling that an object of class Dashboard should be returned
- def * = (id, name, description, created, lastUpdated) <>((Dashboard.apply _).tupled, Dashboard.unapply)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement