Creazione nuove tabelle per scheda tecnica

This commit is contained in:
2024-07-05 15:08:58 +02:00
parent 5ef4cf2ff5
commit 9f66f92984

View File

@@ -0,0 +1,42 @@
package it.integry.ems.migration.model;
import it.integry.ems.migration._base.BaseMigration;
import it.integry.ems.migration._base.MigrationModelInterface;
public class Migration_20240705103421 extends BaseMigration implements MigrationModelInterface {
@Override
public void up() throws Exception {
if (isHistoryDB())
return;
executeStatement("create table mtb_sch_tec_var \n" +
"(cod_var varchar(5) not null,\n" +
"descrizione varchar(255) null ) ",
"alter table mtb_sch_tec_var add constraint pk_mtb_sch_tec_var primary key (cod_var) ",
"create table mtb_sch_tec_sett\n" +
"(cod_sch varchar(5) not null,\n" +
"descrizione varchar(255) null ) ",
"alter table mtb_sch_tec_sett add constraint pk_mtb_sch_tec_sett primary key (cod_sch) ",
"create table mtb_sch_tec_setr\n" +
"(cod_sch varchar(5) not null,\n" +
"cod_var varchar(5) not null,\n" +
"descrizione varchar(8000) not null, \n" +
"descrizione_eng varchar(8000) null) ",
"alter table mtb_sch_tec_setr add constraint pk_mtb_sch_tec_setr primary key (cod_sch, cod_var) ",
"alter table mtb_sch_tec_setr ADD CONSTRAINT fk_mtb_sch_tec_setr_mtb_sch_tec_sett FOREIGN KEY (cod_sch) REFERENCES mtb_sch_tec_sett(cod_sch) ",
"alter table mtb_sch_tec_setr ADD CONSTRAINT fk_mtb_sch_tec_setr_mtb_sch_tec_var FOREIGN KEY (cod_var) REFERENCES mtb_sch_tec_var(cod_var); ");
}
@Override
public void down() throws Exception {
}
}