api recipe and ingredient, GET and PUT
This commit is contained in:
21
sqitch/deploy/ingredient-table.sql
Normal file
21
sqitch/deploy/ingredient-table.sql
Normal file
@@ -0,0 +1,21 @@
|
||||
-- Deploy rsugest:ingredient-table to pg
|
||||
-- requires: recipe-schema
|
||||
|
||||
BEGIN;
|
||||
|
||||
CREATE TABLE recipe.ingredient (
|
||||
id SERIAL PRIMARY KEY,
|
||||
recipe_id INT,
|
||||
text TEXT,
|
||||
purpose TEXT,
|
||||
name TEXT,
|
||||
name_conf FLOAT,
|
||||
amount_quantity TEXT[],
|
||||
amount_unit TEXT[],
|
||||
amount_conf FLOAT[],
|
||||
preparation TEXT,
|
||||
preparation_conf FLOAT,
|
||||
comment TEXT,
|
||||
comment_conf FLOAT);
|
||||
|
||||
COMMIT;
|
||||
7
sqitch/deploy/recipe-schema.sql
Normal file
7
sqitch/deploy/recipe-schema.sql
Normal file
@@ -0,0 +1,7 @@
|
||||
-- Deploy rsugest:recipe-schema to pg
|
||||
|
||||
BEGIN;
|
||||
|
||||
CREATE SCHEMA recipe;
|
||||
|
||||
COMMIT;
|
||||
18
sqitch/deploy/recipe-table.sql
Normal file
18
sqitch/deploy/recipe-table.sql
Normal file
@@ -0,0 +1,18 @@
|
||||
-- Deploy rsugest:recipe-table to pg
|
||||
-- requires: recipe-schema
|
||||
|
||||
BEGIN;
|
||||
|
||||
CREATE TABLE recipe.recipe (
|
||||
id SERIAL PRIMARY KEY,
|
||||
title TEXT,
|
||||
url TEXT,
|
||||
site_name TEXT,
|
||||
cuisine TEXT,
|
||||
category TEXT,
|
||||
description TEXT,
|
||||
cook_time REAL,
|
||||
prep_time REAL,
|
||||
yields TEXT);
|
||||
|
||||
COMMIT;
|
||||
7
sqitch/revert/ingredient-table.sql
Normal file
7
sqitch/revert/ingredient-table.sql
Normal file
@@ -0,0 +1,7 @@
|
||||
-- Revert rsugest:ingredient-table from pg
|
||||
|
||||
BEGIN;
|
||||
|
||||
DROP TABLE recipe.ingredient;
|
||||
|
||||
COMMIT;
|
||||
7
sqitch/revert/recipe-schema.sql
Normal file
7
sqitch/revert/recipe-schema.sql
Normal file
@@ -0,0 +1,7 @@
|
||||
-- Revert rsugest:recipe-schema from pg
|
||||
|
||||
BEGIN;
|
||||
|
||||
DROP SCHEMA recipe;
|
||||
|
||||
COMMIT;
|
||||
7
sqitch/revert/recipe-table.sql
Normal file
7
sqitch/revert/recipe-table.sql
Normal file
@@ -0,0 +1,7 @@
|
||||
-- Revert rsugest:recipe-table from pg
|
||||
|
||||
BEGIN;
|
||||
|
||||
DROP TABLE recipe.recipe;
|
||||
|
||||
COMMIT;
|
||||
6
sqitch/sqitch.plan
Normal file
6
sqitch/sqitch.plan
Normal file
@@ -0,0 +1,6 @@
|
||||
%syntax-version=1.0.0
|
||||
%project=rsugest
|
||||
|
||||
recipe-schema 2024-02-07T01:24:03Z Andrei,,, <andrei@bloated-boat> # adding schema for recipes
|
||||
recipe-table [recipe-schema] 2024-02-07T01:42:28Z Andrei,,, <andrei@bloated-boat> # adding table for recipes
|
||||
ingredient-table [recipe-schema] 2024-02-07T03:50:20Z Andrei,,, <andrei@bloated-boat> # adding table for ingredients
|
||||
11
sqitch/verify/ingredient-table.sql
Normal file
11
sqitch/verify/ingredient-table.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
-- Verify rsugest:ingredient-table on pg
|
||||
|
||||
BEGIN;
|
||||
|
||||
SELECT id, recipe_id, text, purpose, name, name_conf,
|
||||
amount_quantity, amount_unit, amount_conf, preparation,
|
||||
preparation_conf, comment, comment_conf
|
||||
FROM recipe.ingredient
|
||||
WHERE FALSE;
|
||||
|
||||
ROLLBACK;
|
||||
7
sqitch/verify/recipe-schema.sql
Normal file
7
sqitch/verify/recipe-schema.sql
Normal file
@@ -0,0 +1,7 @@
|
||||
-- Verify rsugest:recipe-schema on pg
|
||||
|
||||
BEGIN;
|
||||
|
||||
SELECT pg_catalog.has_schema_privilege('recipe', 'usage');
|
||||
|
||||
ROLLBACK;
|
||||
11
sqitch/verify/recipe-table.sql
Normal file
11
sqitch/verify/recipe-table.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
-- Verify rsugest:recipe-table on pg
|
||||
|
||||
BEGIN;
|
||||
|
||||
|
||||
select id, title, url, site_name, cuisine, category, description,
|
||||
cook_time, prep_time, yields
|
||||
FROM recipe.recipe
|
||||
WHERE FALSE;
|
||||
|
||||
ROLLBACK;
|
||||
Reference in New Issue
Block a user