mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 05:25:50 +01:00
Replace native SQL which retrieves issue count with type safe DSL.
This commit is contained in:
17
src/main/scala/model/IssueLabels.scala
Normal file
17
src/main/scala/model/IssueLabels.scala
Normal file
@@ -0,0 +1,17 @@
|
||||
package model
|
||||
|
||||
import scala.slick.driver.H2Driver.simple._
|
||||
|
||||
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 _)
|
||||
}
|
||||
|
||||
case class IssueLabel(
|
||||
userName: String,
|
||||
repositoryName: String,
|
||||
issueId: Int,
|
||||
labelId: Int)
|
||||
Reference in New Issue
Block a user