Allineamento dati Auricchio, levanplast e agricoper per cambio chiave mtb_aart_anag
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:
@@ -1,15 +1,34 @@
|
||||
package it.integry.ems.migration.model;import it.integry.ems.migration._base.BaseMigration;
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251212130317 extends BaseMigration implements MigrationModelInterface{
|
||||
public class Migration_20251212130317 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up()throws Exception {
|
||||
if(isHistoryDB())
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomer(IntegryCustomer.Auricchio) || isCustomer(IntegryCustomer.Levanplast) || isCustomer(IntegryCustomer.Agricoper) || isCustomerDb(IntegryCustomerDB.Auricchio_Ind05)){
|
||||
executeStatement("delete from mtb_aart_anag\n" +
|
||||
"from \n" +
|
||||
"(select mtb_aart_anag.cod_anag,\n" +
|
||||
"\t\tmtb_aart_anag.cod_mart, \n" +
|
||||
"\t\tmax(id) as id\n" +
|
||||
"from (select cod_anag, cod_mart, row_number() over (partition by cod_anag, cod_mart order by cod_anag, cod_mart) as riga \n" +
|
||||
"\t\tfrom dbo.mtb_aart_anag\t\t\n" +
|
||||
"\t\t)error inner join mtb_aart_anag on mtb_aart_anag.cod_anag = error.cod_anag and\n" +
|
||||
"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmtb_aart_anag.cod_mart = error.cod_mart\n" +
|
||||
"where riga > 1\n" +
|
||||
"group by mtb_aart_anag.cod_anag,\n" +
|
||||
"\t\tmtb_aart_anag.cod_mart)rowDelete inner join mtb_aart_anag on rowDelete.id = mtb_aart_anag.id");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down()throws Exception {
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user