Merge branch 'master' into develop
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
import it.integry.ems_model.entity.StbGestSetup;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
import it.integry.ems_model.utility.UtilityList;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class Migration_20251110184508 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
String sql = "SELECT DISTINCT wgsu.gest_name, wgsu.section, wgsu.key_section, 'S' AS flag_setup_user_web\n" +
|
||||
"FROM wtb_gest_setup_user wgsu\n" +
|
||||
"WHERE NOT EXISTS(SELECT sgs.gest_name, sgs.section, sgs.key_section\n" +
|
||||
" FROM stb_gest_setup sgs\n" +
|
||||
" WHERE wgsu.gest_name = sgs.gest_name\n" +
|
||||
" AND wgsu.section = sgs.section\n" +
|
||||
" AND wgsu.key_section = sgs.key_section)";
|
||||
|
||||
List<StbGestSetup> stbGestSetupsToCreate = UtilityDB.executeSimpleQueryDTO(connection, sql, StbGestSetup.class);
|
||||
|
||||
if (UtilityList.isNullOrEmpty(stbGestSetupsToCreate)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (StbGestSetup stbGestSetup : stbGestSetupsToCreate) {
|
||||
stbGestSetup.setOperation(OperationType.INSERT);
|
||||
|
||||
stbGestSetup.manageWithParentConnection(connection);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user