36f3c8da22
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XNQ8ghPfzAfsyVYd6HgFb6
22 lines
876 B
SQL
22 lines
876 B
SQL
-- Mehrere Auslieferungsziele (FTP/SFTP-Quellen), z. B. eine zweite Picdrop-Galerie
|
|
-- oder ein anderer FTP-Server. Rezepte/Presets können ein Ziel fest verdrahten.
|
|
CREATE TABLE IF NOT EXISTS delivery_targets (
|
|
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
name text NOT NULL,
|
|
protocol text CHECK (protocol IN ('ftps','sftp')),
|
|
host text,
|
|
port int,
|
|
username text,
|
|
password_enc text,
|
|
base_path text,
|
|
created_at timestamptz NOT NULL DEFAULT now()
|
|
);
|
|
|
|
-- Preset → festes Ziel (NULL = Standard-Picdrop aus den Einstellungen).
|
|
ALTER TABLE recipes ADD COLUMN IF NOT EXISTS delivery_target_id uuid
|
|
REFERENCES delivery_targets(id) ON DELETE SET NULL;
|
|
|
|
-- Ordner → festes Ziel (optional).
|
|
ALTER TABLE folders ADD COLUMN IF NOT EXISTS delivery_target_id uuid
|
|
REFERENCES delivery_targets(id) ON DELETE SET NULL;
|