SET FOREIGN_KEY_CHECKS=0;

CREATE TABLE IF NOT EXISTS `#__noboss_calendar` (
  `id_event` int(11) NOT NULL AUTO_INCREMENT,
  `id_calendar` varchar(20) DEFAULT '',
  `event_category` mediumtext,
  `data_json` mediumtext,
  `event_title` text,
  `is_recurrent` tinyint(3) DEFAULT '0',
  `recurrence_type` varchar(30) DEFAULT '',
  `recurrent_days` varchar(100) DEFAULT '',
  `specific_dates` text,
  `recurrent_days_ignore` text,
  `initial_date` date DEFAULT NULL,
  `final_date` date DEFAULT NULL,
  `published` tinyint(3) DEFAULT '1',
  `modal_content` mediumtext,
  `hours` text,
  `input_type` varchar(30) DEFAULT 'manual',
  PRIMARY KEY (`id_event`),
  UNIQUE KEY `id_event` (`id_event`)
) DEFAULT CHARSET=utf8;

CREATE TABLE `#__noboss_calendar_categories` (
  `id_categorie` varchar(150) NOT NULL,
  `id_calendar` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
  `legend` varchar(255) DEFAULT '',
  `category_color` varchar(40) DEFAULT '',
  `show_in_legends` tinyint DEFAULT '1',
  `input_type` varchar(30) DEFAULT 'manual',
  PRIMARY KEY (`id_categorie`,`id_calendar`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
