-- ====================================================================
-- Secret settings columns → TEXT (2026-09-25)
--   Secrets are stored encrypted as `<32-hex IV>:<hex ciphertext>`, which is
--   roughly 2x the plain length + 33. A Stripe secret key (~107 chars)
--   encrypts to ~257 chars, so VARCHAR(255) cut it off. MySQL here runs
--   without STRICT mode, so the cut was silent and the value could no
--   longer be decrypted (GET /api/settings → 500).
-- Plain statements only, safe to run more than once.
-- After running it, re-enter any secret that was saved while the column
-- was too small (the truncated value can't be recovered).
-- ====================================================================

SET NAMES utf8mb4;

ALTER TABLE `site_settings`
  MODIFY `smtp_password` TEXT NULL DEFAULT NULL,
  MODIFY `google_client_secret` TEXT NULL DEFAULT NULL,
  MODIFY `facebook_app_secret` TEXT NULL DEFAULT NULL,
  MODIFY `paypal_client_secret` TEXT NULL DEFAULT NULL,
  MODIFY `stripe_secret_key` TEXT NULL DEFAULT NULL,
  MODIFY `stripe_webhook_secret` TEXT NULL DEFAULT NULL;
