mirror of
https://github.com/ysoftdevs/odc-analyzer.git
synced 2026-01-13 23:33:53 +01:00
22 lines
1.1 KiB
Scala
22 lines
1.1 KiB
Scala
package models
|
|
|
|
import models.profile.api._
|
|
import slick.lifted.{MappedProjection, Tag}
|
|
|
|
|
|
case class ExportedVulnerability[T] (vulnerabilityName: String, ticket: T, ticketFormatVersion: Int/*, maintainedAutomatically: Boolean*/, done: Boolean)
|
|
|
|
//noinspection TypeAnnotation
|
|
abstract class ExportedVulnerabilities[T, U](tag: Tag, tableNamePart: String) extends Table[(Int, ExportedVulnerability[T])](tag, s"exported_${tableNamePart}_vulnerabilities"){
|
|
def id = column[Int]("id", O.PrimaryKey, O.AutoInc)
|
|
def vulnerabilityName = column[String]("vulnerability_name")
|
|
def ticketFormatVersion = column[Int]("ticket_format_version")
|
|
def done = column[Boolean]("done")
|
|
//def maintainedAutomatically = column[Boolean]("maintained_automatically")
|
|
|
|
def base: MappedProjection[ExportedVulnerability[T], U]// = (vulnerabilityName, ticket, ticketFormatVersion) <> ((ExportedVulnerability.apply[T] _).tupled, ExportedVulnerability.unapply[T])
|
|
def * = (id, base)
|
|
|
|
def idx_vulnerabilityName = index(s"idx_${tableName}_vulnerabilityName", vulnerabilityName, unique = true)
|
|
def idx_done = index(s"idx_${tableName}_done", done, unique = false)
|
|
} |