From 3f4c53c6ccb70536cf124dcfb4dccfa49d3dfd3a Mon Sep 17 00:00:00 2001 From: "gowthaman.b" Date: Sun, 28 Apr 2024 19:30:30 +0530 Subject: [PATCH] add some more cols --- src/main/kotlin/com/restapi/domain/models.kt | 14 +++++++++++--- src/main/resources/dbmigration/1.25.sql | 3 +++ .../resources/dbmigration/model/1.25.model.xml | 9 +++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 src/main/resources/dbmigration/1.25.sql create mode 100644 src/main/resources/dbmigration/model/1.25.model.xml diff --git a/src/main/kotlin/com/restapi/domain/models.kt b/src/main/kotlin/com/restapi/domain/models.kt index 2912aaf..ae44333 100644 --- a/src/main/kotlin/com/restapi/domain/models.kt +++ b/src/main/kotlin/com/restapi/domain/models.kt @@ -7,14 +7,18 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize import io.ebean.Model import io.ebean.annotation.* import io.ebean.annotation.Index -import org.openxmlformats.schemas.wordprocessingml.x2006.main.STRestartNumber import java.time.LocalDate import java.time.LocalDateTime import javax.persistence.* data class Comments(val text: String = "", val by: String = "", val at: LocalDateTime = LocalDateTime.now()) data class POProducts( - val productId: String = "", val productName: String = "", val unitPrice: Double = 0.0, val quantity: Double = 0.0, val description: String = "" + val productId: String = "", + val productName: String = "", + val unitPrice: Double = 0.0, + val quantity: Double = 0.0, + val description: String = "", + val uom: String = "", ) @@ -413,6 +417,8 @@ open class IncomingInventory : BaseTenantModel() { this.vehicle = updated.vehicle this.products = updated.products this.vendor = updated.vendor + this.loading = updated.loading + this.unloading = updated.unloading } var mrn: String? = null @@ -420,6 +426,8 @@ open class IncomingInventory : BaseTenantModel() { var vendorBillNum: String? = null var vendorBillAmount: Double = 0.0 var vehicle: String = "" + var loading: String? = "" + var unloading: String? = "" @DbJsonB var products: List? = null @@ -632,7 +640,7 @@ open class ReminderLog : BaseTenantModel() { } @Entity -@Index(name="plantid_idx", columnNames = ["plant_id"], unique = true) +@Index(name = "plantid_idx", columnNames = ["plant_id"], unique = true) open class Plant : BaseModel() { var plantId: String = "" var plantName: String = "" diff --git a/src/main/resources/dbmigration/1.25.sql b/src/main/resources/dbmigration/1.25.sql new file mode 100644 index 0000000..9142718 --- /dev/null +++ b/src/main/resources/dbmigration/1.25.sql @@ -0,0 +1,3 @@ +-- apply alter tables +alter table incoming_inventory add column if not exists loading varchar(255); +alter table incoming_inventory add column if not exists unloading varchar(255); diff --git a/src/main/resources/dbmigration/model/1.25.model.xml b/src/main/resources/dbmigration/model/1.25.model.xml new file mode 100644 index 0000000..878d3b8 --- /dev/null +++ b/src/main/resources/dbmigration/model/1.25.model.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file