mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 14:05:52 +01:00
Add Label model.
This commit is contained in:
19
src/main/scala/model/Labels.scala
Normal file
19
src/main/scala/model/Labels.scala
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
package model
|
||||||
|
|
||||||
|
import scala.slick.driver.H2Driver.simple._
|
||||||
|
|
||||||
|
object Labels extends Table[Label]("LABEL") with Functions {
|
||||||
|
def userName = column[String]("USER_NAME", O PrimaryKey)
|
||||||
|
def repositoryName = column[String]("REPOSITORY_NAME", O PrimaryKey)
|
||||||
|
def labelId = column[Int]("LABEL_ID", O PrimaryKey, O AutoInc)
|
||||||
|
def labelName = column[String]("LABEL_NAME")
|
||||||
|
def color = column[Int]("COLOR")
|
||||||
|
def * = userName ~ repositoryName ~ labelId ~ labelName ~ color <> (Label, Label.unapply _)
|
||||||
|
}
|
||||||
|
|
||||||
|
case class Label(
|
||||||
|
userName: String,
|
||||||
|
repositoryName: String,
|
||||||
|
labelId: Int,
|
||||||
|
labelName: String,
|
||||||
|
color: String)
|
||||||
Reference in New Issue
Block a user