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,19 +1,18 @@
package model
import scala.slick.driver.H2Driver.simple._
import model.{BaseTable => Table}
object IssueComments extends Table[IssueComment]("ISSUE_COMMENT") with Functions {
def userName = column[String]("USER_NAME")
def repositoryName = column[String]("REPOSITORY_NAME")
def issueId = column[Int]("ISSUE_ID")
def commentId = column[Int]("COMMENT_ID", O PrimaryKey, O AutoInc)
def commentId = column[Int]("COMMENT_ID", O AutoInc)
def commentedUserName = column[String]("COMMENTED_USER_NAME")
def content = column[String]("CONTENT")
def registeredDate = column[java.util.Date]("REGISTERED_DATE")
def updatedDate = column[java.util.Date]("UPDATED_DATE")
def * = userName ~ repositoryName ~ issueId ~ commentId ~ commentedUserName ~ content ~ registeredDate ~ updatedDate <> (IssueComment, IssueComment.unapply _)
def * = base ~ issueId ~ commentId ~ commentedUserName ~ content ~ registeredDate ~ updatedDate <> (IssueComment, IssueComment.unapply _)
def autoInc = userName ~ repositoryName ~ issueId ~ commentedUserName ~ content ~ registeredDate ~ updatedDate returning commentId
def autoInc = base ~ issueId ~ commentedUserName ~ content ~ registeredDate ~ updatedDate returning commentId
}
case class IssueComment(