From 1d6b45bebea66391a2a535a3bb328a5732aaa75d Mon Sep 17 00:00:00 2001
From: xengineering <me@xengineering.eu>
Date: Sat, 5 Nov 2022 21:25:31 +0100
Subject: Add existing work

---
 sql/0002_migration.sql | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 sql/0002_migration.sql

(limited to 'sql/0002_migration.sql')

diff --git a/sql/0002_migration.sql b/sql/0002_migration.sql
new file mode 100644
index 0000000..7c99616
--- /dev/null
+++ b/sql/0002_migration.sql
@@ -0,0 +1,25 @@
+
+--------------------------------------------------------------------------------
+
+-- This migration creates the initial version of the database layout.
+
+-- Run this command as Linux user `ceres` with this command:
+-- `mariadb < 0002_migration.sql`.
+
+-- set database for this script
+USE ceres;
+
+-- create recipe table
+CREATE TABLE IF NOT EXISTS recipes (
+	id INT UNSIGNED PRIMARY KEY NOT NULL AUTO_INCREMENT,
+	title varchar(80) NOT NULL DEFAULT '(no title)',
+	upstream_url varchar(200) NOT NULL DEFAULT '',
+	description_markdown text NOT NULL DEFAULT ''
+);
+
+-- update database schema version
+UPDATE meta
+SET
+	value='2'
+WHERE
+	identifier='version';
-- 
cgit v1.2.3-70-g09d2

