Skip to content

Commit

Permalink
Merged in fix_flyway (pull request DSpace#2029)
Browse files Browse the repository at this point in the history
H2's function names are case sensitive

* H2's function names are case sensitive

* H2's function names are case sensitive

* Remove idx on substring for H2 as it is not supported
  • Loading branch information
abollini committed Apr 16, 2024
1 parent d926d83 commit b9664af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ public int saveAffectedItemsForUpdate(Context context, UUID uuid) {
+ " SELECT dspace_object_id FROM metadatavalue " + " WHERE metadata_field_id IN"
+ " ( SELECT metadata_field_id FROM metadatafieldregistry "
+ " WHERE metadata_schema_id = :schema AND element = 'virtualsource')"
+ " AND substring(text_value,1,36) = :uuid)";
+ " AND SUBSTRING(text_value,1,36) = :uuid)";
String sqlInsert =
"INSERT INTO itemupdate_metadata_enhancement (uuid, date_queued)"
+ " SELECT DISTINCT dspace_object_id, CURRENT_TIMESTAMP FROM metadatavalue "
+ " WHERE metadata_field_id IN"
+ " ( SELECT metadata_field_id FROM metadatafieldregistry "
+ " WHERE metadata_schema_id = :schema AND element = 'virtualsource')"
+ " AND substring(text_value,1,36) = :uuid "
+ " AND SUBSTRING(text_value,1,36) = :uuid "
+ " AND dspace_object_id NOT IN ("
+ " SELECT uuid"
+ " FROM itemupdate_metadata_enhancement"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@
-- Create INDEXES to optimize exact query over the metadatavalue
-----------------------------------------------------------------------------------

CREATE INDEX idx_text_value_hash ON metadatavalue (substring(text_value,1,36));
-- we cannot create the idx related to the text_value substring in H2 as index on
-- expression are not supported, see https://github.com/h2database/h2database/issues/3535
-- CREATE INDEX idx_text_value_hash ON metadatavalue (SUBSTRING(text_value,1,36));
CREATE INDEX idx_authority_hash ON metadatavalue (authority);

0 comments on commit b9664af

Please sign in to comment.