CREATE TABLE `was_event_user_history` (
  `event_user_history_id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `event_id` int(11) NOT NULL,
  `type` enum('watch','search','classes','series') COLLATE utf8_unicode_ci NOT NULL,
  `view_timestamp` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `insert_timestamp` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `update_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`event_user_history_id`),
  KEY `user_id` (`user_id`,`event_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TRIGGER `was_event_user_history_insert_timestamp` BEFORE INSERT ON `was_event_user_history` FOR EACH ROW SET NEW.insert_timestamp = NOW();