CREATE TABLE `HAR` (
  `har_id` int(11) NOT NULL AUTO_INCREMENT,
  `har_in` date NOT NULL,
  `har_out` date NOT NULL,
  `har_tha_id` int(11) NOT NULL,
  `har_res_id` int(11) NOT NULL,
  `har_pla_id` int(11) NOT NULL,
  `har_cli_id` int(11) NOT NULL,
  `har_hot_id` int(11) NOT NULL,
  `har_adults` int(11) NOT NULL DEFAULT '0',
  `har_children` int(11) NOT NULL DEFAULT '0',
  `har_seniors` int(11) NOT NULL DEFAULT '0',
  `har_active` bit(1) NOT NULL DEFAULT b'0',
  `har_canc_reason` enum('---','Abandonada','Cancelada hotel','Cancelada pasajero','No show','Pago insuficiente','Pago invalido','Perdida') COLLATE utf8_spanish_ci NOT NULL DEFAULT '---',
  `har_cost` double NOT NULL DEFAULT '0',
  `har_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `har_created` timestamp NOT NULL DEFAULT '1970-01-01 00:00:00',
  PRIMARY KEY (`har_id`),
  KEY `har_tha_id` (`har_tha_id`),
  KEY `har_res_id` (`har_res_id`),
  KEY `har_pla_id` (`har_pla_id`),
  KEY `har_cli_id` (`har_cli_id`),
  KEY `har_hot_id` (`har_hot_id`),
  CONSTRAINT `HAR-CLI` FOREIGN KEY (`har_cli_id`) REFERENCES `CLI` (`cli_id`),
  CONSTRAINT `HAR-HOT` FOREIGN KEY (`har_hot_id`) REFERENCES `HOT` (`hot_id`),
  CONSTRAINT `HAR-PLA` FOREIGN KEY (`har_pla_id`) REFERENCES `PLA` (`pla_id`),
  CONSTRAINT `HAR-RES` FOREIGN KEY (`har_res_id`) REFERENCES `RES` (`res_id`),
  CONSTRAINT `HAR-THA` FOREIGN KEY (`har_tha_id`) REFERENCES `THA` (`tha_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;