Skip to content

Commit

Permalink
feat(indexing): Update tenant_id in database during event processing (#…
Browse files Browse the repository at this point in the history
…730)

Closes: MSEARCH-877

(cherry picked from commit 3e306ed)
  • Loading branch information
psmagin committed Jan 8, 2025
1 parent 15c988c commit 0103790
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
## v4.0.6 2025-01-08
### Bug fixes
* Update tenant_id in database during event processing ([MSEARCH-877](https://folio-org.atlassian.net/browse/MSEARCH-877))
* Fix an issue with interrupting the batch event processing due to SystemUserAuthorizationException ([MSEARCH-925](https://folio-org.atlassian.net/browse/MSEARCH-925))

### Tech Dept
* Recreate upload ranges each upload execution ([MSEARCH-934](https://folio-org.atlassian.net/browse/MSEARCH-934))
* Fix an issue with interrupting the batch event processing due to SystemUserAuthorizationException ([MSEARCH-925](https://folio-org.atlassian.net/browse/MSEARCH-925))

## v4.0.5 2025-01-03
### Bug fixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class HoldingRepository extends MergeRangeRepository {
ON CONFLICT (id, tenant_id)
DO UPDATE SET
instance_id = EXCLUDED.instance_id,
tenant_id = EXCLUDED.tenant_id,
json = EXCLUDED.json;
""";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ ON CONFLICT (id, tenant_id)
DO UPDATE SET
instance_id = EXCLUDED.instance_id,
holding_id = EXCLUDED.holding_id,
tenant_id = EXCLUDED.tenant_id,
json = EXCLUDED.json;
""";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class MergeInstanceRepository extends MergeRangeRepository {
VALUES (?::uuid, ?, ?, ?, ?::jsonb)
ON CONFLICT (id)
DO UPDATE SET shared = EXCLUDED.shared,
tenant_id = EXCLUDED.tenant_id,
is_bound_with = EXCLUDED.is_bound_with,
json = EXCLUDED.json;
""";
Expand Down Expand Up @@ -79,6 +80,6 @@ public void saveEntities(String tenantId, List<Map<String, Object>> entities) {
public void updateBoundWith(String tenantId, String id, boolean bound) {
var fullTableName = getFullTableName(context, entityTable());
var sql = UPDATE_BOUND_WITH_SQL.formatted(fullTableName);
jdbcTemplate.update(sql, bound /*? "true" : "false"*/, id);
jdbcTemplate.update(sql, bound, id);
}
}

0 comments on commit 0103790

Please sign in to comment.