CREATE TABLE `goal` (
  `id_goal` char(36) NOT NULL,
  `id_goal_parent` char(36) DEFAULT NULL,
  `id_student` char(36) DEFAULT NULL,
  `id_user_created` char(36) DEFAULT NULL,
  `description` text,
  `category` varchar(255) DEFAULT NULL,
  `baseline` text,
  `target_completion_date` date DEFAULT NULL,
  `close_date` date DEFAULT NULL,
  `achieved` tinyint(1) DEFAULT NULL,
  `close_notes` text,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id_goal`),
  KEY `goal_ibfk_1` (`id_goal_parent`),
  KEY `goal_ibfk_2` (`id_student`),
  KEY `goal_ibfk_3` (`id_user_created`),
  CONSTRAINT `goal_ibfk_1` FOREIGN KEY (`id_goal_parent`) REFERENCES `goal` (`id_goal`),
  CONSTRAINT `goal_ibfk_2` FOREIGN KEY (`id_student`) REFERENCES `student` (`id_student`),
  CONSTRAINT `goal_ibfk_3` FOREIGN KEY (`id_user_created`) REFERENCES `user` (`id_user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
