aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormrfoxygmfr <mrfoxygmfr@sch9.ru>2025-03-23 14:48:27 +0300
committermrfoxygmfr <mrfoxygmfr@sch9.ru>2025-03-23 14:48:27 +0300
commit5b0b6fc434659f13c0ff1f898c4b5d7ce136d992 (patch)
treed659f9ff98e65e3d276df097937ba6e03bf73d0a
parentcad2254f0eaf770a169432296916a2acafe18b4a (diff)
fix(db): add forgotten name to product
-rw-r--r--src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/Product.java4
-rw-r--r--src/main/sql/1_create-database.up.sql1
2 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/Product.java b/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/Product.java
index d2e31f0..5211eaf 100644
--- a/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/Product.java
+++ b/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/Product.java
@@ -20,6 +20,10 @@ public class Product {
@Column(nullable = false, name = "id")
private int id;
+ @Column(nullable = false, name = "name")
+ @NonNull
+ private String name;
+
@Column(nullable = false, name = "type")
@Enumerated(EnumType.STRING)
@NonNull
diff --git a/src/main/sql/1_create-database.up.sql b/src/main/sql/1_create-database.up.sql
index c1a63f4..c9179de 100644
--- a/src/main/sql/1_create-database.up.sql
+++ b/src/main/sql/1_create-database.up.sql
@@ -1,5 +1,6 @@
CREATE TABLE products(
id INTEGER PRIMARY KEY,
+ name TEXT NOT NULL,
type TEXT NOT NULL,
height INTEGER NOT NULL,
width INTEGER NOT NULL,