烘烤时表关联的MySQL问题

时间:2018-10-02 14:35:27

标签: mysql cakephp cakephp-3.0 cakephp-bake

尝试在CakePHP应用程序中创建MVC时遇到问题。 错误提示:

*Notice Error: Undefined index: Teams in [C:\Users\test\cakephp\project'name-master\vendor\cakephp\bake\src\View\Helper\DocBlockHelper.php, line 238]*

这是我的SQL代码:

CREATE TABLE `users` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
 `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
 `encrypted_password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
 `salt` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
 `facebook_json` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
 `created` datetime DEFAULT NULL,
 `modified` datetime DEFAULT NULL,
 PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

CREATE TABLE `teams` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `join_id` int(11) NOT NULL,
 `user_id` int(11) NOT NULL,
 `name` varchar(255) NOT NULL,
 `created` datetime DEFAULT NULL,
 `modified` datetime DEFAULT NULL,
 PRIMARY KEY (`id`),
 UNIQUE KEY `join_id` (`join_id`),
 KEY `user_key` (`user_id`),
 CONSTRAINT `user_key` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4

如果您有任何想法,请在这里写,我试图整周解决这个问题...

0 个答案:

没有答案