grepfood-demo/server/mockup/tables.sql

20 lines
489 B
MySQL
Raw Permalink Normal View History

2024-10-16 14:05:47 +00:00
CREATE TABLE IF NOT EXISTS ingredient (
id SERIAL,
name VARCHAR(64) UNIQUE NOT NULL,
icon VARCHAR(64),
price INT,
PRIMARY KEY(id));
CREATE TABLE IF NOT EXISTS recipe (
id SERIAL,
name VARCHAR(64) UNIQUE NOT NULL,
icon VARCHAR(64),
PRIMARY KEY(id));
CREATE TABLE IF NOT EXISTS recipe_ingredient (
recipe_id INT NOT NULL,
ingredient_d INT NOT NULL,
amount INT,
FOREIGN KEY (recipe_id) REFERENCES recipe(id),
FOREIGN KEY (ingredient_d) REFERENCES ingredient(id));