feat(core): add secure recipe APIs, precise scaling and versioned imports

This commit is contained in:
OpenCode committed 2026-10-24 15:40:44 +02:00
commit 5d71d32e20
31 files changed
+6293

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
CREATE TABLE recipes (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(), title text NOT NULL,
title_key text NOT NULL UNIQUE, published boolean NOT NULL DEFAULT false,
data jsonb NOT NULL, created_at timestamptz NOT NULL DEFAULT now(), updated_at timestamptz NOT NULL DEFAULT now()
);
CREATE INDEX recipes_published_created ON recipes (published, created_at DESC);
CREATE INDEX recipes_data ON recipes USING gin (data);
CREATE TABLE admins (id uuid PRIMARY KEY DEFAULT gen_random_uuid(), username text NOT NULL UNIQUE, password text NOT NULL);
CREATE TABLE sessions (token text PRIMARY KEY, admin_id uuid NOT NULL REFERENCES admins(id) ON DELETE CASCADE, expires timestamptz NOT NULL);
CREATE INDEX sessions_expires ON sessions (expires);
CREATE TABLE login_limits (key text PRIMARY KEY, count integer NOT NULL, reset timestamptz NOT NULL);
CREATE TABLE settings (key text PRIMARY KEY, value jsonb NOT NULL);
INSERT INTO settings VALUES ('categories', '["Alltagsküche", "Vegetarisch", "Für Gäste", "Süßes"]'), ('tags', '["Schnell", "Familienliebling", "Meal Prep"]'), ('household', '"Unsere Küche"');
CREATE TABLE media (name text PRIMARY KEY, created_at timestamptz NOT NULL DEFAULT now());