Permalink
Browse files

Foreign keys should have delete/update actions set.

Signed-off-by: Michael Miller <mikemill@gmail.com>
  • Loading branch information...
1 parent 76b73c5 commit a6c83c2bede757799a2878830d5d394b4b130df5 @mikemill committed May 30, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 tabledefs/MySQL/usersettings.sql
View
6 tabledefs/MySQL/usersettings.sql
@@ -1,8 +1,8 @@
- CREATE TABLE `usersettings` (
+CREATE TABLE `usersettings` (
`id_user` int(10) unsigned NOT NULL,
`field` varchar(20) NOT NULL,
`value` varchar(100) NOT NULL,
PRIMARY KEY (`id_user`,`field`),
KEY `field` (`field`),
- CONSTRAINT `userprofile_ibfk_1` FOREIGN KEY (`id_user`) REFERENCES `users` (`id_user`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8
+ CONSTRAINT `usersettings_ibfk_1` FOREIGN KEY (`id_user`) REFERENCES `users` (`id_user`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8

0 comments on commit a6c83c2

Please sign in to comment.