From 4928fd1f0c74705420c77454943fa8472cae4d07 Mon Sep 17 00:00:00 2001 From: AnthonyS Date: Mon, 20 May 2024 16:45:55 +0200 Subject: [PATCH] Aggiunte colonne posizione e confermato in vtb_viaggi --- .../model/Migration_20240520163553.java | 26 +++++++++++++++++++ .../integry/ems_model/entity/VtbViaggi.java | 24 +++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 ems-core/src/main/java/it/integry/ems/migration/model/Migration_20240520163553.java diff --git a/ems-core/src/main/java/it/integry/ems/migration/model/Migration_20240520163553.java b/ems-core/src/main/java/it/integry/ems/migration/model/Migration_20240520163553.java new file mode 100644 index 0000000000..01de62d1b1 --- /dev/null +++ b/ems-core/src/main/java/it/integry/ems/migration/model/Migration_20240520163553.java @@ -0,0 +1,26 @@ +package it.integry.ems.migration.model; + +import it.integry.ems.migration._base.BaseMigration; +import it.integry.ems.migration._base.MigrationModelInterface; + +public class Migration_20240520163553 extends BaseMigration implements MigrationModelInterface { + + @Override + public void up() throws Exception { + if (isHistoryDB()) + return; + + executeStatement( + "ALTER TABLE vtb_viaggi\n" + + " ADD posizione SMALLINT DEFAULT 0 NOT NULL;\n", + "ALTER TABLE vtb_viaggi\n" + + " ADD confermato BIT DEFAULT 0 NOT NULL;" + ); + } + + @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/VtbViaggi.java b/ems-core/src/main/java/it/integry/ems_model/entity/VtbViaggi.java index 184cde646b..1ab3c39d5b 100644 --- a/ems-core/src/main/java/it/integry/ems_model/entity/VtbViaggi.java +++ b/ems-core/src/main/java/it/integry/ems_model/entity/VtbViaggi.java @@ -53,6 +53,12 @@ public class VtbViaggi extends EntityBase { @SqlField(value = "mezzo", maxLength = 1, defaultObjectValue = "0") private Mezzo mezzo; + @SqlField(value = "posizione", defaultObjectValue = "0") + private short posizione; + + @SqlField(value = "confermato", defaultObjectValue = "0") + private boolean confermato; + public VtbViaggi() { super(); } @@ -141,6 +147,24 @@ public class VtbViaggi extends EntityBase { return this; } + public short getPosizione() { + return posizione; + } + + public VtbViaggi setPosizione(short posizione) { + this.posizione = posizione; + return this; + } + + public boolean isConfermato() { + return confermato; + } + + public VtbViaggi setConfermato(boolean confermato) { + this.confermato = confermato; + return this; + } + public enum Mezzo implements IBaseEnum { VETTORE((short) 0), MITTENTE((short) 1), DESTINATARIO((short) 2);