The attached patch fixes an issue where Schema::Loader would dump useless unique constraints when loading from MySQL. The current (unfixed) output looks like:
__PACKAGE__->set_primary_key("id");
__PACKAGE__->add_unique_constraint("name", ["name"]);
__PACKAGE__->add_unique_constraint(["name"], undef);
__PACKAGE__->add_unique_constraint(["id"], undef);
If you've got a primary key "id" and an additional unique constraint
"name", for example.
The correct output should be:
__PACKAGE__->set_primary_key("id");
__PACKAGE__->add_unique_constraint("name", ["name"]);
The patch is a one word fix. ;-)
-Nilson Santos F. Jr.
mysql-fix.patch
Description: Binary data
_______________________________________________ List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class Wiki: http://dbix-class.shadowcatsystems.co.uk/ IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/ Searchable Archive: http://www.mail-archive.com/[email protected]/
