From 06b317511deda44b0d06eef07efc2181dcd01f37 Mon Sep 17 00:00:00 2001 From: qowevisa Date: Tue, 19 Nov 2024 10:12:28 +0200 Subject: [PATCH] Add Metric entity to database schema --- db/db.go | 1 + db/metric.go | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 db/metric.go diff --git a/db/db.go b/db/db.go index 8caac5e..fe704a6 100644 --- a/db/db.go +++ b/db/db.go @@ -59,5 +59,6 @@ func Connect() *gorm.DB { gormDB.AutoMigrate(&Type{}) gormDB.AutoMigrate(&Session{}) gormDB.AutoMigrate(&Expense{}) + gormDB.AutoMigrate(&Metric{}) return newUDB } diff --git a/db/metric.go b/db/metric.go new file mode 100644 index 0000000..b39026e --- /dev/null +++ b/db/metric.go @@ -0,0 +1,10 @@ +package db + +import "gorm.io/gorm" + +type Metric struct { + gorm.Model + Value uint8 + Name string + Short string +}