From ddc6e8e1fb8a4b1dfe8421b12e40b15162ae75f1 Mon Sep 17 00:00:00 2001
From: xengineering <me@xengineering.eu>
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/sql/migrate.sql | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

(limited to 'model/sql/migrate.sql')

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)
 );
-- 
cgit v1.2.3-70-g09d2

