How do constraints? I try: ``` dataSource.connector.query( "ALTER TABLE Recipe ADD CONSTRAINT `fk_user_recipe`" + " FOREIGN KEY (`userId`)" + " REFERENCES `users` (`id`)" + " ON DELETE CASCADE" , function(err){ ..... }); ``` But, mysql show table: ``` | Recipe | CREATE TABLE `Recipe` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(512) NOT NULL, `description` varchar(512) DEFAULT NULL, `servings` int(11) NOT NULL, `preparingTime` int(11) NOT NULL, `cookingTime` int(11) NOT NULL, `createdAt` datetime DEFAULT NULL, `userId` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `name` (`name`), KEY `userId` (`userId`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1 | ``` Help?
Activity
superkhau commentedon Jul 7, 2015
Please post questions at https://groups.google.com/forum/#!forum/loopbackjs. See https://github.com/strongloop/loopback/wiki/Reporting-issues#question for more details.