[Koha-devel] Any secret for updatedatabase.pl?

David Cook dcook at prosentient.com.au
Fri Nov 21 05:29:45 CET 2014


I started looking at DBIx::Class::Schema::deploy() and DBIx::Class::Schema::Versioned::upgrade() the other day, as I would love us to move away from kohastructure.sql and updatedatabase.pl.

Galen’s existing work is available on Bugzilla  <http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11390> http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11390 , as are some of my comments about my investigations into using these methods. 

 

I’m having a few minor issues at the moment, but hopefully I’ll resolve them soon. 

 

DBIx::Class::Schema has a method called create_ddl_dir(), which lets you dump the DBIC schema out as a SQL file. It also allows you to create SQL “diffs”, which operate as version updates. So the method will save a full dump, plus the diff. That was you can run incremental updates in sorted order, or just re-deploy the entire database at any specific version.

 

Of course, it still requires us to write a script to handle when these things occur, but that should be easy. That said, it still runs into the same problems as bug 13068. Namely, it’s just SQL updates. If we need anything more complex using Perl, I think we’ll need to write specific update scripts, or a different kind of “updatedatabase.pl” which uses DBIx::Class::Schema::Versioned for the heavy lifting and itself for more of the delicate/sophisticated updates. 

 

Anyway, that’s my 2 cents : )

 

David Cook

Systems Librarian

Prosentient Systems

72/330 Wattle St, Ultimo, NSW 2007

 

From: koha-devel-bounces at lists.koha-community.org [mailto:koha-devel-bounces at lists.koha-community.org] On Behalf Of Chris Cormack
Sent: Wednesday, 19 November 2014 8:52 AM
To: koha-devel at lists.koha-community.org
Subject: Re: [Koha-devel] Any secret for updatedatabase.pl?

 

 

 

On 19 November 2014 10:48, Philippe Blouin <philippe.blouin at inlibro.com <mailto:philippe.blouin at inlibro.com> > wrote:

Holà Koha!
After so many rebasing nightmares only caused by updatedatabase.pl <http://updatedatabase.pl> , I was wondering how you are doing your insertions in that file to make things easier.
Git is a bit dumb by default regarding that file, so I was wondering if you knew of any way to write the insertion to always show at the right place in a rebase.

Of course, maybe it's just hopeless, in which case may I ask why we are doing it this way?

Locally, I moved from that file and instead create a different file for each update (update_XXXX_long_description), and have my script run them all in sorted order.  I could see that used in the community, with a subdirectory for each version.  I can imagine it would have a very small impact on performance, but it'd be sooo much easier to rebase.

There's a patch to do just that,  http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13068  you could test and sign off

Chris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20141121/e1c36b14/attachment.html>


More information about the Koha-devel mailing list