-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logical error - why need to dublicate string? #1271
Comments
Didn't get what you are trying to do... |
@Alexufo Why would you define the exact same relation on 2 different names? |
@cebe |
One name for what? Please be more verbose, post your code and explain in detail. Are you trying to tell me that these relations do not work? 'usersdd' => array (self::BELONGS_TO, 'Users', 'userid'),
'clothingsizename'=>array(self::HAS_ONE, 'Clothingsize',array('clothing_size'=>'id'),'through'=>'usersdd'),
'shoessizesname'=>array(self::HAS_ONE, 'Shoessizes',array('shoes_size'=>'id'),'through'=>'usersdd'), |
Additional information on this bugBetter bug description and reproduction for those going to fix this. ER diagram:MySQL DDL:CREATE TABLE `tbl_kind1` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `tbl_kind2` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`kind1_id` int(11) NOT NULL,
`title` varchar(100) NOT NULL,
PRIMARY KEY (`id`),
KEY `fk-kind2-kind1` (`kind1_id`),
CONSTRAINT `fk-kind2-kind1` FOREIGN KEY (`kind1_id`) REFERENCES `tbl_kind1` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `tbl_kind3` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`kind2_id` int(11) NOT NULL,
`title` varchar(100) NOT NULL,
PRIMARY KEY (`id`),
KEY `fk-kind3-kind2` (`kind2_id`),
CONSTRAINT `fk-kind3-kind2` FOREIGN KEY (`kind2_id`) REFERENCES `tbl_kind2` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `tbl_kind4` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`kind2_id` int(11) NOT NULL,
`title` varchar(100) NOT NULL,
PRIMARY KEY (`id`),
KEY `fk-kind4-kind2` (`kind2_id`) USING BTREE,
CONSTRAINT `fk-kind4-kind2` FOREIGN KEY (`kind2_id`) REFERENCES `tbl_kind2` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8; MySQL DML:SET FOREIGN_KEY_CHECKS=0;
INSERT INTO `tbl_kind1` VALUES ('1', 'kind1-1');
INSERT INTO `tbl_kind1` VALUES ('2', 'kind1-2');
INSERT INTO `tbl_kind1` VALUES ('3', 'kind1-3');
INSERT INTO `tbl_kind2` VALUES ('1', '1', 'kind2-1');
INSERT INTO `tbl_kind2` VALUES ('2', '2', 'kind2-2');
INSERT INTO `tbl_kind2` VALUES ('3', '2', 'kind2-3');
INSERT INTO `tbl_kind2` VALUES ('4', '1', 'kind2-4');
INSERT INTO `tbl_kind3` VALUES ('1', '1', 'kind3-1');
INSERT INTO `tbl_kind3` VALUES ('2', '2', 'kind3-2');
INSERT INTO `tbl_kind3` VALUES ('3', '2', 'kind3-4');
INSERT INTO `tbl_kind3` VALUES ('4', '3', 'kind3-3');
INSERT INTO `tbl_kind3` VALUES ('5', '1', 'kind3-5');
INSERT INTO `tbl_kind3` VALUES ('6', '3', 'kind3-6');
INSERT INTO `tbl_kind3` VALUES ('7', '4', 'kind3-8');
INSERT INTO `tbl_kind3` VALUES ('8', '4', 'kind3-7');
INSERT INTO `tbl_kind4` VALUES ('1', '4', 'kind4-1');
INSERT INTO `tbl_kind4` VALUES ('2', '1', 'kind4-2');
INSERT INTO `tbl_kind4` VALUES ('3', '2', 'kind4-3');
INSERT INTO `tbl_kind4` VALUES ('4', '2', 'kind4-4');
INSERT INTO `tbl_kind4` VALUES ('5', '3', 'kind4-5');
INSERT INTO `tbl_kind4` VALUES ('6', '1', 'kind4-6');
INSERT INTO `tbl_kind4` VALUES ('7', '3', 'kind4-7');
INSERT INTO `tbl_kind4` VALUES ('8', '4', 'kind4-8');
SET FOREIGN_KEY_CHECKS=1;
|
'usersdd1' => array (self::BELONGS_TO, 'Users', 'userid'),
'clothingsizename'=>array(self::HAS_ONE, 'Clothingsize',array('clothing_size'=>'id'),'through'=>'usersdd1'),
'usersdd2' => array (self::BELONGS_TO, 'Users', 'userid'),
'shoessizesname'=>array(self::HAS_ONE, 'Shoessizes',array('shoes_size'=>'id'),'through'=>'usersdd2'),
The text was updated successfully, but these errors were encountered: