mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 05:55:51 +01:00
Create java.util.Date TypeMapper. And add the currentDate method.
This commit is contained in:
@@ -2,17 +2,17 @@ package model
|
||||
|
||||
import scala.slick.driver.H2Driver.simple._
|
||||
|
||||
object Milestones extends Table[Milestone]("MILESTONE") {
|
||||
object Milestones extends Table[Milestone]("MILESTONE") with Functions {
|
||||
def userName = column[String]("USER_NAME", O PrimaryKey)
|
||||
def repositoryName = column[String]("REPOSITORY_NAME", O PrimaryKey)
|
||||
def milestoneId = column[Int]("MILESTONE_ID", O PrimaryKey)
|
||||
def milestoneId = column[Int]("MILESTONE_ID", O PrimaryKey, O AutoInc)
|
||||
def title = column[String]("TITLE")
|
||||
def description = column[String]("DESCRIPTION")
|
||||
def dueDate = column[java.sql.Date]("DUE_DATE") // TODO convert java.util.Date later
|
||||
def closedDate = column[java.sql.Timestamp]("CLOSED_DATE")
|
||||
|
||||
def ins = userName ~ repositoryName ~ title ~ description.? ~ dueDate.? ~ closedDate.?
|
||||
def dueDate = column[java.util.Date]("DUE_DATE")
|
||||
def closedDate = column[java.util.Date]("CLOSED_DATE")
|
||||
def * = userName ~ repositoryName ~ milestoneId ~ title ~ description.? ~ dueDate.? ~ closedDate.? <> (Milestone, Milestone.unapply _)
|
||||
|
||||
def autoInc = userName ~ repositoryName ~ title ~ description.? ~ dueDate.? ~ closedDate.? returning milestoneId
|
||||
}
|
||||
|
||||
case class Milestone(
|
||||
@@ -21,5 +21,5 @@ case class Milestone(
|
||||
milestoneId: Int,
|
||||
title: String,
|
||||
description: Option[String],
|
||||
dueDate: Option[java.sql.Date],
|
||||
closedDate: Option[java.sql.Timestamp])
|
||||
dueDate: Option[java.util.Date],
|
||||
closedDate: Option[java.util.Date])
|
||||
|
||||
Reference in New Issue
Block a user