CREATE TABLE `was_event_category_relation` (
  `category_relation_id` int(11) NOT NULL AUTO_INCREMENT,
  `event_id` int(11) NOT NULL,
  `category_id` int(11) 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 (`category_relation_id`),
  KEY `event_id` (`event_id`,`category_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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