-- Stripe keys kept in the database (encrypted, AES-256-GCM like the WhatsApp tokens) instead of only in server environment variables.
-- One row for the whole deployment (the Stripe account is shared). The environment variables still work when nothing is saved here.
-- Idempotent: safe to re-run.
CREATE TABLE IF NOT EXISTS platform_stripe_credentials (
    id                       TINYINT NOT NULL PRIMARY KEY,
    secret_key_encrypted     TEXT NULL,
    secret_key_hint          VARCHAR(16) NULL,
    webhook_secret_encrypted TEXT NULL,
    webhook_secret_hint      VARCHAR(16) NULL,
    updated_at               DATETIME(6) NULL,
    updated_by               INT NULL
);
