Schema validation: column defined as not-null in the database, but nullable in model

Hi!

After switching from 7.2.0.Final to 7.2.1.Final the app is not able to boot anymore.

Root exception is:

Caused by:
org.hibernate.tool.schema.spi.SchemaManagementException:
Schema validation:
column defined as not-null in the database, but nullable in model
- [scheduled_price_update_id] in table [price_update_report_item]

Just tried to add non-null annotation, but it didn’t help:

@Entity @NoArgsConstructor @Getter @ToString
public class PriceUpdateReportItem extends BaseEntity {

	@Reference
	@JsonBackReference
	@ManyToOne(fetch = FetchType.LAZY)

//	@org.springframework.lang.NonNull
//	@jakarta.annotation.Nonnull
//	@javax.annotation.Nonnull

	private PriceUpdateReport scheduledPriceUpdate;

	...

}

Class property `scheduledPriceUpdate` should always be set because it’s a parent and instance has no sense without a parent.

What would be the solution? I rolled back to 7.2.0 and it’s not urgent thing to upgrade to 7.2.1 so I can wait as long as needed to make a decent fix.

Full log: https://horvoje.net/tmp/hibernate.log

Thanks!

BR,
Hrvoje

Stupid me!

@JoinColumn(nullable = false)