Co-authored-by: dev_agent <dev_agent@cubecraftlabs.com>
This commit was merged in pull request #78.
This commit is contained in:
@@ -15,3 +15,7 @@ SELECT * FROM photos
|
||||
WHERE sha256 = ?
|
||||
ORDER BY id
|
||||
LIMIT 1;
|
||||
|
||||
-- name: GetPhoto :one
|
||||
SELECT * FROM photos
|
||||
WHERE id = ?;
|
||||
|
||||
@@ -5,10 +5,12 @@
|
||||
-- DeleteRecipeIngredients/DeleteRecipeSteps then the Create queries.
|
||||
INSERT INTO recipes (
|
||||
id, source_url, site_name, title, total_minutes, prep_minutes,
|
||||
cook_minutes, yield, raw_jsonld, fetched_at, created_at, updated_at
|
||||
cook_minutes, yield, raw_jsonld, photo_id, method, difficulty,
|
||||
minutes_total, fetched_at, created_at, updated_at
|
||||
) VALUES (
|
||||
?, ?, ?, ?, ?, ?,
|
||||
?, ?, ?, ?, ?, ?
|
||||
?, ?, ?, ?, ?, ?,
|
||||
?, ?, ?, ?
|
||||
)
|
||||
ON CONFLICT (source_url) DO UPDATE SET
|
||||
site_name = excluded.site_name,
|
||||
@@ -18,6 +20,10 @@ ON CONFLICT (source_url) DO UPDATE SET
|
||||
cook_minutes = excluded.cook_minutes,
|
||||
yield = excluded.yield,
|
||||
raw_jsonld = excluded.raw_jsonld,
|
||||
photo_id = excluded.photo_id,
|
||||
method = excluded.method,
|
||||
difficulty = excluded.difficulty,
|
||||
minutes_total = excluded.minutes_total,
|
||||
fetched_at = excluded.fetched_at,
|
||||
updated_at = excluded.updated_at
|
||||
RETURNING *;
|
||||
|
||||
@@ -70,14 +70,15 @@ WHERE id = 1;
|
||||
-- Creates the single row (id 1) or replaces every column except id and
|
||||
-- created_at.
|
||||
INSERT INTO recipe_search_settings (
|
||||
id, provider, base_url, api_key_ct, created_at, updated_at
|
||||
id, provider, base_url, api_key_ct, api_key_last4, created_at, updated_at
|
||||
) VALUES (
|
||||
1, ?, ?, ?, ?, ?
|
||||
1, ?, ?, ?, ?, ?, ?
|
||||
)
|
||||
ON CONFLICT (id) DO UPDATE SET
|
||||
provider = excluded.provider,
|
||||
base_url = excluded.base_url,
|
||||
api_key_ct = excluded.api_key_ct,
|
||||
api_key_last4 = excluded.api_key_last4,
|
||||
updated_at = excluded.updated_at
|
||||
RETURNING *;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user