diff --git a/app/Migrations/create-schema.sql b/app/Migrations/create-schema.sql index 5c6664a..57c565d 100644 --- a/app/Migrations/create-schema.sql +++ b/app/Migrations/create-schema.sql @@ -36,20 +36,22 @@ CREATE TABLE IF NOT EXISTS orders ( ); -------------------------------------------- --- Recipe/Cookie related tables +-- Raw materials, ingredients and recipes -------------------------------------------- -- Notes: the unit type can be defined in terms -- of volume or weight instead. Here we choose -- to use static si-prefixes in relevant tables. --- What types of ingredients do we handle +-- What types of ingredients do we handle. +-- Not currently used, but kept as an example. CREATE TABLE IF NOT EXISTS ingredients ( ingredient_id INTEGER PRIMARY KEY, ingredient_name VARCHAR(50) NOT NULL UNIQUE, preferred_unit VARCHAR(50) NOT NULL CHECK (preferred_unit IN ('g', 'ml')) ); --- What ingredients are in what cookies +-- What ingredients are in what cookies? +-- Glues together the cookies and ingredients, a 'recipe'. CREATE TABLE IF NOT EXISTS recipe_contents ( cookie_id INT NOT NULL, ingredient_id INT NOT NULL, @@ -61,6 +63,7 @@ CREATE TABLE IF NOT EXISTS recipe_contents ( ); -- Describes ingredients and stock. +-- This should reference the ingredients table, but we'll keep it simple for now. CREATE TABLE IF NOT EXISTS raw_materials ( ingredient_id INTEGER PRIMARY KEY, ingredient_name VARCHAR(50) NOT NULL UNIQUE,