diff --git a/ems-core/src/main/java/it/integry/ems/migration/model/Migration_20251201090147.java b/ems-core/src/main/java/it/integry/ems/migration/model/Migration_20251201090147.java new file mode 100644 index 0000000000..ed55f7114d --- /dev/null +++ b/ems-core/src/main/java/it/integry/ems/migration/model/Migration_20251201090147.java @@ -0,0 +1,19 @@ +package it.integry.ems.migration.model; + +import it.integry.ems.migration._base.BaseMigration; +import it.integry.ems.migration._base.MigrationModelInterface; + +public class Migration_20251201090147 extends BaseMigration implements MigrationModelInterface { + + @Override + public void up() throws Exception { + if (isHistoryDB()) + return; + + executeStatement("alter table ctb_cont add flag_attivo bit not null default 1"); + } + + @Override + public void down() throws Exception { + } +} \ No newline at end of file diff --git a/ems-core/src/main/java/it/integry/ems_model/entity/CtbCont.java b/ems-core/src/main/java/it/integry/ems_model/entity/CtbCont.java index a5d481e91d..ffe2ca07ad 100644 --- a/ems-core/src/main/java/it/integry/ems_model/entity/CtbCont.java +++ b/ems-core/src/main/java/it/integry/ems_model/entity/CtbCont.java @@ -74,6 +74,9 @@ public class CtbCont extends EntityBase { @SqlField(value = "data_mod", defaultObjectValue = CommonConstants.TIMESTAMP) private Date dataMod; + @SqlField(value = "flag_attivo", nullable = false, defaultObjectValue = "1") + private Boolean flagAttivo; + public CtbCont() { super(logger); } @@ -201,6 +204,15 @@ public class CtbCont extends EntityBase { return this; } + public Boolean getFlagAttivo() { + return flagAttivo; + } + + public CtbCont setFlagAttivo(Boolean flagAttivo) { + this.flagAttivo = flagAttivo; + return this; + } + @Override protected void deleteChilds() throws Exception { String sql = Query.format(