CREATE TABLE IF NOT EXISTS `favorites` (
    `id`           INT UNSIGNED NOT NULL AUTO_INCREMENT,
    `user_id`      INT UNSIGNED NOT NULL,
    `therapist_id` INT UNSIGNED NOT NULL,
    `created_at`   DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`),
    UNIQUE KEY `favorites_user_therapist_unique` (`user_id`, `therapist_id`),
    CONSTRAINT `fk_fav_user`      FOREIGN KEY (`user_id`)      REFERENCES `users` (`id`) ON DELETE CASCADE,
    CONSTRAINT `fk_fav_therapist` FOREIGN KEY (`therapist_id`) REFERENCES `therapist_profiles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
