No subject


Wed Sep 14 09:13:27 GMT 2016


the UNIQUE constraint would win in any case.

Even worse any INSERT, UPDATE or DELETE operation would need to maintain
the index which is never used. This does not sound sensible to me.

The supposed patch avoids the adding of those indices if the column is
checked if it is *the first column* of a UNIQUE constraint. If it's not
the index is added, if it is the first column it is handled like a
primary key.
You can view, comment on, or merge this pull request online at:

  https://github.com/dbsrgits/dbix-class/pull/113

-- Commit Summary --

  * fix: Don't add indices on columns with UNIQUE constraint

-- File Changes --

    M lib/SQL/Translator/Parser/DBIx/Class.pm (10)
    M t/86sqlt.t (17)
    M t/99dbic_sqlt_parser.t (2)
    M t/lib/sqlite.sql (4)

-- Patch Links --

https://github.com/dbsrgits/dbix-class/pull/113.patch
https://github.com/dbsrgits/dbix-class/pull/113.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/dbsrgits/dbix-class/pull/113

----==_mimepart_5896158812d36_6f843fb1a755b13828822f
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: 7bit

<p>SQL::Translator::Parser::DBIx::Class adds an index to foreign key<br>
columns as this "is normally the sensible thing to do". Agreed.</p>
<p>Besides SQL::Translator::Parser::DBIx::Class takes care to not add an<br>
additional index to primary key columns ("some RDBMS croak on this, and<br>
it generally doesn't make much sense") but doesn't consider columns with<br>
a UNIQUE constraint where it doesn't make any sense either.</p>
<p>Generally this should not be dangerous but it doesn't help at all.<br>


More information about the DBIx-Class-Devel mailing list