[CDBI] Database software upgrades...

Matt S Trout dbix-class at trout.me.uk
Tue Nov 21 15:34:17 GMT 2006


Judd Taylor wrote:
> This is slightly off topic, but I figure people on this list may be able
> to help me out here.
> 
> I've got a lot of perl software that uses C::DBI, of which the DBI
> subclass stuff is reverse-engineered from a MySQL database (using the
> DBDesigner4 name conventions, etc... to work out relationships).
> 
> That scheme works well when working with a single database, but I need
> to install this software with a database running at every site. 
> 
> The real problem is when one site needs to upgrade the software when the
> underlying database has also changed. I can just wipe the database out
> and re-create it using the new upgraded format, but then all of the
> previous data in the database is lost. That's no good, since users will
> have to re-configure the software from scratch every time they upgrade.
> 
> Is there a simple way to I can upgrade the underlying database along
> with the software, without wiping out the already-installed data? 

I've found sqlt-diff produces ALTER TABLE statements pretty well; you may want 
to try SQL::Translator dev releases and/or cvs trunk rather than the last CPAN 
release though since we're working on proper cross-database automated 
versioning and upgrade stuff for DBIx::Class and that's resulted in a fairly 
steady stream of patches going back to SQL::Translator - the current code is 
far, far in advance of what's on CPAN.



More information about the ClassDBI mailing list