CREATE TABLE `smd__user_has_notifications` (
  `userID` int(11) unsigned NOT NULL,
  `activityID` int(11) unsigned NOT NULL,
  `seenAt` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`userID`,`activityID`),
  KEY `index_userID` (`userID`),
  KEY `index_activityID` (`activityID`),
  KEY `index_seenAt` (`seenAt`),
  CONSTRAINT `cms__user_smd__user_has_notifications_userID_userID` FOREIGN KEY (`userID`) REFERENCES `cms__user` (`userID`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `smd__activity_smd__user_has_notifications_activityID_activityID` FOREIGN KEY (`activityID`) REFERENCES `smd__activity` (`activityID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8