CREATE TABLE reservation_commissions (
  idReservation           INT             NOT NULL,
  idEntityCompany         INT             NOT NULL,
  comm_index              TINYINT UNSIGNED NOT NULL,     -- posição no array
  idEntity                INT             NULL,
  percentage              DECIMAL(5,2)    NULL,
  value                   DECIMAL(12,2)   NULL,
  PRIMARY KEY (idReservation, idEntityCompany, comm_index),
  FOREIGN KEY (idReservation, idEntityCompany)
    REFERENCES reservation_details(idReservation, idEntityCompany)
    ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
