diff --git a/src/main/scala/gitbucket/core/model/AccessToken.scala b/src/main/scala/gitbucket/core/model/AccessToken.scala index 694fbff..c53eee3 100644 --- a/src/main/scala/gitbucket/core/model/AccessToken.scala +++ b/src/main/scala/gitbucket/core/model/AccessToken.scala @@ -10,7 +10,7 @@ val userName = column[String]("USER_NAME") val tokenHash = column[String]("TOKEN_HASH") val note = column[String]("NOTE") - def * = (accessTokenId, userName, tokenHash, note).<>(AccessToken.tupled, AccessToken.unapply) + def * = (accessTokenId, userName, tokenHash, note).mapTo[AccessToken] } } case class AccessToken( diff --git a/src/main/scala/gitbucket/core/model/Account.scala b/src/main/scala/gitbucket/core/model/Account.scala index f4c0ab5..357d4d8 100644 --- a/src/main/scala/gitbucket/core/model/Account.scala +++ b/src/main/scala/gitbucket/core/model/Account.scala @@ -35,7 +35,7 @@ groupAccount, removed, description.? - ).<>(Account.tupled, Account.unapply) + ).mapTo[Account] } } diff --git a/src/main/scala/gitbucket/core/model/AccountExtraMailAddress.scala b/src/main/scala/gitbucket/core/model/AccountExtraMailAddress.scala index cb66f60..249fcee 100644 --- a/src/main/scala/gitbucket/core/model/AccountExtraMailAddress.scala +++ b/src/main/scala/gitbucket/core/model/AccountExtraMailAddress.scala @@ -9,7 +9,7 @@ val userName = column[String]("USER_NAME", O PrimaryKey) val extraMailAddress = column[String]("EXTRA_MAIL_ADDRESS", O PrimaryKey) def * = - (userName, extraMailAddress).<>(AccountExtraMailAddress.tupled, AccountExtraMailAddress.unapply) + (userName, extraMailAddress).mapTo[AccountExtraMailAddress] } } diff --git a/src/main/scala/gitbucket/core/model/AccountFederation.scala b/src/main/scala/gitbucket/core/model/AccountFederation.scala index ee11f4f..7d79f24 100644 --- a/src/main/scala/gitbucket/core/model/AccountFederation.scala +++ b/src/main/scala/gitbucket/core/model/AccountFederation.scala @@ -9,7 +9,7 @@ val issuer = column[String]("ISSUER") val subject = column[String]("SUBJECT") val userName = column[String]("USER_NAME") - def * = (issuer, subject, userName).<>(AccountFederation.tupled, AccountFederation.unapply) + def * = (issuer, subject, userName).mapTo[AccountFederation] def byPrimaryKey(issuer: String, subject: String): Rep[Boolean] = (this.issuer === issuer.bind) && (this.subject === subject.bind) diff --git a/src/main/scala/gitbucket/core/model/AccountPreference.scala b/src/main/scala/gitbucket/core/model/AccountPreference.scala index 32f0210..2dcaea9 100644 --- a/src/main/scala/gitbucket/core/model/AccountPreference.scala +++ b/src/main/scala/gitbucket/core/model/AccountPreference.scala @@ -9,7 +9,7 @@ val userName = column[String]("USER_NAME", O PrimaryKey) val highlighterTheme = column[String]("HIGHLIGHTER_THEME") def * = - (userName, highlighterTheme).<>(AccountPreference.tupled, AccountPreference.unapply) + (userName, highlighterTheme).mapTo[AccountPreference] def byPrimaryKey(userName: String): Rep[Boolean] = this.userName === userName.bind } diff --git a/src/main/scala/gitbucket/core/model/AccountWebHook.scala b/src/main/scala/gitbucket/core/model/AccountWebHook.scala index 0c6d7a6..323bfd4 100644 --- a/src/main/scala/gitbucket/core/model/AccountWebHook.scala +++ b/src/main/scala/gitbucket/core/model/AccountWebHook.scala @@ -12,7 +12,7 @@ val url = column[String]("URL") val token = column[Option[String]]("TOKEN") val ctype = column[WebHookContentType]("CTYPE") - def * = (userName, url, ctype, token).<>((AccountWebHook.apply _).tupled, AccountWebHook.unapply) + def * = (userName, url, ctype, token).mapTo[AccountWebHook] def byPrimaryKey(userName: String, url: String) = (this.userName === userName.bind) && (this.url === url.bind) } diff --git a/src/main/scala/gitbucket/core/model/AccountWebHookEvent.scala b/src/main/scala/gitbucket/core/model/AccountWebHookEvent.scala index 82d1dc3..d466928 100644 --- a/src/main/scala/gitbucket/core/model/AccountWebHookEvent.scala +++ b/src/main/scala/gitbucket/core/model/AccountWebHookEvent.scala @@ -12,7 +12,7 @@ val url = column[String]("URL") val event = column[WebHook.Event]("EVENT") - def * = (userName, url, event).<>((AccountWebHookEvent.apply _).tupled, AccountWebHookEvent.unapply) + def * = (userName, url, event).mapTo[AccountWebHookEvent] def byAccountWebHook(userName: String, url: String) = (this.userName === userName.bind) && (this.url === url.bind) diff --git a/src/main/scala/gitbucket/core/model/Collaborator.scala b/src/main/scala/gitbucket/core/model/Collaborator.scala index bb2b53b..e8382b6 100644 --- a/src/main/scala/gitbucket/core/model/Collaborator.scala +++ b/src/main/scala/gitbucket/core/model/Collaborator.scala @@ -8,7 +8,7 @@ class Collaborators(tag: Tag) extends Table[Collaborator](tag, "COLLABORATOR") with BasicTemplate { val collaboratorName = column[String]("COLLABORATOR_NAME") val role = column[String]("ROLE") - def * = (userName, repositoryName, collaboratorName, role).<>(Collaborator.tupled, Collaborator.unapply) + def * = (userName, repositoryName, collaboratorName, role).mapTo[Collaborator] def byPrimaryKey(owner: String, repository: String, collaborator: String) = byRepository(owner, repository) && (collaboratorName === collaborator.bind) diff --git a/src/main/scala/gitbucket/core/model/Comment.scala b/src/main/scala/gitbucket/core/model/Comment.scala index 8997b85..a5d920e 100644 --- a/src/main/scala/gitbucket/core/model/Comment.scala +++ b/src/main/scala/gitbucket/core/model/Comment.scala @@ -21,7 +21,7 @@ val updatedDate = column[java.util.Date]("UPDATED_DATE") def * = (userName, repositoryName, issueId, commentId, action, commentedUserName, content, registeredDate, updatedDate) - .<>(IssueComment.tupled, IssueComment.unapply) + .mapTo[IssueComment] def byPrimaryKey(commentId: Int) = this.commentId === commentId.bind } @@ -75,7 +75,7 @@ originalCommitId, originalOldLine, originalNewLine - ).<>(CommitComment.tupled, CommitComment.unapply) + ).mapTo[CommitComment] def byPrimaryKey(commentId: Int) = this.commentId === commentId.bind } diff --git a/src/main/scala/gitbucket/core/model/CommitStatus.scala b/src/main/scala/gitbucket/core/model/CommitStatus.scala index 334cd1c..6317efe 100644 --- a/src/main/scala/gitbucket/core/model/CommitStatus.scala +++ b/src/main/scala/gitbucket/core/model/CommitStatus.scala @@ -30,7 +30,7 @@ creator, registeredDate, updatedDate - ).<>((CommitStatus.apply _).tupled, CommitStatus.unapply) + ).mapTo[CommitStatus] def byPrimaryKey(id: Int) = commitStatusId === id.bind } } diff --git a/src/main/scala/gitbucket/core/model/CustomField.scala b/src/main/scala/gitbucket/core/model/CustomField.scala index f403cbf..01145af 100644 --- a/src/main/scala/gitbucket/core/model/CustomField.scala +++ b/src/main/scala/gitbucket/core/model/CustomField.scala @@ -21,7 +21,7 @@ val enableForPullRequests = column[Boolean]("ENABLE_FOR_PULL_REQUESTS") def * = (userName, repositoryName, fieldId, fieldName, fieldType, constraints, enableForIssues, enableForPullRequests) - .<>(CustomField.tupled, CustomField.unapply) + .mapTo[CustomField] def byPrimaryKey(userName: String, repositoryName: String, fieldId: Int) = (this.userName === userName.bind) && (this.repositoryName === repositoryName.bind) && (this.fieldId === fieldId.bind) diff --git a/src/main/scala/gitbucket/core/model/DeployKey.scala b/src/main/scala/gitbucket/core/model/DeployKey.scala index b52e525..3f821c0 100644 --- a/src/main/scala/gitbucket/core/model/DeployKey.scala +++ b/src/main/scala/gitbucket/core/model/DeployKey.scala @@ -11,7 +11,7 @@ val publicKey = column[String]("PUBLIC_KEY") val allowWrite = column[Boolean]("ALLOW_WRITE") def * = - (userName, repositoryName, deployKeyId, title, publicKey, allowWrite).<>(DeployKey.tupled, DeployKey.unapply) + (userName, repositoryName, deployKeyId, title, publicKey, allowWrite).mapTo[DeployKey] def byPrimaryKey(userName: String, repositoryName: String, deployKeyId: Int) = (this.userName === userName.bind) && (this.repositoryName === repositoryName.bind) && (this.deployKeyId === deployKeyId.bind) diff --git a/src/main/scala/gitbucket/core/model/GpgKey.scala b/src/main/scala/gitbucket/core/model/GpgKey.scala index 7758b9c..f62a783 100644 --- a/src/main/scala/gitbucket/core/model/GpgKey.scala +++ b/src/main/scala/gitbucket/core/model/GpgKey.scala @@ -11,7 +11,7 @@ val gpgKeyId = column[Long]("GPG_KEY_ID") val title = column[String]("TITLE") val publicKey = column[String]("PUBLIC_KEY") - def * = (userName, keyId, gpgKeyId, title, publicKey).<>(GpgKey.tupled, GpgKey.unapply) + def * = (userName, keyId, gpgKeyId, title, publicKey).mapTo[GpgKey] def byPrimaryKey(userName: String, keyId: Int) = (this.userName === userName.bind) && (this.keyId === keyId.bind) diff --git a/src/main/scala/gitbucket/core/model/GroupMembers.scala b/src/main/scala/gitbucket/core/model/GroupMembers.scala index de14834..de39cf0 100644 --- a/src/main/scala/gitbucket/core/model/GroupMembers.scala +++ b/src/main/scala/gitbucket/core/model/GroupMembers.scala @@ -9,7 +9,7 @@ val groupName = column[String]("GROUP_NAME", O PrimaryKey) val userName = column[String]("USER_NAME", O PrimaryKey) val isManager = column[Boolean]("MANAGER") - def * = (groupName, userName, isManager).<>(GroupMember.tupled, GroupMember.unapply) + def * = (groupName, userName, isManager).mapTo[GroupMember] } } diff --git a/src/main/scala/gitbucket/core/model/Issue.scala b/src/main/scala/gitbucket/core/model/Issue.scala index 9a84f17..cb62218 100644 --- a/src/main/scala/gitbucket/core/model/Issue.scala +++ b/src/main/scala/gitbucket/core/model/Issue.scala @@ -47,7 +47,7 @@ registeredDate, updatedDate, pullRequest - ).<>(Issue.tupled, Issue.unapply) + ).mapTo[Issue] def byPrimaryKey(owner: String, repository: String, issueId: Int) = byIssue(owner, repository, issueId) } diff --git a/src/main/scala/gitbucket/core/model/IssueAssignee.scala b/src/main/scala/gitbucket/core/model/IssueAssignee.scala index 81ab4b0..681c434 100644 --- a/src/main/scala/gitbucket/core/model/IssueAssignee.scala +++ b/src/main/scala/gitbucket/core/model/IssueAssignee.scala @@ -9,8 +9,7 @@ class IssueAssignees(tag: Tag) extends Table[IssueAssignee](tag, "ISSUE_ASSIGNEE") with IssueTemplate { val assigneeUserName = column[String]("ASSIGNEE_USER_NAME") def * = - (userName, repositoryName, issueId, assigneeUserName) - .<>(IssueAssignee.tupled, IssueAssignee.unapply) + (userName, repositoryName, issueId, assigneeUserName).mapTo[IssueAssignee] def byPrimaryKey(owner: String, repository: String, issueId: Int, assigneeUserName: String) = { byIssue(owner, repository, issueId) && this.assigneeUserName === assigneeUserName.bind diff --git a/src/main/scala/gitbucket/core/model/IssueCustomFields.scala b/src/main/scala/gitbucket/core/model/IssueCustomFields.scala index 5ec6b9d..53f4ed0 100644 --- a/src/main/scala/gitbucket/core/model/IssueCustomFields.scala +++ b/src/main/scala/gitbucket/core/model/IssueCustomFields.scala @@ -13,8 +13,7 @@ val fieldId = column[Int]("FIELD_ID", O.PrimaryKey) val value = column[String]("VALUE") def * = - (userName, repositoryName, issueId, fieldId, value) - .<>(IssueCustomField.tupled, IssueCustomField.unapply) + (userName, repositoryName, issueId, fieldId, value).mapTo[IssueCustomField] def byPrimaryKey(owner: String, repository: String, issueId: Int, fieldId: Int) = { this.userName === owner.bind && this.repositoryName === repository.bind && this.issueId === issueId.bind && this.fieldId === fieldId.bind diff --git a/src/main/scala/gitbucket/core/model/IssueLabels.scala b/src/main/scala/gitbucket/core/model/IssueLabels.scala index 6ea4691..fc62ba8 100644 --- a/src/main/scala/gitbucket/core/model/IssueLabels.scala +++ b/src/main/scala/gitbucket/core/model/IssueLabels.scala @@ -6,7 +6,7 @@ lazy val IssueLabels = TableQuery[IssueLabels] class IssueLabels(tag: Tag) extends Table[IssueLabel](tag, "ISSUE_LABEL") with IssueTemplate with LabelTemplate { - def * = (userName, repositoryName, issueId, labelId).<>(IssueLabel.tupled, IssueLabel.unapply) + def * = (userName, repositoryName, issueId, labelId).mapTo[IssueLabel] def byPrimaryKey(owner: String, repository: String, issueId: Int, labelId: Int) = byIssue(owner, repository, issueId) && (this.labelId === labelId.bind) } diff --git a/src/main/scala/gitbucket/core/model/Labels.scala b/src/main/scala/gitbucket/core/model/Labels.scala index b21c0be..0ff85a0 100644 --- a/src/main/scala/gitbucket/core/model/Labels.scala +++ b/src/main/scala/gitbucket/core/model/Labels.scala @@ -9,7 +9,7 @@ override val labelId = column[Int]("LABEL_ID", O AutoInc) override val labelName = column[String]("LABEL_NAME") val color = column[String]("COLOR") - def * = (userName, repositoryName, labelId, labelName, color).<>(Label.tupled, Label.unapply) + def * = (userName, repositoryName, labelId, labelName, color).mapTo[Label] def byPrimaryKey(owner: String, repository: String, labelId: Int) = byLabel(owner, repository, labelId) def byPrimaryKey(userName: Rep[String], repositoryName: Rep[String], labelId: Rep[Int]) = diff --git a/src/main/scala/gitbucket/core/model/Milestone.scala b/src/main/scala/gitbucket/core/model/Milestone.scala index 6578791..361a1b1 100644 --- a/src/main/scala/gitbucket/core/model/Milestone.scala +++ b/src/main/scala/gitbucket/core/model/Milestone.scala @@ -13,8 +13,7 @@ val dueDate = column[Option[java.util.Date]]("DUE_DATE") val closedDate = column[Option[java.util.Date]]("CLOSED_DATE") def * = - (userName, repositoryName, milestoneId, title, description, dueDate, closedDate) - .<>(Milestone.tupled, Milestone.unapply) + (userName, repositoryName, milestoneId, title, description, dueDate, closedDate).mapTo[Milestone] def byPrimaryKey(owner: String, repository: String, milestoneId: Int) = byMilestone(owner, repository, milestoneId) def byPrimaryKey(userName: Rep[String], repositoryName: Rep[String], milestoneId: Rep[Int]) = diff --git a/src/main/scala/gitbucket/core/model/Priorities.scala b/src/main/scala/gitbucket/core/model/Priorities.scala index 5fbd552..4ec7344 100644 --- a/src/main/scala/gitbucket/core/model/Priorities.scala +++ b/src/main/scala/gitbucket/core/model/Priorities.scala @@ -13,8 +13,7 @@ val isDefault = column[Boolean]("IS_DEFAULT") val color = column[String]("COLOR") def * = - (userName, repositoryName, priorityId, priorityName, description.?, isDefault, ordering, color) - .<>(Priority.tupled, Priority.unapply) + (userName, repositoryName, priorityId, priorityName, description.?, isDefault, ordering, color).mapTo[Priority] def byPrimaryKey(owner: String, repository: String, priorityId: Int) = byPriority(owner, repository, priorityId) def byPrimaryKey(userName: Rep[String], repositoryName: Rep[String], priorityId: Rep[Int]) = diff --git a/src/main/scala/gitbucket/core/model/ProtectedBranch.scala b/src/main/scala/gitbucket/core/model/ProtectedBranch.scala index 91a0358..09bc600 100644 --- a/src/main/scala/gitbucket/core/model/ProtectedBranch.scala +++ b/src/main/scala/gitbucket/core/model/ProtectedBranch.scala @@ -7,7 +7,7 @@ lazy val ProtectedBranches = TableQuery[ProtectedBranches] class ProtectedBranches(tag: Tag) extends Table[ProtectedBranch](tag, "PROTECTED_BRANCH") with BranchTemplate { val statusCheckAdmin = column[Boolean]("STATUS_CHECK_ADMIN") - def * = (userName, repositoryName, branch, statusCheckAdmin).<>(ProtectedBranch.tupled, ProtectedBranch.unapply) + def * = (userName, repositoryName, branch, statusCheckAdmin).mapTo[ProtectedBranch] def byPrimaryKey(userName: String, repositoryName: String, branch: String) = byBranch(userName, repositoryName, branch) def byPrimaryKey(userName: Rep[String], repositoryName: Rep[String], branch: Rep[String]) = @@ -20,7 +20,7 @@ with BranchTemplate { val context = column[String]("CONTEXT") def * = - (userName, repositoryName, branch, context).<>(ProtectedBranchContext.tupled, ProtectedBranchContext.unapply) + (userName, repositoryName, branch, context).mapTo[ProtectedBranchContext] } } diff --git a/src/main/scala/gitbucket/core/model/PullRequest.scala b/src/main/scala/gitbucket/core/model/PullRequest.scala index 7cf292d..570f5a7 100644 --- a/src/main/scala/gitbucket/core/model/PullRequest.scala +++ b/src/main/scala/gitbucket/core/model/PullRequest.scala @@ -25,7 +25,7 @@ commitIdFrom, commitIdTo, isDraft - ).<>(PullRequest.tupled, PullRequest.unapply) + ).mapTo[PullRequest] def byPrimaryKey(userName: String, repositoryName: String, issueId: Int) = byIssue(userName, repositoryName, issueId) diff --git a/src/main/scala/gitbucket/core/model/ReleaseAsset.scala b/src/main/scala/gitbucket/core/model/ReleaseAsset.scala index 93771ba..a63b41a 100644 --- a/src/main/scala/gitbucket/core/model/ReleaseAsset.scala +++ b/src/main/scala/gitbucket/core/model/ReleaseAsset.scala @@ -20,7 +20,7 @@ def * = (userName, repositoryName, tag, releaseAssetId, fileName, label, size, uploader, registeredDate, updatedDate) - .<>(ReleaseAsset.tupled, ReleaseAsset.unapply) + .mapTo[ReleaseAsset] def byPrimaryKey(owner: String, repository: String, tag: String, fileName: String) = byTag(owner, repository, tag) && (this.fileName === fileName.bind) def byTag(owner: String, repository: String, tag: String) = diff --git a/src/main/scala/gitbucket/core/model/ReleaseTag.scala b/src/main/scala/gitbucket/core/model/ReleaseTag.scala index 86c514e..f7665e3 100644 --- a/src/main/scala/gitbucket/core/model/ReleaseTag.scala +++ b/src/main/scala/gitbucket/core/model/ReleaseTag.scala @@ -15,8 +15,7 @@ val updatedDate = column[java.util.Date]("UPDATED_DATE") def * = - (userName, repositoryName, name, tag, author, content, registeredDate, updatedDate) - .<>(ReleaseTag.tupled, ReleaseTag.unapply) + (userName, repositoryName, name, tag, author, content, registeredDate, updatedDate).mapTo[ReleaseTag] def byPrimaryKey(owner: String, repository: String, tag: String) = byTag(owner, repository, tag) def byTag(owner: String, repository: String, tag: String) = byRepository(owner, repository) && (this.tag === tag.bind) diff --git a/src/main/scala/gitbucket/core/model/RepositoryWebHook.scala b/src/main/scala/gitbucket/core/model/RepositoryWebHook.scala index e2f7702..5aba110 100644 --- a/src/main/scala/gitbucket/core/model/RepositoryWebHook.scala +++ b/src/main/scala/gitbucket/core/model/RepositoryWebHook.scala @@ -14,8 +14,7 @@ val token = column[Option[String]]("TOKEN") val ctype = column[WebHookContentType]("CTYPE") def * = - (userName, repositoryName, hookId, url, ctype, token) - .<>((RepositoryWebHook.apply _).tupled, RepositoryWebHook.unapply) + (userName, repositoryName, hookId, url, ctype, token).mapTo[RepositoryWebHook] def byRepositoryUrl(owner: String, repository: String, url: String) = byRepository(owner, repository) && (this.url === url.bind) diff --git a/src/main/scala/gitbucket/core/model/RepositoryWebHookEvent.scala b/src/main/scala/gitbucket/core/model/RepositoryWebHookEvent.scala index 4165c67..105d9d6 100644 --- a/src/main/scala/gitbucket/core/model/RepositoryWebHookEvent.scala +++ b/src/main/scala/gitbucket/core/model/RepositoryWebHookEvent.scala @@ -12,7 +12,7 @@ val url = column[String]("URL") val event = column[WebHook.Event]("EVENT") def * = - (userName, repositoryName, url, event).<>((RepositoryWebHookEvent.apply _).tupled, RepositoryWebHookEvent.unapply) + (userName, repositoryName, url, event).mapTo[RepositoryWebHookEvent] def byRepositoryWebHook(owner: String, repository: String, url: String) = byRepository(owner, repository) && (this.url === url.bind) diff --git a/src/main/scala/gitbucket/core/model/SshKey.scala b/src/main/scala/gitbucket/core/model/SshKey.scala index 2abd149..d93b138 100644 --- a/src/main/scala/gitbucket/core/model/SshKey.scala +++ b/src/main/scala/gitbucket/core/model/SshKey.scala @@ -10,7 +10,7 @@ val sshKeyId = column[Int]("SSH_KEY_ID", O AutoInc) val title = column[String]("TITLE") val publicKey = column[String]("PUBLIC_KEY") - def * = (userName, sshKeyId, title, publicKey).<>(SshKey.tupled, SshKey.unapply) + def * = (userName, sshKeyId, title, publicKey).mapTo[SshKey] def byPrimaryKey(userName: String, sshKeyId: Int) = (this.userName === userName.bind) && (this.sshKeyId === sshKeyId.bind)