I want to update an existing model with an @OrderColumn
. Because there already exists data in the table, I'd like to make it nullable
, which is the default value.
@ManyToMany(fetch = FetchType.EAGER)
@OrderColumn(name = "widget_order", nullable = true)
private List<Widget> widgets = new ArrayList<>();
The update however fails with the message:
org.hibernate.tool.schema.spi.SchemaManagementException:
Unable to execute schema management to JDBC target
[alter table Dashboard_Widget add widget_order number(10,0) not null]
Why does hibernate still try to make the order column not nullable and what do I need to do to fix it?