CREATE TABLE `was_welcome_video_watched` (
  `welcome_video_watched_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(11) unsigned NOT NULL,
  `video_hash` varchar(20) NOT NULL,
  `video_type` enum('Welcome','GettingStarted') NOT NULL,
  `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 (`welcome_video_watched_id`),
  UNIQUE KEY `user_video_type` (`user_id`,`video_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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