[Dbix-class] How to manage customer-specific / user-defined attributes?

Charlie Garrison garrison at zeta.org.au
Sun Sep 27 23:20:14 GMT 2015


Good morning,

Wow, great reply from David. I'm not adding much to what David 
has already said so well. But I've listed a couple of packages 
that will be helpful.

On 27/9/15 at 9:55 AM -0400, David Ihnen <davidihnen at gmail.com> wrote:

>As a corrolary to my first paragraph, I want to say that the data model of
>an application is defined by the application itself. The data model of the
>indexing back end storage whose purpose is the retrieval of information in
>an adequately performant manner for the operation of the system is
>derivative and often closely coupled to the application. The less that you
>have to maintain the backend store manually in relation to the application
>model, the more maintainable your system will be. The usual tangle of
>database schemata evolution against the application evolution through its
>versions is for the most part avoided.

About 18 months ago I got serious about automating schema (& 
data) changes in app databases. It was semi-automated 
previously, and it didn't save me any time. The edge cases were 
*harder* to fix after partial automated process failed, than if 
I had just done all updates manually.

There are a few tools to help with automating changes to your 
app's database:

https://metacpan.org/pod/DBIx::Class::DeploymentHandler
https://metacpan.org/pod/DBIx::Class::Fixtures

But it was DBIx::Class::Migration which fixed the problems with 
my edge cases, and automated schema updates are now (pretty 
much) 100% reliable.

https://metacpan.org/pod/DBIx::Class::Migration

I wouldn't say the above modules are an easy learning curve to 
get fully implemented (& automated), but once integrated into 
your development flow, the benefit is *fantastic*.

It's a bit of a stretch, but I think of the schema management 
using the above tools, like I think about git and code repos. 
All the gnarly details are hidden, I just prepare db/schema/data 
updates (commit changes) and then *easily* upgrade db for designers/staging/production/etc.


Charlie

-- 
    Charlie Garrison  <garrison at zeta.org.au>
    github.com/cngarrison   metacpan.org/author/CNG

O< ascii ribbon campaign - stop html mail
http://www.ietf.org/rfc/rfc1855.txt




More information about the DBIx-Class mailing list