summaryrefslogtreecommitdiff
path: root/model/sql/migrate.sql
diff options
context:
space:
mode:
Diffstat (limited to 'model/sql/migrate.sql')
-rw-r--r--model/sql/migrate.sql14
1 files changed, 12 insertions, 2 deletions
diff --git a/model/sql/migrate.sql b/model/sql/migrate.sql
index c548724..9577dab 100644
--- a/model/sql/migrate.sql
+++ b/model/sql/migrate.sql
@@ -1,9 +1,19 @@
+PRAGMA foreign_keys = ON;
+
CREATE TABLE recipes (
id INTEGER PRIMARY KEY,
title TEXT NOT NULL,
portions INTEGER NOT NULL,
url TEXT NOT NULL,
notes TEXT NOT NULL,
- created INTEGER NOT NULL, -- unix timestamp
- last_changed INTEGER NOT NULL -- unix timestamp
+ created INTEGER NOT NULL, -- Unix time stamp
+ last_changed INTEGER NOT NULL -- Unix time stamp
+);
+
+CREATE TABLE steps (
+ id INTEGER PRIMARY KEY,
+ recipe INTEGER NOT NULL,
+ 'index' INTEGER NOT NULL,
+ text TEXT NOT NULL,
+ FOREIGN KEY(recipe) REFERENCES recipes(id)
);