CREATE TABLE `CUP` (
  `cup_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'SRI',
  `cup_tha_id` int(11) NOT NULL COMMENT 'La referencia al \ntipo de habitación \nal cual está \nasociado el cupo',
  `cup_day` smallint(11) unsigned NOT NULL DEFAULT '0' COMMENT 'El número que\nidentifica el día en \nel sistema UNIX.\nEj:\nEstá almacenado \nel número 234123\nel cual al ser \nmultiplicado por \n86.400 nos devuelve \nel número compatible \ncon Unix para obtener\nla fecha asociada.',
  `cup_glo_tot` int(11) NOT NULL DEFAULT '0' COMMENT 'Capacidad máxima\ndel hotel para\nese tipo de habitación',
  `cup_reg_res` int(11) NOT NULL DEFAULT '0' COMMENT 'Número de \nhabitaciones\nreservadas',
  `cup_web_tot` int(11) NOT NULL DEFAULT '0' COMMENT 'Cupos disponibles\npara internet',
  `cup_web_res` int(11) NOT NULL DEFAULT '0' COMMENT 'habitaciones\nreservadas\npor internet',
  `cup_ids_tot` int(11) NOT NULL DEFAULT '0' COMMENT 'Cupos disponibles \npara IDS',
  `cup_ids_res` int(11) NOT NULL DEFAULT '0' COMMENT 'Reservaciones \nhechas por IDS',
  `cup_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Momento \nde creación del\nRegistro.',
  `cup_created` timestamp NOT NULL DEFAULT '1970-01-01 00:00:00',
  PRIMARY KEY (`cup_id`),
  UNIQUE KEY `cup_tha_id-cup_day` (`cup_tha_id`,`cup_day`) USING BTREE,
  CONSTRAINT `CUP-THA` FOREIGN KEY (`cup_tha_id`) REFERENCES `THA` (`tha_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;