[Dbix-class] A start of supporting non-unique indices in
DBIC-Schema-Loader
Rob Kinyon
rob.kinyon at gmail.com
Mon Jan 13 03:45:56 GMT 2014
All -
https://github.com/robkinyon/dbix-class-schema-loader/tree/add_non_unique_indices
This is a start towards supporting the dumping of non-unique
indices in dbicdump. This works for MySQL databases. You're welcome to
grab my code and use it yourself.
Unfortunately, it writes out a deploy_hook() method. Ilmari has
already said that this is not acceptable for inclusion in the mainline
schema-loader release (which makes total sense). So, I'm throwing it
out there for people to give suggestions on what should be done. Right
now, I've got two ideas:
1. Write out a non_unqiue_indices() method and either add a
deploy_hook() method if one doesn't exist that calls
non_unique_indices() or write out a warning that they will need to add
it if a deploy_hook() exists.
2. Add an add_index() to DBIx::Class::ResultSource. This would be
useful not just for managing your SQL, but could also be useful for
figuring out what keys would be useful in find().
My preference would be add_index(), but that's a much bigger change.
--
Thanks,
Rob Kinyon
http://streamlined-book.blogspot.com/
More information about the DBIx-Class
mailing list