044eb7f1ae
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XNQ8ghPfzAfsyVYd6HgFb6
36 lines
2.1 KiB
SQL
36 lines
2.1 KiB
SQL
-- Klarbild — Erzeugungs-Modi, Vorschaubilder, Speicherverwaltung, NAS-Sicherung.
|
|
-- (04) Kombinieren aus mehreren Bildern + Freitext-Erzeugung, Thumbnails für die
|
|
-- Bibliothek, „nicht den Server vollmüllen" (Retention/Quellenlöschen), zweite
|
|
-- Datensicherung auf ein Synology-NAS.
|
|
|
|
-- Auftrags-Modus: each = jede Vorlage einzeln (bisher), compose = mehrere Bilder + Text
|
|
-- zu EINEM neuen Bild, generate = reiner Freitext ohne Vorlage.
|
|
ALTER TABLE jobs ADD COLUMN IF NOT EXISTS mode text NOT NULL DEFAULT 'each'
|
|
CHECK (mode IN ('each','compose','generate'));
|
|
|
|
-- Positionen: mehrere Quellbilder (compose) + verkleinertes Vorschaubild.
|
|
ALTER TABLE items ADD COLUMN IF NOT EXISTS source_paths jsonb;
|
|
ALTER TABLE items ADD COLUMN IF NOT EXISTS thumb_path text;
|
|
|
|
-- Rezepte können einen Modus vorbelegen (für Telegram-Standardrezepte).
|
|
ALTER TABLE recipes ADD COLUMN IF NOT EXISTS mode text NOT NULL DEFAULT 'each'
|
|
CHECK (mode IN ('each','compose','generate'));
|
|
|
|
-- Speicherverwaltung -------------------------------------------------------
|
|
ALTER TABLE settings ADD COLUMN IF NOT EXISTS keep_sources bool NOT NULL DEFAULT true;
|
|
ALTER TABLE settings ADD COLUMN IF NOT EXISTS make_thumbnails bool NOT NULL DEFAULT true;
|
|
ALTER TABLE settings ADD COLUMN IF NOT EXISTS retention_days int; -- NULL = unbegrenzt
|
|
|
|
-- Zweite Sicherung auf Synology-NAS (SFTP/FTPS, wie Picdrop) ----------------
|
|
ALTER TABLE settings ADD COLUMN IF NOT EXISTS nas_enabled bool NOT NULL DEFAULT false;
|
|
ALTER TABLE settings ADD COLUMN IF NOT EXISTS nas_host text;
|
|
ALTER TABLE settings ADD COLUMN IF NOT EXISTS nas_protocol text CHECK (nas_protocol IN ('ftps','sftp'));
|
|
ALTER TABLE settings ADD COLUMN IF NOT EXISTS nas_port int;
|
|
ALTER TABLE settings ADD COLUMN IF NOT EXISTS nas_user text;
|
|
ALTER TABLE settings ADD COLUMN IF NOT EXISTS nas_password_enc text;
|
|
ALTER TABLE settings ADD COLUMN IF NOT EXISTS nas_base_path text;
|
|
|
|
-- Spiegel-Status je Position (für Sichtbarkeit/Wiederholung).
|
|
ALTER TABLE items ADD COLUMN IF NOT EXISTS nas_status text NOT NULL DEFAULT 'none'
|
|
CHECK (nas_status IN ('none','pending','mirrored','failed'));
|