From ddc6e8e1fb8a4b1dfe8421b12e40b15162ae75f1 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 10 Mar 2024 10:59:23 +0100 Subject: model: Add recipe steps This provides the infrastructure to create views and HTTP handlers to provide recipe steps. --- model/database.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'model/database.go') diff --git a/model/database.go b/model/database.go index 22a924a..7021181 100644 --- a/model/database.go +++ b/model/database.go @@ -38,6 +38,7 @@ func InitDatabase() { log.Fatal(err) } + // FIXME roll back migration on error query, err := GetSql(`migrate`) if err != nil { log.Fatal(err) @@ -67,3 +68,10 @@ func CloseDatabase() { log.Println("Closed database") } } + +func rollback(tx *sql.Tx) { + err := tx.Rollback() + if err != nil { + log.Printf("Failed to rollback transaction: %v\n", err) + } +} -- cgit v1.2.3-70-g09d2