mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 05:55:51 +01:00
(refs #341) Migrate model package.
This commit is contained in:
@@ -1,28 +1,32 @@
|
||||
package model
|
||||
|
||||
import scala.slick.driver.H2Driver.simple._
|
||||
trait PullRequestComponent extends TemplateComponent { self: Profile =>
|
||||
import profile.simple._
|
||||
|
||||
object PullRequests extends Table[PullRequest]("PULL_REQUEST") with IssueTemplate {
|
||||
def branch = column[String]("BRANCH")
|
||||
def requestUserName = column[String]("REQUEST_USER_NAME")
|
||||
def requestRepositoryName = column[String]("REQUEST_REPOSITORY_NAME")
|
||||
def requestBranch = column[String]("REQUEST_BRANCH")
|
||||
def commitIdFrom = column[String]("COMMIT_ID_FROM")
|
||||
def commitIdTo = column[String]("COMMIT_ID_TO")
|
||||
def * = userName ~ repositoryName ~ issueId ~ branch ~ requestUserName ~ requestRepositoryName ~ requestBranch ~ commitIdFrom ~ commitIdTo <> (PullRequest, PullRequest.unapply _)
|
||||
lazy val PullRequests = TableQuery[PullRequests]
|
||||
|
||||
def byPrimaryKey(userName: String, repositoryName: String, issueId: Int) = byIssue(userName, repositoryName, issueId)
|
||||
def byPrimaryKey(userName: Column[String], repositoryName: Column[String], issueId: Column[Int]) = byIssue(userName, repositoryName, issueId)
|
||||
class PullRequests(tag: Tag) extends Table[PullRequest](tag, "PULL_REQUEST") with IssueTemplate {
|
||||
val branch = column[String]("BRANCH")
|
||||
val requestUserName = column[String]("REQUEST_USER_NAME")
|
||||
val requestRepositoryName = column[String]("REQUEST_REPOSITORY_NAME")
|
||||
val requestBranch = column[String]("REQUEST_BRANCH")
|
||||
val commitIdFrom = column[String]("COMMIT_ID_FROM")
|
||||
val commitIdTo = column[String]("COMMIT_ID_TO")
|
||||
def * = (userName, repositoryName, issueId, branch, requestUserName, requestRepositoryName, requestBranch, commitIdFrom, commitIdTo) <> (PullRequest.tupled, PullRequest.unapply)
|
||||
|
||||
def byPrimaryKey(userName: String, repositoryName: String, issueId: Int) = byIssue(userName, repositoryName, issueId)
|
||||
def byPrimaryKey(userName: Column[String], repositoryName: Column[String], issueId: Column[Int]) = byIssue(userName, repositoryName, issueId)
|
||||
}
|
||||
|
||||
case class PullRequest(
|
||||
userName: String,
|
||||
repositoryName: String,
|
||||
issueId: Int,
|
||||
branch: String,
|
||||
requestUserName: String,
|
||||
requestRepositoryName: String,
|
||||
requestBranch: String,
|
||||
commitIdFrom: String,
|
||||
commitIdTo: String
|
||||
)
|
||||
}
|
||||
|
||||
case class PullRequest(
|
||||
userName: String,
|
||||
repositoryName: String,
|
||||
issueId: Int,
|
||||
branch: String,
|
||||
requestUserName: String,
|
||||
requestRepositoryName: String,
|
||||
requestBranch: String,
|
||||
commitIdFrom: String,
|
||||
commitIdTo: String
|
||||
)
|
||||
Reference in New Issue
Block a user