[Dbix-class] DBIx::Class::Schema::Loader limitations

Matt S Trout dbix-class at trout.me.uk
Thu Jun 29 21:39:33 CEST 2006


Daniel McBrearty wrote:
> and seeing the docs for Loader::Base ... it looks like {relationships
> => 1} gives 1-1 and 1-many but not many-many relationships. so maybe
> that's the better reason for manual definition ... ?
> 
> Also it actually looks like 'deploy' is still billed as experimental.

It's marked experimental because it's still not 100% working across all 
databases; then again it works pretty well for a fair majority of cases, and 
given you'd be insane to manipulate a production db without testing it on a 
dev one first it's not that big a problem.

> Is this just outdated documentation, or for real? Are people actually
> using this on production code? Is the idea to get the schema
> definition and the app all into the same code base? If so, you
> presumably have to dump all of your data, drop the old db, use
> 'deploy', and restore data in the case of a code update involving a
> schema change. Does this really work reliably for all cases?

It works pretty well - or you can get it to create the .sql file and use 
sqlt-diff on something (the DBIC test suite runs off a .sql file generated by 
this code).

> My current conception of how to do this is just to make schema update
> scripts ("alter table ...") to go with code updates.

Coming in the 08 series, hopefully.

> Sorry for so many q's, but it's just not clear to me what "best
> practice" is here, or what the real pros and cons of adopting a
> particular way of working is.

I find keeping everything in the DBIC code and deploying as required to be the 
better way of doing things. But then, I would :)

-- 
      Matt S Trout       Offering custom development, consultancy and support
   Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Dbix-class mailing list