(refs #2)Add columns MERGE_START_ID and MERGE_END_ID to PULL_REQUEST.

This commit is contained in:
takezoe
2013-07-15 04:49:14 +09:00
parent dc59d1f3ca
commit 9bb6b216e9
4 changed files with 48 additions and 21 deletions

View File

@@ -5,10 +5,6 @@ import Database.threadLocalSession
import model._
//import scala.slick.jdbc.{StaticQuery => Q}
//import Q.interpolation
trait PullRequestService { self: IssuesService =>
def getPullRequest(owner: String, repository: String, issueId: Int): Option[(Issue, PullRequest)] = {
@@ -30,6 +26,16 @@ trait PullRequestService { self: IssuesService =>
originBranch,
requestUserName,
requestRepositoryName,
requestBranch))
requestBranch,
None,
None))
def mergePullRequest(originUserName: String, originRepositoryName: String, issueId: Int,
mergeStartId: String, mergeEndId: String): Unit = {
Query(PullRequests)
.filter(_.byPrimaryKey(originUserName, originRepositoryName, issueId))
.map(t => t.mergeStartId ~ t.mergeEndId)
.update(mergeStartId, mergeEndId)
}
}