CREATE TABLE IF NOT EXISTS echo_editorial_lines (
  id TINYINT UNSIGNED PRIMARY KEY,
  version_no SMALLINT UNSIGNED NOT NULL DEFAULT 1,
  promise_text TEXT NOT NULL,
  audience_text TEXT NOT NULL,
  voice_text TEXT NOT NULL,
  pillars_json JSON NOT NULL,
  mix_json JSON NOT NULL,
  recurring_json JSON NOT NULL,
  forbidden_json JSON NOT NULL,
  current_test TEXT NOT NULL,
  current_learning TEXT NOT NULL,
  updated_at DATETIME NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS echo_editorial_line_history (
  id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  version_no SMALLINT UNSIGNED NOT NULL,
  snapshot_json JSON NOT NULL,
  change_note VARCHAR(255) NOT NULL DEFAULT '',
  created_at DATETIME NOT NULL,
  INDEX echo_line_version(version_no)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
