You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a generic multi-multi relation with a connector table.
This connecting table has 2 generic composite keys to allow mysql use indexes with join in either way.
CREATETABLE `variations_ingredients` (
`variation_id`INT(10) UNSIGNED NOT NULL,
`ingredient_id`INT(10) UNSIGNED NOT NULL,
PRIMARY KEY (`variation_id`, `ingredient_id`),
INDEX `FK_variations_ingredients_ingredients` (`ingredient_id`, `variation_id`),
CONSTRAINT`FK_variations_ingredients_ingredients`FOREIGN KEY (`ingredient_id`) REFERENCES`ingredients` (`id`),
CONSTRAINT`FK_variations_ingredients_variations`FOREIGN KEY (`variation_id`) REFERENCES`variations` (`id`)
)ENGINE=InnoDB
gii creates an empty relations method for this table.
It works well if I use two single-field indexes and fails if I use composite keys as it is usually done in this case.
I have a generic multi-multi relation with a connector table.
This connecting table has 2 generic composite keys to allow mysql use indexes with join in either way.
gii creates an empty relations method for this table.
It works well if I use two single-field indexes and fails if I use composite keys as it is usually done in this case.
Migrated from http://code.google.com/p/yii/issues/detail?id=2529
earlier comments
grigori@grik.net said, at 2011-06-12T21:40:01.000Z:
the other tables used in relations can be create table variations(id int primary key); create table ingredients( id int primary key);
grigori@grik.net said, at 2011-06-12T22:31:15.000Z:
the problem is connected to the composite primary key only if the PK is on a single field, and second key is composite, it works
qiang.xue said, at 2012-01-01T03:36:54.000Z:
set for 1.1.10 milestone
qiang.xue said, at 2012-01-01T03:37:09.000Z:
set for 1.1.10 milestone
qiang.xue said, at 2012-01-01T03:37:35.000Z:
set for 1.1.10 milestone
The text was updated successfully, but these errors were encountered: