CREATE TABLE IF NOT EXISTS fc_publications (
  id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  source_kind ENUM('actualite','theme','mde') NOT NULL,
  source_ref VARCHAR(255) NULL,
  source_title VARCHAR(500) NOT NULL,
  source_summary TEXT NOT NULL,
  draft_text MEDIUMTEXT NOT NULL,
  status ENUM('draft','approved','rejected','planned','published','discarded') NOT NULL DEFAULT 'draft',
  rejection_reason VARCHAR(500) NULL,
  planned_at DATETIME NULL,
  published_at DATETIME NULL,
  created_at DATETIME NOT NULL,
  updated_at DATETIME NOT NULL,
  INDEX fc_status(status,planned_at),
  INDEX fc_source(source_kind,created_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
