summaryrefslogtreecommitdiff
path: root/model/database.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/database.go')
-rw-r--r--model/database.go8
1 files changed, 8 insertions, 0 deletions
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)
+ }
+}