| 25 | |
| 26 | CREATE TABLE `user_grade_penalties` ( |
| 27 | `id` int(11) NOT NULL AUTO_INCREMENT, |
| 28 | `penalty_id` int(11) DEFAULT NULL, |
| 29 | `grp_event_id` int(11) NOT NULL, |
| 30 | `user_id` int(11) DEFAULT NULL, |
| 31 | PRIMARY KEY (`id`), |
| 32 | KEY `fk_penalties` (`penalty_id`), |
| 33 | KEY `fk_users` (`user_id`) |
| 34 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; |
| 35 | |
| 36 | ALTER TABLE `user_grade_penalties` |
| 37 | ADD CONSTRAINT `fk_penalties` FOREIGN KEY (`penalty_id`) REFERENCES `penalties` (`id`) ON DELETE CASCADE, |
| 38 | ADD CONSTRAINT `fk_users` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE; |