Boa tarde, estou recebendo esse erro mas não encoontrei nenhuma propriedade address_line2 no meu codigo. alguém poderia me ajudar a achar esse erro?
java.sql.SQLSyntaxErrorException: Unknown column 'addressline2' in 'field list'
Minha coluna no banco de dados
*addressLine2 | varchar(100) | YES | | NULL | *
meu model
package med.voll.api.adress;
import jakarta.persistence.Embeddable;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
@Embeddable
@Getter
@NoArgsConstructor
@AllArgsConstructor
public class Adress {
private String streetAddress;
private String neighborhood;
private String zipCode;
private String city;
private String state;
private String addressLine2;
private String number;
public Adress(DataAdress adress) {
this.streetAddress = adress.streetAddress();
this.neighborhood = adress.neighborhood();
this.zipCode = adress.zipCode();
this.city = adress.city();
this.state = adress.state();
this.addressLine2 = adress.addressLine2();
this.number = adress.number();
}
}
meu record
package med.voll.api.adress;
public record DataAdress(
String streetAddress,
String neighborhood,
String zipCode,
String city,
String state,
String addressLine2,
String number
) {
}
Migration
create table doctors(
id bigint not null auto_increment,
name varchar(100) not null,
email varchar(100) not null unique,
crm varchar(6) not null unique,
specialty varchar(100) not null,
streetAddress varchar(100) not null,
neighborhood varchar(100) not null,
zipCode varchar(9) not null,
addressLine2 varchar(100),
number varchar(20),
state char(2) not null,
city varchar(100) not null,
primary key(id)
);