Currently we use DBIx::Class::Schema::Loader to generate and regenerate (when our db schema changes) a set of Result classes.
We add additional relationships and methods to the bottom of these classes and this is causing merge hell when people regenerate or change the schema.
We would like to maintain our custom changes in a separate set of files that sit in parallel with the auto-generated ones.
Is there a simple, clean, recommended way of doing this?
I ran into the same problem. You can just create another class that inherits from the generated classes. However, you need to pull over the table reference, and the relationships into the class you are editing, but you can leave the column definitions and what not in the generated class. I basically wrote a helper for the loader that generates the classes into an “Immutable” namespace, and creates a child for each of them in a “Mutable” namespace along with the table name reference and the relationships from the generated model. It seems to work reasonably well, and I no longer have to worry about developers editing the generated section of the class. I should probably write up the whole thing in a blog post one of these days.