Files
WinStudentGoalTracker/db/Objects/tables/goal.sql
T

19 lines
826 B
SQL

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,
`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;