CREATE TABLE reservation_rooms (
  idReservation           INT             NOT NULL,
  idEntityCompany         INT             NOT NULL,
  room_index              TINYINT UNSIGNED NOT NULL,     -- posição no array
  idRoom                  INT             NULL,
  code                    VARCHAR(50)     NULL,
  checkIn                 DATETIME        NULL,
  checkOut                DATETIME        NULL,
  idRoomType              INT             NULL,
  roomTypeName            VARCHAR(255)    NULL,
  amount                  DECIMAL(12,2)   NULL,
  status                  TINYINT         NULL,
  pax                     TINYINT         NULL,
  chd1                    TINYINT         NULL,
  chd2                    TINYINT         NULL,
  chd3                    TINYINT         NULL,
  ratePlanId              INT             NULL,
  ratePlanName            VARCHAR(255)    NULL,
  mealPlanDesc            VARCHAR(255)    NULL,
  PRIMARY KEY (idReservation, idEntityCompany, room_index),
  FOREIGN KEY (idReservation, idEntityCompany)
    REFERENCES reservation_details(idReservation, idEntityCompany)
    ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
