RED-8727 - Add rank de-duplication to migration

- add RankDeDuplicationMigration16

Signed-off-by: Corina Olariu <corina.olariu.ext@knecon.com>
This commit is contained in:
Corina Olariu 2024-03-14 11:35:44 +02:00
parent dc7dfe4f3e
commit 5ce82d90e5

View File

@ -0,0 +1,41 @@
package com.iqser.red.service.persistence.management.v1.processor.migration.migrations;
import org.springframework.beans.factory.annotation.Autowired;
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.Setter;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Setter
@Service
public class RankDeDuplicationMigration16 extends Migration {
@Autowired
private RankDeDuplicationService rankDeDuplicationService;
public RankDeDuplicationMigration16() {
super(NAME, VERSION);
}
private static final String NAME = "Adding to the migration the rank de-duplication";
private static final long VERSION = 16;
@Override
/*
* In cases were we have duplicate ranks for entities, this needs to be fixed
*/ protected void migrate() {
log.info("Migration: Checking for duplicate ranks");
rankDeDuplicationService.deduplicate();
}
}