2024-01-18 18:48:27 +02:00
|
|
|
-- recipe
|
|
|
|
create table if not exists recipe (
|
|
|
|
id serial primary key,
|
2024-01-19 14:49:26 +02:00
|
|
|
title text not null UNIQUE,
|
2024-01-18 18:48:27 +02:00
|
|
|
description text not null default '',
|
|
|
|
image varchar(42) not null,
|
|
|
|
cooking_time varchar(16) not null,
|
|
|
|
servings smallint not null default 1,
|
|
|
|
cal varchar(16) not null
|
|
|
|
);
|
|
|
|
-- recipe ingredients group
|
|
|
|
create table if not exists recipe_ingredients_group (
|
|
|
|
id serial primary key,
|
|
|
|
recipe_id integer references recipe(id) on delete cascade,
|
2024-01-19 14:49:26 +02:00
|
|
|
title text default ''
|
2024-01-18 18:48:27 +02:00
|
|
|
);
|
|
|
|
-- recipe ingredients
|
|
|
|
create table if not exists recipe_ingredients (
|
|
|
|
recipe_ingredients_group_id integer references recipe_ingredients_group(id) on delete cascade,
|
|
|
|
ingredient text not null
|
|
|
|
);
|
|
|
|
-- recipe steps
|
|
|
|
create table if not exists recipe_steps (
|
|
|
|
recipe_id integer references recipe(id) on delete cascade,
|
|
|
|
step_num integer not null,
|
|
|
|
step_text text not null
|
|
|
|
);
|
|
|
|
-- recipe advices
|
|
|
|
create table if not exists recipe_advices (
|
|
|
|
recipe_id integer references recipe(id) on delete cascade,
|
|
|
|
advice text
|
|
|
|
);
|
|
|
|
-- recipe categories
|
|
|
|
create table if not exists recipe_categories (
|
|
|
|
recipe_id integer references recipe(id) on delete cascade,
|
|
|
|
category text
|
|
|
|
);
|