Fix scehma db
This commit is contained in:
parent
d58d92d529
commit
78b607dfa7
@ -1,36 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name: {{ .Release.Name }}-db-schema
|
|
||||||
namespace: {{ .Values.global.namespace }}
|
|
||||||
data:
|
|
||||||
schema.sql: |
|
|
||||||
-- Create recipes table
|
|
||||||
CREATE TABLE IF NOT EXISTS recipes (
|
|
||||||
id SERIAL PRIMARY KEY,
|
|
||||||
name TEXT NOT NULL,
|
|
||||||
meal_type TEXT NOT NULL, -- breakfast / lunch / dinner / snack
|
|
||||||
time_minutes INTEGER NOT NULL,
|
|
||||||
made_by TEXT, -- Person who created this recipe version
|
|
||||||
tags JSONB NOT NULL DEFAULT '[]', -- ["מהיר", "בריא"]
|
|
||||||
ingredients JSONB NOT NULL DEFAULT '[]', -- ["ביצה", "עגבניה", "מלח"]
|
|
||||||
steps JSONB NOT NULL DEFAULT '[]', -- ["לחתוך", "לבשל", ...]
|
|
||||||
image TEXT -- Base64-encoded image or image URL
|
|
||||||
);
|
|
||||||
|
|
||||||
-- Optional: index for filters
|
|
||||||
CREATE INDEX IF NOT EXISTS idx_recipes_meal_type
|
|
||||||
ON recipes (meal_type);
|
|
||||||
|
|
||||||
CREATE INDEX IF NOT EXISTS idx_recipes_time_minutes
|
|
||||||
ON recipes (time_minutes);
|
|
||||||
|
|
||||||
CREATE INDEX IF NOT EXISTS idx_recipes_made_by
|
|
||||||
ON recipes (made_by);
|
|
||||||
|
|
||||||
CREATE INDEX IF NOT EXISTS idx_recipes_tags_jsonb
|
|
||||||
ON recipes USING GIN (tags);
|
|
||||||
|
|
||||||
CREATE INDEX IF NOT EXISTS idx_recipes_ingredients_jsonb
|
|
||||||
ON recipes USING GIN (ingredients);
|
|
||||||
|
|
||||||
@ -9,20 +9,25 @@ data:
|
|||||||
CREATE TABLE IF NOT EXISTS recipes (
|
CREATE TABLE IF NOT EXISTS recipes (
|
||||||
id SERIAL PRIMARY KEY,
|
id SERIAL PRIMARY KEY,
|
||||||
name TEXT NOT NULL,
|
name TEXT NOT NULL,
|
||||||
meal_type TEXT NOT NULL,
|
meal_type TEXT NOT NULL, -- breakfast / lunch / dinner / snack
|
||||||
time_minutes INTEGER NOT NULL,
|
time_minutes INTEGER NOT NULL,
|
||||||
tags JSONB NOT NULL DEFAULT '[]',
|
made_by TEXT, -- Person who created this recipe version
|
||||||
ingredients JSONB NOT NULL DEFAULT '[]',
|
tags JSONB NOT NULL DEFAULT '[]', -- ["מהיר", "בריא"]
|
||||||
steps JSONB NOT NULL DEFAULT '[]',
|
ingredients JSONB NOT NULL DEFAULT '[]', -- ["ביצה", "עגבניה", "מלח"]
|
||||||
image TEXT
|
steps JSONB NOT NULL DEFAULT '[]', -- ["לחתוך", "לבשל", ...]
|
||||||
|
image TEXT -- Base64-encoded image or image URL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
-- Optional: index for filters
|
||||||
CREATE INDEX IF NOT EXISTS idx_recipes_meal_type
|
CREATE INDEX IF NOT EXISTS idx_recipes_meal_type
|
||||||
ON recipes (meal_type);
|
ON recipes (meal_type);
|
||||||
|
|
||||||
CREATE INDEX IF NOT EXISTS idx_recipes_time_minutes
|
CREATE INDEX IF NOT EXISTS idx_recipes_time_minutes
|
||||||
ON recipes (time_minutes);
|
ON recipes (time_minutes);
|
||||||
|
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_recipes_made_by
|
||||||
|
ON recipes (made_by);
|
||||||
|
|
||||||
CREATE INDEX IF NOT EXISTS idx_recipes_tags_jsonb
|
CREATE INDEX IF NOT EXISTS idx_recipes_tags_jsonb
|
||||||
ON recipes USING GIN (tags);
|
ON recipes USING GIN (tags);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user