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,22 +1,21 @@
package model
import scala.slick.driver.H2Driver.simple._
import model.{BaseTable => Table}
object Repositories extends Table[Repository]("REPOSITORY") with Functions {
def repositoryName= column[String]("REPOSITORY_NAME", O PrimaryKey)
def userName = column[String]("USER_NAME", O PrimaryKey)
def isPrivate = column[Boolean]("PRIVATE")
def description = column[String]("DESCRIPTION")
def defaultBranch = column[String]("DEFAULT_BRANCH")
def registeredDate = column[java.util.Date]("REGISTERED_DATE")
def updatedDate = column[java.util.Date]("UPDATED_DATE")
def lastActivityDate = column[java.util.Date]("LAST_ACTIVITY_DATE")
def * = repositoryName ~ userName ~ isPrivate ~ description.? ~ defaultBranch ~ registeredDate ~ updatedDate ~ lastActivityDate <> (Repository, Repository.unapply _)
def * = base ~ isPrivate ~ description.? ~ defaultBranch ~ registeredDate ~ updatedDate ~ lastActivityDate <> (Repository, Repository.unapply _)
}
case class Repository(
repositoryName: String,
userName: String,
repositoryName: String,
isPrivate: Boolean,
description: Option[String],
defaultBranch: String,