#42 rename birth_date column

This commit is contained in:
T-Midnight 2019-04-11 21:37:24 +04:00
parent e8461e26eb
commit f7d766f02d
3 changed files with 14 additions and 14 deletions

View File

@ -85,9 +85,9 @@ public class User extends BaseEntity {
@BatchSize(size = 20)
private Set<UserRole> roles;
@Column(name = "birth_year")
@Column(name = "birth_date")
@Temporal(TemporalType.TIMESTAMP)
private Date birthYear;
private Date birthDate;
public enum UserDegree {
CANDIDATE("Кандидат технических наук"),
@ -211,12 +211,12 @@ public class User extends BaseEntity {
this.patronymic = patronymic;
}
public Date getBirthYear() {
return birthYear;
public Date getBirthDate() {
return birthDate;
}
public void setBirthYear(Date birthYear) {
this.birthYear = birthYear;
public void setBirthDate(Date birthDate) {
this.birthDate = birthDate;
}
public UserDegree getDegree() {

View File

@ -71,7 +71,7 @@ public class UserDto implements OdinDto {
@Size(min = Constants.MIN_PASSWORD_LENGTH, max = 50)
private String passwordConfirm;
private Date birthYear;
private Date birthDate;
private User.UserDegree degree;
@ -91,7 +91,7 @@ public class UserDto implements OdinDto {
this.roles.addAll(user.getRoles().stream()
.map(UserRoleDto::new)
.collect(Collectors.toList()));
this.birthYear = user.getBirthYear();
this.birthDate = user.getBirthDate();
this.degree = user.getDegree();
}
@ -170,12 +170,12 @@ public class UserDto implements OdinDto {
return passwordConfirm;
}
public Date getBirthYear() {
return birthYear;
public Date getBirthDate() {
return birthDate;
}
public void setBirthYear(Date birthYear) {
this.birthYear = birthYear;
public void setBirthDate(Date birthDate) {
this.birthDate = birthDate;
}
public User.UserDegree getDegree() {
@ -211,7 +211,7 @@ public class UserDto implements OdinDto {
", roles=" + roles +
", password='" + password + '\'' +
", passwordConfirm='" + passwordConfirm + '\'' +
", birthYear='" + birthYear + '\'' +
", birthDate='" + birthDate + '\'' +
", degree='" + degree + '\'' +
'}';
}

View File

@ -4,7 +4,7 @@
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
<changeSet author="tanya" id="20190404_000000-1">
<addColumn tableName="users">
<column name="birth_year" type="timestamp"></column>
<column name="birth_date" type="timestamp"></column>
</addColumn>
<addColumn tableName="users">
<column name="degree" type="varchar(255)"></column>