I am playing around with Bake and I have a question about the relationships it suggests.
When adding the relationships for the tables below it asks me to confirm the following: One moment while the associations are detected. --------------------------------------------------------------- Please confirm the following associations: --------------------------------------------------------------- MeasurementType hasMany IngredientList? (y/n) [y] > y MeasurementType hasOne IngredientList? (y/n) [y] > y Would you like to define some additional model associations? (y/n) Why does it ask me about a hasMany on the relationship and then a hasOne? CREATE TABLE `ingredient_lists` ( `id` int(10) unsigned zerofill NOT NULL AUTO_INCREMENT, `recipe_id` int(10) unsigned zerofill NOT NULL, `ingredient_id` int(10) unsigned zerofill NOT NULL, `amount` int(5) unsigned DEFAULT NULL, `measurement_type_id` int(10) unsigned zerofill DEFAULT NULL, `description` varchar(255) DEFAULT NULL, `created` datetime DEFAULT NULL, `modified` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `ingredients_id` (`ingredient_id`), KEY `measurement_type_id` (`measurement_type_id`), KEY `recipe_id` (`recipe_id`), CONSTRAINT `ingredients_id` FOREIGN KEY (`ingredient_id`) REFERENCES `ingredients` (`id`), CONSTRAINT `measurement_type_id` FOREIGN KEY (`measurement_type_id`) REFERENCES `measurement_types` (`id`), CONSTRAINT `recipe_id` FOREIGN KEY (`recipe_id`) REFERENCES `recipes` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=latin1; CREATE TABLE `measurement_types` ( `id` int(10) unsigned zerofill NOT NULL AUTO_INCREMENT, `measurement_type` varchar(32) NOT NULL DEFAULT '', `created` datetime DEFAULT NULL, `modified` datetime DEFAULT NULL, `abbreviation` varchar(5) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1; --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
