summaryrefslogtreecommitdiff
path: root/model/database.go
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-05-09 22:33:42 +0200
committerxengineering <me@xengineering.eu>2024-05-09 22:37:03 +0200
commit0ac3cc76b4b6c824c4b3f7a357d40b487984abfb (patch)
tree5391e5f27b344d9eab288876052ec63a2f97db72 /model/database.go
parent0142af99aba36241c276a56a088e7aac10c62f86 (diff)
downloadceres-0ac3cc76b4b6c824c4b3f7a357d40b487984abfb.tar
ceres-0ac3cc76b4b6c824c4b3f7a357d40b487984abfb.tar.zst
ceres-0ac3cc76b4b6c824c4b3f7a357d40b487984abfb.zip
Inject examples only with new --example flag
The default use case should be to not inject example recipes.
Diffstat (limited to 'model/database.go')
-rw-r--r--model/database.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/model/database.go b/model/database.go
index 85d2662..f5fd67a 100644
--- a/model/database.go
+++ b/model/database.go
@@ -149,8 +149,8 @@ func MigrateDatabase(execVersion string) {
}
}
-func InjectTestRecipes() {
- Transaction(func(tx *sql.Tx) error {
+func InjectExampleRecipes() {
+ err := Transaction(func(tx *sql.Tx) error {
recipes := RecipeTestData()
for _, recipe := range recipes {
@@ -162,6 +162,9 @@ func InjectTestRecipes() {
return nil
})
+ if err != nil {
+ log.Fatalf("Failed to inject example recipes: %v", err)
+ }
}
func DisconnectDatabase() {