36 lines
976 B
YAML
36 lines
976 B
YAML
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,
|
|
time_minutes INTEGER NOT NULL,
|
|
made_by TEXT,
|
|
tags JSONB NOT NULL DEFAULT '[]',
|
|
ingredients JSONB NOT NULL DEFAULT '[]',
|
|
steps JSONB NOT NULL DEFAULT '[]',
|
|
image TEXT
|
|
);
|
|
|
|
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);
|
|
|