(refs #341) Migrate model package.

This commit is contained in:
shimamoto
2014-06-16 01:29:56 +09:00
parent 8ed4075f1e
commit bbe455ac49
17 changed files with 372 additions and 290 deletions

View File

@@ -1,17 +1,21 @@
package model
import scala.slick.driver.H2Driver.simple._
trait CollaboratorComponent extends TemplateComponent { self: Profile =>
import profile.simple._
object Collaborators extends Table[Collaborator]("COLLABORATOR") with BasicTemplate {
def collaboratorName = column[String]("COLLABORATOR_NAME")
def * = userName ~ repositoryName ~ collaboratorName <> (Collaborator, Collaborator.unapply _)
lazy val Collaborators = TableQuery[Collaborators]
def byPrimaryKey(owner: String, repository: String, collaborator: String) =
byRepository(owner, repository) && (collaboratorName is collaborator.bind)
class Collaborators(tag: Tag) extends Table[Collaborator](tag, "COLLABORATOR") with BasicTemplate {
val collaboratorName = column[String]("COLLABORATOR_NAME")
def * = (userName, repositoryName, collaboratorName) <> (Collaborator.tupled, Collaborator.unapply)
def byPrimaryKey(owner: String, repository: String, collaborator: String) =
byRepository(owner, repository) && (collaboratorName is collaborator.bind)
}
case class Collaborator(
userName: String,
repositoryName: String,
collaboratorName: String
)
}
case class Collaborator(
userName: String,
repositoryName: String,
collaboratorName: String
)