mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-12-30 12:19:58 +01:00
Turn to use returning instead of returningId
This commit is contained in:
@@ -35,7 +35,7 @@ trait AccessTokenService {
|
||||
userName = userName,
|
||||
note = note,
|
||||
tokenHash = hash)
|
||||
val tokenId = (AccessTokens returningId AccessTokens.map(_.accessTokenId)) unsafeInsert newToken
|
||||
val tokenId = (AccessTokens returning AccessTokens.map(_.accessTokenId)) unsafeInsert newToken
|
||||
(tokenId, token)
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ trait CommitStatusService {
|
||||
}.update((state, targetUrl, now, creator.userName, description))
|
||||
id
|
||||
}
|
||||
case None => (CommitStatuses returningId CommitStatuses.map(_.commitStatusId)) unsafeInsert CommitStatus(
|
||||
case None => (CommitStatuses returning CommitStatuses.map(_.commitStatusId)) unsafeInsert CommitStatus(
|
||||
userName = userName,
|
||||
repositoryName = repositoryName,
|
||||
commitId = sha,
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
package gitbucket.core.service
|
||||
|
||||
import gitbucket.core.model.CommitComment
|
||||
import gitbucket.core.util.{StringUtil, Implicits}
|
||||
|
||||
//import slick.jdbc.{StaticQuery => Q}
|
||||
//import Q.interpolation
|
||||
import gitbucket.core.model.Profile._
|
||||
import profile._
|
||||
import profile.api._
|
||||
//import Implicits._
|
||||
//import StringUtil._
|
||||
|
||||
|
||||
trait CommitsService {
|
||||
@@ -30,7 +24,7 @@ trait CommitsService {
|
||||
def createCommitComment(owner: String, repository: String, commitId: String, loginUser: String,
|
||||
content: String, fileName: Option[String], oldLine: Option[Int], newLine: Option[Int],
|
||||
issueId: Option[Int])(implicit s: Session): Int =
|
||||
CommitComments returningId CommitComments.map(_.commentId) unsafeInsert CommitComment(
|
||||
CommitComments returning CommitComments.map(_.commentId) unsafeInsert CommitComment(
|
||||
userName = owner,
|
||||
repositoryName = repository,
|
||||
commitId = commitId,
|
||||
|
||||
@@ -265,7 +265,7 @@ trait IssuesService {
|
||||
|
||||
def createComment(owner: String, repository: String, loginUser: String,
|
||||
issueId: Int, content: String, action: String)(implicit s: Session): Int = {
|
||||
IssueComments returningId IssueComments.map(_.commentId) unsafeInsert IssueComment(
|
||||
IssueComments returning IssueComments.map(_.commentId) unsafeInsert IssueComment(
|
||||
userName = owner,
|
||||
repositoryName = repository,
|
||||
issueId = issueId,
|
||||
|
||||
Reference in New Issue
Block a user