Turn to use returning instead of returningId

This commit is contained in:
Naoki Takezoe
2016-08-13 04:31:22 +09:00
parent 77641185af
commit 89dfaeeb93
4 changed files with 4 additions and 10 deletions

View File

@@ -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)
}

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,