Hello,

The database I've been working with exposes two cases where a schema cannot be 
round-tripped through DBIx::Class::Schema::Loader. I have fixes for both which 
have been sitting around for some time. Is there anything I can do to help get 
these fixes released?


1) "current_timestamp" defaults cannot be parsed in MariaDB.
https://github.com/dbsrgits/dbix-class-schema-loader/pull/24 
https://github.com/dbsrgits/dbix-class-schema-loader/pull/24 (Based on 
ASHMEMA's PR from a year ago.)
https://rt.cpan.org/Ticket/Display.html?id=134064

MariaDB changed their output format five years ago. DBIx::Class::Schema::Loader 
needs to be updated to cope.


2) SQL::Translator generates an invalid CREATE TABLE.
https://github.com/dbsrgits/sql-translator/pull/121
https://rt.cpan.org/Ticket/Display.html?id=134065

When a table has a foreign key, SQL::Translator automatically adds an INDEX for 
the field. If you already have a UNIQUE KEY named after this field, you end up 
with two indices with the same name. MySQL and MariaDB won't accept this.

The change I have prevents the additional INDEX being created if one already 
exists by virtue of being on the left hand side of a UNIQUE KEY.

We *could* omit the additional index entirely when generating output for recent 
MariaDBs (and maybe MySQL) as it implicitly creates the index if necessary. 
However, it seems desirable to avoid version specific behaviour.

Cheers,
Dave
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk

Reply via email to