ALTER TABLE `#__sr_commission_rates` ADD `type` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 AFTER `created_by`;
ALTER TABLE `#__sr_commissions` ADD `rate_type` INT(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `scope`;

CREATE TABLE IF NOT EXISTS `#__sr_commission_rate_property_xref` (
  `commission_rate_id` INT(11) UNSIGNED NOT NULL,
  `property_id` INT(11) UNSIGNED NOT NULL,
  PRIMARY KEY (`commission_rate_id`, `property_id`),
  INDEX `fk_com_property_xref_res_asset_idx` (`property_id` ASC),
  CONSTRAINT `fk_com_property_xref_com_rates1`
    FOREIGN KEY (`commission_rate_id`)
    REFERENCES `#__sr_commission_rates` (`id`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_com_property_xref_reservation_assets1`
   FOREIGN KEY (`property_id`)
    REFERENCES `#__sr_reservation_assets` (`id`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;