summaryrefslogtreecommitdiff
path: root/model
diff options
context:
space:
mode:
Diffstat (limited to 'model')
-rw-r--r--model/database.go2
-rw-r--r--model/sql/testdata.sql13
2 files changed, 14 insertions, 1 deletions
diff --git a/model/database.go b/model/database.go
index 8ce1897..fac4d35 100644
--- a/model/database.go
+++ b/model/database.go
@@ -38,7 +38,7 @@ func InitDatabase() {
log.Fatal(err)
}
- for _, v := range []string{`migrate`} {
+ for _, v := range []string{`migrate`, `testdata`} {
query, err := GetSql(v)
if err != nil {
log.Fatal(err)
diff --git a/model/sql/testdata.sql b/model/sql/testdata.sql
new file mode 100644
index 0000000..f2cd6e3
--- /dev/null
+++ b/model/sql/testdata.sql
@@ -0,0 +1,13 @@
+INSERT INTO 'recipes'
+ ('id', 'title', 'portions', 'url', 'notes')
+VALUES
+ (1, 'Pancakes', 4, 'https://example.org', 'Very fluffy'),
+ (2, 'Burger', 2, 'https://xengineering.eu/git/ceres', 'Delicious!')
+;
+
+INSERT INTO 'recipe_steps'
+ ('id', 'recipe_id', 'rank', 'text')
+VALUES
+ (1, 1, 1, 'Stir the dough'),
+ (2, 1, 2, 'Fry pancakes')
+;