CREATE TABLE IF NOT EXISTS `products_keyword_planner_terms` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `product_id` INT(11) NOT NULL,
  `source_url` VARCHAR(1024) NOT NULL,
  `keyword_text` VARCHAR(255) NOT NULL,
  `avg_monthly_searches` INT(11) NOT NULL DEFAULT 0,
  `competition` VARCHAR(32) DEFAULT NULL,
  `competition_index` INT(11) DEFAULT NULL,
  `source_customer_id` VARCHAR(32) DEFAULT NULL,
  `date_add` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_products_keyword_planner_terms` (`product_id`,`source_url`(255),`keyword_text`),
  KEY `idx_products_keyword_product` (`product_id`),
  KEY `idx_products_keyword_popularity` (`product_id`,`avg_monthly_searches`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
