/*
 * Copyright ©  2022 Thomas J Collinson
 * All rights reserved
 */

CREATE TABLE `booked_jobs_sub_account_rel`
(
    `booked_jobs_idfk` INT UNSIGNED NOT NULL,
    `sub_account_idfk` INT UNSIGNED NOT NULL,
    CONSTRAINT `booked_jobs_sub_account_rel_pk`
        PRIMARY KEY (`booked_jobs_idfk`),
    CONSTRAINT `booked_jobs_sub_account_rel_booked_jobs_id_fk`
        FOREIGN KEY (`booked_jobs_idfk`) REFERENCES `booked_jobs` (`id`)
            ON UPDATE CASCADE ON DELETE CASCADE,
    CONSTRAINT `booked_jobs_sub_account_rel_sub_accounts_id_fk`
        FOREIGN KEY (`sub_account_idfk`) REFERENCES `sub_accounts` (`id`)
            ON UPDATE CASCADE ON DELETE CASCADE
);