The problem with developing such code is that many tables that contain multiple links are not many-to-many tables and have multiple links for other reasons. For example, I will create a diagram for some fictitious application in which something can be considered as a table of many to many, if it is not.
create table category ( id primary key, ... ); create table sub_category ( id primary key, category references category(id), ... ); create table product ( id primary key, category references category(id), sub_category references sub_category(id), ... );
Something can be created this way for ease of use, without having to do multiple table joins in a database on a website, especially when considering speed. It would be difficult if the code snippet finally said “it's not so much,” while the developer should be able to easily understand it and add the many_to_many line under the checksum.
I believe that the DBIX :: Class schema provides a good starting point and a bit more, especially when working with automatic numbering in non-MySQL databases, by the way. I often need to modify the above “Do not modify above this line” (although many of them can obviously go below this checksum, of course.
source share