migration per textiles
Some checks failed
IntegryManagementSystem_Multi/pipeline/head There was a failure building this commit
Some checks failed
IntegryManagementSystem_Multi/pipeline/head There was a failure building this commit
This commit is contained in:
@@ -0,0 +1,22 @@
|
|||||||
|
package it.integry.ems.migration.model;
|
||||||
|
|
||||||
|
import it.integry.ems.migration._base.BaseMigration;
|
||||||
|
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||||
|
|
||||||
|
public class Migration_20250924151610 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
|
||||||
|
createSetupQuery("COD_PROMO_TAGLI", "Query per selezionare i tagli prezzo", "SELECT COD_PROMO FROM VTB_PROMO WHERE flag_tipo_promo = 'T'");
|
||||||
|
executeStatement("update stb_gest_setup\n" +
|
||||||
|
"set query_default = 'c' where gest_name = 'pvm' and section = 'CHIUSURA_TAGLI_PREZZO'\n" +
|
||||||
|
"and key_section ='COD_PROMO_TAGLI' ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void down() throws Exception {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package it.integry.ems.migration.model;
|
||||||
|
|
||||||
|
import it.integry.ems.migration._base.BaseMigration;
|
||||||
|
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||||
|
|
||||||
|
public class Migration_20250925133902 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!isTextiles()) return;
|
||||||
|
|
||||||
|
|
||||||
|
executeStatement(
|
||||||
|
"alter table ttb_grtg_el add range_taglie tinyint DEFAULT 1; ",
|
||||||
|
"update ttb_grtg_el set range_taglie = 1; ",
|
||||||
|
"alter table ttb_grtg_el alter column range_taglie tinyint NOT NULL; ",
|
||||||
|
"create table ttb_qta_min_ord ( " +
|
||||||
|
" cod_style varchar(15) not null, " +
|
||||||
|
" cod_grtg varchar(5) not null, " +
|
||||||
|
" range_taglie tinyint not null, " +
|
||||||
|
" qta_min_ord numeric(20,5) not null default 0) ",
|
||||||
|
"alter table ttb_qta_min_ord ADD constraint pk_ttb_qta_min_ord primary key (cod_style, cod_grtg, range_taglie, qta_min_ord); ",
|
||||||
|
"ALTER TABLE dbo.ttb_qta_min_ord WITH CHECK ADD CONSTRAINT fk_ttb_qta_min_ord_ttb_style FOREIGN KEY(cod_style) REFERENCES dbo.ttb_style ( cod_style )",
|
||||||
|
"ALTER TABLE dbo.ttb_qta_min_ord WITH CHECK ADD CONSTRAINT fk_ttb_qta_min_ord_ttb_grtg FOREIGN KEY(cod_grtg) REFERENCES dbo.ttb_grtg ( cod_grtg )");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void down() throws Exception {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package it.integry.ems.migration.model;
|
||||||
|
|
||||||
|
import it.integry.ems.migration._base.BaseMigration;
|
||||||
|
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||||
|
|
||||||
|
public class Migration_20250925151323 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
if (!isTextiles()) return;
|
||||||
|
|
||||||
|
executeStatement(
|
||||||
|
"drop table ttb_qta_min_ord",
|
||||||
|
"create table ttb_qta_min_ord (\n" +
|
||||||
|
" id bigint identity,\n" +
|
||||||
|
" cod_line varchar(5),\n" +
|
||||||
|
" cod_style varchar(15),\n" +
|
||||||
|
" cod_grtg varchar(5) not null,\n" +
|
||||||
|
" range_taglie tinyint not null,\n" +
|
||||||
|
" qta_min_ord numeric(20,5) not null default 0)",
|
||||||
|
"alter table ttb_qta_min_ord ADD constraint pk_ttb_qta_min_ord primary key (id);",
|
||||||
|
"create unique index ix_unique_ttb_qta_min_ord on ttb_qta_min_ord (cod_line, cod_style, cod_grtg);",
|
||||||
|
"ALTER TABLE dbo.ttb_qta_min_ord WITH CHECK ADD CONSTRAINT fk_ttb_qta_min_ord_ttb_style FOREIGN KEY(cod_style) REFERENCES dbo.ttb_style ( cod_style )",
|
||||||
|
"ALTER TABLE dbo.ttb_qta_min_ord WITH CHECK ADD CONSTRAINT fk_ttb_qta_min_ord_ttb_grtg FOREIGN KEY(cod_grtg) REFERENCES dbo.ttb_grtg ( cod_grtg )");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void down() throws Exception {
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user