-- Add question_set_id to profiles
ALTER TABLE `profiles`
  ADD COLUMN IF NOT EXISTS `question_set_id` int(10) unsigned DEFAULT NULL AFTER `user_id`;

ALTER TABLE `profiles`
  ADD INDEX IF NOT EXISTS `idx_profiles_set` (`question_set_id`);

ALTER TABLE `profiles`
  ADD CONSTRAINT `fk_profiles_set` FOREIGN KEY (`question_set_id`) REFERENCES `question_sets`(`id`);

