
CREATE TABLE `was_user_popup_history` (
  `user_popup_history_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(11) unsigned NOT NULL,
  `popup_type` enum('classes_upcoming') NOT NULL,
  `viewed_date` int(11) unsigned NOT NULL DEFAULT 0,
  `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 (`user_popup_history_id`),
  KEY `idx_user_viewed_popup_type` (`user_id`,`viewed_date`, `popup_type`)
) ENGINE=InnoDB COMMENT='Keeps track of users popup history';

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

-- Upcoming classes dashboard card
INSERT INTO `was_dashboard_card` ( `dashboard_card_type`, `dashboard_card_position`, `dashboard_card_position_type`, `dashboard_card_position_max`, `dashboard_card_broadcast_group`, `is_pinnable`) VALUES
( '22', '2', '2', '6', '1', '0'),
( '22', '2', '2', '6', '2', '0');