[Koha-devel] Update database changes proposal [IMPORTANT]

MJ Ray mjr at phonecoop.coop
Fri Nov 18 20:18:42 CET 2011


Mason James <mtj at kohaaloha.com>
> On 2011-11-18, at 5:43 AM, Paul Poulain wrote:
> > Le 09/11/2011 18:54, Mason James a écrit :
> >> do other people agree?
> > not at all ! Sometimes (not very often, but not rarely either), more
> > complex calculations must be made, like for
> > 
> > For example:
> > depending on your marcflavour you do something or something else.
> >> $DBversion = '3.05.00.017'; if (C4::Context->preference("Version")
> >> < TransformToNum($DBversion)) { if
> >> (C4::Context->preference("marcflavour") eq 'MARC21' || 
> >> C4::Context->preference("marcflavour") eq 'NORMARC'){ 
> 
> ...
> 
> > 
> > So we must have a .pl file, not SQL

The bit quoted above doesn't require a .pl file.  SQL has conditionals.

> yes, yes... a good point Paul!
> 
> i think if we want to do Ian's suggested check/apply/roll-back idea
> for DB changes, we will indeed need to use .pl files not .sql files
> for new patches

I'm not sure about that either.  Surely it could be done by setting
SQL session variables in the updatedatabase that loads the sql file
and conditionals in the SQL?

But anyway, what about supporting both?  If I'm wrong and .sql has to
be trivially converted to .pl one day, it's not that awful.  If I'm
right and we can eventually replace all .pl with .sql, that makes
updating a lot cleaner and safer.

Regards,
-- 
MJ Ray (slef), member of www.software.coop, a for-more-than-profit co-op.
Webmaster, Debian Developer, Past Koha RM, statistician, former lecturer.
In My Opinion Only: see http://mjr.towers.org.uk/email.html
Available for hire for various work through http://www.software.coop/


More information about the Koha-devel mailing list