I am getting PK violation (with initial data in data.sql) in spring boot and after investigation I found that if I downgrade the version in pom.xml from 2.7 into 2.6.7 then everything works. I am using H2 database
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.0</version> <!-- will not work -->
<!-- <version>2.6.7</version> will work -->
<relativePath/> <!-- lookup parent from repository -->
</parent>
and here is the entity
@MappedSuperclass
public class BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID")
private Long id;
}
What is the changes? what am I missing ?