CREATE TABLE IF NOT EXISTS `mission_statements` (
  `id` INT AUTO_INCREMENT PRIMARY KEY,
  `rel_id` INT NOT NULL,
  `rel_type` VARCHAR(50) NOT NULL, -- 'institution', 'program', 'course'
  `statement` TEXT NOT NULL,
  `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  INDEX `rel_index` (`rel_id`, `rel_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `learning_outcomes` (
  `id` INT AUTO_INCREMENT PRIMARY KEY,
  `rel_id` INT NOT NULL,
  `rel_type` VARCHAR(50) NOT NULL, -- 'institution', 'program', 'course'
  `description` TEXT NOT NULL,
  `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  INDEX `rel_index` (`rel_id`, `rel_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `success_criteria` (
  `id` INT AUTO_INCREMENT PRIMARY KEY,
  `learning_outcome_id` INT NOT NULL,
  `description` TEXT NOT NULL,
  `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  FOREIGN KEY (`learning_outcome_id`) REFERENCES `learning_outcomes`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `assessment_measures` (
  `id` INT AUTO_INCREMENT PRIMARY KEY,
  `learning_outcome_id` INT NOT NULL,
  `measure_type` VARCHAR(50) NOT NULL, -- 'direct', 'indirect'
  `description` TEXT NOT NULL,
  `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  FOREIGN KEY (`learning_outcome_id`) REFERENCES `learning_outcomes`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
