CREATE TABLE request_groups (
	id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
	operating_region_id INT NOT NULL,
	operating_area_id INT NOT NULL,
	zone_id INT NOT NULL,
	officer_service_number INT NOT NULL,
	forecast_date DATE NOT NULL,
	forecast_start_time TIME NOT NULL,
	forecast_end_time TIME NOT NULL,
	ophours DECIMAL(5, 2),
	UNIQUE KEY (operating_region_id, operating_area_id, zone_id,
				officer_service_number, forecast_date,
				forecast_start_time, forecast_end_time)
) ENGINE=InnoDB;

CREATE TABLE request_group_entries (
	group_id INT NOT NULL,
	daros_number INT NOT NULL,
	FOREIGN KEY idx_group (group_id) REFERENCES request_groups (id),
	FOREIGN KEY idx_daros_number (daros_number) REFERENCES requests (daros_number)
) ENGINE=InnoDB;