I want to generate a changelog file automatically via one of the maven liquibase plugin commands. The changelog should include a changeset for creating a database table for the DiscountCode entity. Would diff be the correct plugin command for this case?
@Entity
@Table(name = "discount_code")
public class DiscountCode {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long discountId;
private String discountCode;
private LocalDate expiration;
private BigDecimal discountValue;
public DiscountCode() {}
public DiscountCode(String discountCode, LocalDate expiration, BigDecimal discountValue) {
this.discountCode = discountCode;
this.expiration = expiration;
this.discountValue = discountValue;
}
public Long getDiscountId() {
return discountId;
}
public void setDiscountId(Long discountId) {
this.discountId = discountId;
}
public String getDiscountCode() {
return discountCode;
}
public void setDiscountCode(String discountCode) {
this.discountCode = discountCode;
}
public LocalDate getExpiration() {
return expiration;
}
public void setExpiration(LocalDate expiration) {
this.expiration = expiration;
}
public BigDecimal getDiscountValue() {
return discountValue;
}
public void setDiscountValue(BigDecimal discountValue) {
this.discountValue = discountValue;
}
@Override
public String toString() {
return (
"DiscountCode{" +
"discountId=" +
discountId +
", discountCode='" +
discountCode +
'\'' +
", expiration=" +
expiration +
", discountValue=" +
discountValue +
'}'
);
}
}
