[Dbix-class] Small fix for DBIx::Class::Schema::Loader::DBI::mysql

Brandon Black blblack at gmail.com
Wed Jul 19 16:45:39 CEST 2006


On 7/19/06, Nilson Santos Figueiredo Junior <acid06 at gmail.com> wrote:
> 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. ;-)
>

Ugh, that one's been lying there for 2 months.  I guess mysql users
either don't use this much, or just haven't upgraded in a while.
Thanks :)

-- Brandon



More information about the Dbix-class mailing list