Move userName and repositoryName to the base table class.

This commit is contained in:
shimamoto
2013-06-27 21:59:13 +09:00
parent 89c0e52c1d
commit a217513205
9 changed files with 43 additions and 37 deletions

View File

@@ -1,13 +1,12 @@
package model
import scala.slick.driver.H2Driver.simple._
import model.{BaseTable => Table}
object IssueLabels extends Table[IssueLabel]("ISSUE_LABEL") with Functions {
def userName = column[String]("USER_NAME", O PrimaryKey)
def repositoryName = column[String]("REPOSITORY_NAME", O PrimaryKey)
def issueId = column[Int]("ISSUE_ID", O PrimaryKey)
def labelId = column[Int]("LABEL_ID", O PrimaryKey)
def * = userName ~ repositoryName ~ issueId ~ labelId <> (IssueLabel, IssueLabel.unapply _)
object IssueLabels extends Table[IssueLabel]("ISSUE_LABEL") {
def issueId = column[Int]("ISSUE_ID")
def labelId = column[Int]("LABEL_ID")
def * = base ~ issueId ~ labelId <> (IssueLabel, IssueLabel.unapply _)
}
case class IssueLabel(