Merge branch 'RED-10660' into 'master'

Migration fixes & RED-10660

Closes RED-10660

See merge request redactmanager/persistence-service!916
This commit is contained in:
Dominique Eifländer 2025-01-13 09:07:52 +01:00
commit 25eb72ee05
2 changed files with 40 additions and 0 deletions

View File

@ -39,6 +39,11 @@ public class AppVersionTracker {
return;
}
if (appVersion.isBlank() || layoutParserVersion.isBlank()) {
log.info("No app version or layout parser version was provided. Version tracking skipped. ");
return;
}
TenantContext.setTenantId(tenant.getTenantId());
try {

View File

@ -0,0 +1,35 @@
package com.iqser.red.service.persistence.management.v1.processor.migration.migrations;
import org.springframework.stereotype.Service;
import com.iqser.red.service.persistence.management.v1.processor.migration.Migration;
import com.iqser.red.service.persistence.management.v1.processor.migration.RankDeDuplicationService;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Service
public class V32RankDeduplicationMigration extends Migration {
private static final String NAME = "Adding to the migration the rank de-duplication";
private static final long VERSION = 32;
private final RankDeDuplicationService rankDeDuplicationService;
public V32RankDeduplicationMigration(RankDeDuplicationService rankDeDuplicationService) {
super(NAME, VERSION);
this.rankDeDuplicationService = rankDeDuplicationService;
}
@Override
protected void migrate() {
log.info("Migration: Checking for duplicate ranks");
rankDeDuplicationService.deduplicate();
}
}