Skip to content

Conversation

@sebersole
Copy link
Member

@sebersole sebersole commented Dec 17, 2025

HHH-5247 - Support indexes and unique-keys in schema validator


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


https://hibernate.atlassian.net/browse/HHH-5247

Copy link
Member

@beikov beikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

ExecutionOptions options,
Dialect dialect) {
var validationType = ConstraintValidationType.interpret( UNIQUE_KEY_VALIDATION, options.getConfigurationValues() );

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe move this check up?

Suggested change
if ( validationType == ConstraintValidationType.NONE ) {
return;
}

ExecutionOptions options,
Dialect dialect) {
var validationType = ConstraintValidationType.interpret( INDEX_VALIDATION, options.getConfigurationValues() );

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe move this check up?

Suggested change
if ( validationType == ConstraintValidationType.NONE ) {
return;
}

fail( "Not expecting an exception" );
}
}
updateSchema( schema5, schemaTooling, registry );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to fail on Oracle because it can't match the index with the generated name IDX6vwh1addgrj8v4h4od0bey3th for persons (name) against the person_name index on the same column. Just wanted to give you this hint as I looked into the failure report.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not following. You mean with the ALL param? In that case, we are expecting a failure for exactly that reason.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, you mean on the schema-update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants