Добавил версию pr

This commit is contained in:
upagge 2020-03-02 13:11:07 +03:00
parent 472782184c
commit 31ce2c6cd3
No known key found for this signature in database
GPG Key ID: 15CD012E46F6BA34
4 changed files with 17 additions and 16 deletions

View File

@ -49,6 +49,9 @@ public class PullRequest {
@Column(name = "repository_id")
private Long repositoryId;
@Column(name = "version")
private Integer version;
@ManyToOne
@JoinColumn(name = "author_login")
private User author;
@ -67,20 +70,4 @@ public class PullRequest {
@Column(name = "status")
private PullRequestStatus status;
// public void setReviewers(List<Reviewer> reviewers) {
// this.reviewers = reviewers;
// this.reviewers.forEach(reviewer -> reviewer.setPullRequest(this));
// }
//
// public PullRequest(Long bitbucketId, Long repositoryId, User author, List<Reviewer> reviewers, String url, String name, PullRequestStatus status) {
// this.bitbucketId = bitbucketId;
// this.repositoryId = repositoryId;
// this.author = author;
// this.reviewers = reviewers;
// this.url = url;
// this.name = name;
// this.status = status;
// this.reviewers.forEach(reviewer -> reviewer.setPullRequest(this));
// }
}

View File

@ -34,6 +34,7 @@ public class PullRequestJsonConverter implements Converter<PullRequestJson, Pull
public PullRequest convert(PullRequestJson json) {
return PullRequest.builder()
.bitbucketId(json.getId())
.version(json.getVersion())
.repositoryId(json.getFromRef().getRepository().getId())
.author(this.convertUser(json.getAuthor().getUser()))
.name(json.getTitle())

View File

@ -4,5 +4,6 @@
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
<include file="liquibase/change-set/create-table.xml"/>
<include file="liquibase/change-set/v1.2.0"/>
</databaseChangeLog>

View File

@ -0,0 +1,12 @@
<databaseChangeLog
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
<changeSet id="v1.2.0-add-atribute-pr" author="upagge">
<addColumn tableName="pull_request">
<column name="version" type="integer"/>
</addColumn>
</changeSet>
</databaseChangeLog>