-- -----------------------------------------------------
-- Table `#__sr_limit_bookings`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `#__sr_limit_bookings` (
  `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `reservation_asset_id` INT(11) UNSIGNED NULL,
  `state` TINYINT(3) NOT NULL DEFAULT 0,
  `title` VARCHAR(255) NULL DEFAULT NULL,
  `description` TEXT NULL DEFAULT NULL,
  `start_date` DATE NOT NULL DEFAULT '0000-00-00',
  `end_date` DATE NOT NULL DEFAULT '0000-00-00',
  `created_by` INT(11) NULL,
  `created_date` DATETIME NULL DEFAULT '0000-00-00 00:00:00',
  `modified_by` INT(11) NULL,
  `modified_date` DATETIME NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`),
  INDEX `fk_sr_limit_bookings_sr_reservation_assets1_idx` (`reservation_asset_id` ASC),
  CONSTRAINT `fk_sr_limit_bookings_sr_reservation_assets1`
    FOREIGN KEY (`reservation_asset_id`)
    REFERENCES `#__sr_reservation_assets` (`id`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;


-- -----------------------------------------------------
-- Table `#__sr_limit_booking_details`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `#__sr_limit_booking_details` (
  `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `limit_booking_id` INT(11) UNSIGNED NOT NULL,
  `room_id` INT(11) UNSIGNED NOT NULL,
  `room_label` VARCHAR(255) NULL,
  PRIMARY KEY (`id`),
  INDEX `fk_sr_limit_booking_details_sr_limit_bookings1_idx` (`limit_booking_id` ASC),
  INDEX `fk_sr_limit_booking_details_sr_rooms1_idx` (`room_id` ASC),
  CONSTRAINT `fk_sr_limit_booking_details_sr_limit_bookings1`
    FOREIGN KEY (`limit_booking_id`)
    REFERENCES `#__sr_limit_bookings` (`id`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_sr_limit_booking_details_sr_rooms1`
    FOREIGN KEY (`room_id`)
    REFERENCES `#__sr_rooms` (`id`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;