
--------------------------------------------------------------------------------

-- 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';
