mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-08 06:25:51 +01:00
Fix services to use shortcut method for primary key and foreign keys.
This commit is contained in:
@@ -2,8 +2,7 @@ package model
|
||||
|
||||
import scala.slick.driver.H2Driver.simple._
|
||||
|
||||
object Milestones extends Table[Milestone]("MILESTONE") with BasicTemplate with Functions {
|
||||
def milestoneId = column[Int]("MILESTONE_ID", O AutoInc)
|
||||
object Milestones extends Table[Milestone]("MILESTONE") with MilestoneTemplate with Functions {
|
||||
def title = column[String]("TITLE")
|
||||
def description = column[String]("DESCRIPTION")
|
||||
def dueDate = column[java.util.Date]("DUE_DATE")
|
||||
@@ -11,9 +10,7 @@ object Milestones extends Table[Milestone]("MILESTONE") with BasicTemplate with
|
||||
def * = userName ~ repositoryName ~ milestoneId ~ title ~ description.? ~ dueDate.? ~ closedDate.? <> (Milestone, Milestone.unapply _)
|
||||
|
||||
def autoInc = userName ~ repositoryName ~ title ~ description.? ~ dueDate.? ~ closedDate.? returning milestoneId
|
||||
// TODO create a template?
|
||||
def byPrimaryKey(owner: String, repository: String, milestoneId: Int) =
|
||||
byRepository(owner, repository) && (this.milestoneId is milestoneId.bind)
|
||||
def byPrimaryKey = byMilestone _
|
||||
}
|
||||
|
||||
case class Milestone(
|
||||
|
||||
Reference in New Issue
Block a user