-- ===========================================================================
-- Migration: Email (SMTP) support
-- Date: 2026-07-29
--
-- A small key/value settings store for platform-level configuration that the
-- super admin edits from the dashboard (no redeploy). Its first use is the SMTP
-- config for outgoing email (password-reset links + system notifications),
-- stored under the key 'smtp' as JSON. Idempotent.
-- ===========================================================================

CREATE TABLE IF NOT EXISTS app_settings (
  name       VARCHAR(64) PRIMARY KEY,
  value      TEXT        NULL,
  updated_at TIMESTAMP   NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB;
