CREATE TABLE IF NOT EXISTS `wp_tmapp_favorites` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `user_id` BIGINT UNSIGNED NOT NULL,
  `item_id` VARCHAR(64) NOT NULL,
  `item_type` VARCHAR(20) DEFAULT NULL,
  `title` VARCHAR(255) DEFAULT NULL,
  `poster` TEXT DEFAULT NULL,
  `backdrop` TEXT DEFAULT NULL,
  `url` TEXT DEFAULT NULL,
  `meta` LONGTEXT DEFAULT NULL,
  `created_at` DATETIME DEFAULT CURRENT_TIMESTAMP,
  `updated_at` DATETIME DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_item` (`user_id`, `item_id`),
  KEY `user_id` (`user_id`),
  KEY `item_id` (`item_id`),
  KEY `created_at` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
