Create index helpers for models
Closed this issue · 3 comments
Since the partitioned tables will/can get created outside the scope of a migration, it makes sense to add those helper methods (add_index) to the model helpers.
This would compliment the existing helpers to manage creating partitioned tables, like "create_partition".
Sorry, I've been crazy busy lately. I'm currently working on changing some APIs around and making things more consistent. I'll make sure this is included
I'm working on abstracting all of my model-based needs into a concern, was going to propose it as a PR once I worked everything out. For the time being, this works perfectly fine in the model ...
self.connection.add_index my_partition_name, [...], name: "..."
Yeah I think it would definitely be a good idea to break up some of the model functionality into discrete concerns. I was playing around with some pretty weird patterns when I initially wrote this thing too. There's a fair amount of cleanup that I want to do before releasing a 1.0 version