CREATE TABLE IF NOT EXISTS rssimporthistory (
  ri_id INT UNSIGNED AUTO_INCREMENT,
  ri_wiki_id VARBINARY(255) NOT NULL,
  ri_namespace INT,
  ri_title VARBINARY(512) NOT NULL,
  ri_user_id INT NOT NULL,
  ri_status INT NOT NULL DEFAULT 0,
  ri_content MEDIUMBLOB,
  ri_rss_id VARBINARY(255),
  ri_created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  ri_updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (ri_id),
  UNIQUE KEY (ri_wiki_id, ri_namespace, ri_title),
  KEY idx_status (ri_status),
  KEY idx_user_id (ri_user_id),
  KEY idx_updated_at (ri_updated_at),
  KEY idx_rss_id (ri_rss_id)
);
