Hello world, with Koha 3.0 we will have a new web installer, that can take care of database updating. hdl has added a Version systempref, that contains the database version. for instance there is a <kohaversion> number in the koha.xml file. When a user authentify itself, Koha checks that kohaversion and Version are the same, otherwise, the user is automatically redirected to the web installer for database update. I think we can improve a little the behaviour (mainly for libLime & us : it will be an improvement only on a multi-koha setup). I would suggest to move the <kohaversion> in the code itself. Thus, when you install a new version, all your database will automatically go to update the 1st time the user logs in, on each virtual host / library. How can we handle database updates during development stages ? If I add a systempref, of a column, how to have LibLime and other devs handle that ? I suggest that version could be a long number, like in Perl : N.SSTTVVV : N is 3 (until it becomes 4 ;-) ) SS is the version number (00 for instance) TT is the 3rd level version number (00 for instance too) VVV is the developper subrelease number. An example, based on koha 2.2.9 (but I propose this method for Koha 3.0 only, of course) We are currently in Koha 2.0209001 I add a column to the table items, it's called mycolumn, it's a date. I will add to updatedatabase : if ($DBversion < 2.0209002) { $dbh->do("BEGIN TRANSACTION"); $dbh->do("ALTER TABLE `items` ADD `mycolumn` DATE NOT NULL"); $DBversion = 2.0209002; $dbh->do("UPDATE systempref set value=$DBversion where parameter='Version'"); $dbh->do("COMMIT"); } Once it is in the public code, every developper will automatically be redirected to the updatedatabase page, without having to take care of what I have commited ;-) What do you think of this idea ? -- Paul POULAIN et Henri Damien LAURENT Consultants indépendants en logiciels libres et bibliothéconomie (http://www.koha-fr.org) Tel : 04 91 31 45 19
Paul POULAIN <paul.poulain@free.fr> wrote:
I would suggest to move the <kohaversion> in the code itself.
I like it. A $C4::Context::VERSION would be particularly useful.
I suggest that version could be a long number, like in Perl : N.SSTTVVV : [...] We are currently in Koha 2.0209001
Perl currently uses x.y.z format, but if it's much simpler to have N.SSTTVVV, then go ahead. [...]
What do you think of this idea ?
Generally good, with the above reservation on numbering. Hope that helps, -- MJ Ray - see/vidu http://mjr.towers.org.uk/email.html Experienced webmaster-developers for hire http://www.ttllp.co.uk/ Also: statistician, sysadmin, online shop builder, workers co-op. Writing on koha, debian, sat TV, Kewstoke http://mjr.towers.org.uk/
+1 on paul's idea with MJ's revision. ----- "MJ Ray" <mjr@phonecoop.coop> wrote:
Paul POULAIN <paul.poulain@free.fr> wrote:
I would suggest to move the <kohaversion> in the code itself.
I like it. A $C4::Context::VERSION would be particularly useful.
I suggest that version could be a long number, like in Perl : N.SSTTVVV : [...] We are currently in Koha 2.0209001
Perl currently uses x.y.z format, but if it's much simpler to have N.SSTTVVV, then go ahead.
[...]
What do you think of this idea ?
Generally good, with the above reservation on numbering.
Hope that helps, -- MJ Ray - see/vidu http://mjr.towers.org.uk/email.html Experienced webmaster-developers for hire http://www.ttllp.co.uk/ Also: statistician, sysadmin, online shop builder, workers co-op. Writing on koha, debian, sat TV, Kewstoke http://mjr.towers.org.uk/
_______________________________________________ Koha-devel mailing list Koha-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/koha-devel
MJ Ray a écrit :
I suggest that version could be a long number, like in Perl : N.SSTTVVV : [...] We are currently in Koha 2.0209001
Perl currently uses x.y.z format, but if it's much simpler to have N.SSTTVVV, then go ahead.
I agree that having 4 numbers maybe too much. But if we have only 3, like Perl, then we have only 2 available for public release (as the last numbers are for developpers DB updates) So, it means we have : Koha 3.0, 3.1, 3.2..., 3.15, 3.16,... => same functionnal branch, only bugfixes & minor changes Koha 4.0, 4.1,... => next major version I think this solution is simpler, but it's a big change in our naming conventions. So let's argue + and - of this solution. I think I don't care which one we choose finally. -- Paul POULAIN et Henri Damien LAURENT Consultants indépendants en logiciels libres et bibliothéconomie (http://www.koha-fr.org) Tel : 04 91 31 45 19
Paul POULAIN <paul.poulain@free.fr> wrote:
MJ Ray a écrit :
I suggest that version could be a long number, like in Perl : N.SSTTVVV : [...] We are currently in Koha 2.0209001
Perl currently uses x.y.z format, but if it's much simpler to have N.SSTTVVV, then go ahead.
I agree that having 4 numbers maybe too much. [...]
Sorry for any confusion: I meant having more than one point, so N.S.T.V would still allow 4 numbers, but be Perl-style. Hope that explains, -- MJ Ray - see/vidu http://mjr.towers.org.uk/email.html Experienced webmaster-developers for hire http://www.ttllp.co.uk/ Also: statistician, sysadmin, online shop builder, workers co-op. Writing on koha, debian, sat TV, Kewstoke http://mjr.towers.org.uk/
MJ Ray a écrit :
Sorry for any confusion: I meant having more than one point, so N.S.T.V would still allow 4 numbers, but be Perl-style.
Hope that explains,
ah, OK. No problem for me with N.SS.TT.VVV ;-) -- Paul POULAIN et Henri Damien LAURENT Consultants indépendants en logiciels libres et bibliothéconomie (http://www.koha-fr.org) Tel : 04 91 31 45 19
Paul POULAIN a écrit :
MJ Ray a écrit :
Sorry for any confusion: I meant having more than one point, so N.S.T.V would still allow 4 numbers, but be Perl-style.
Hope that explains,
ah, OK. No problem for me with N.SS.TT.VVV ;-)
OK, it's commited in git. Waiting for libLime validation. Here is my commit note, with an *important note added*, go to the end directly if you've already read the commit The kohaversion is in the code directory (in /kohaversion.pl) C4::Context now has a new method C4::Context->KOHAVERSION that returns the koha code version. The systempreference Version contains the database version. If the 2 are differents, when the user log in, he is redirected to web installer (new behaviour : before this commit, the check was done on everypage, it's too CPU costly I think) In the web installer, we check now if we do a new setup or an upgrade and show only the appropriate link. The updatedatabase contains a lot of new things : * SetVersion($kohaversion), that set the kohaversion after each update * TransformToNum($kohaversion) that returns a number (3.0000001 from 3.00.00.001 for example) for a given koha version * DropAllForeignKeys($table) that does what is written : drop all foreign keys. A shame it's not possible directly in mySQL... * for each database update, just : add the following lines : =item Describe what it does for other developpers =cut $DBversion = "your.koha.version.dbnumber"; if (C4::Context->preference("Version") < TransformToNum($DBversion)) { # # DO YOUR UPDATE STUFF # print "Upgrade to $DBversion done (specify what it does if you want)\n"; SetVersion ($DBversion); } IMPORTANT NOTES : ==== 1 ==== in koha 2.2, a new install was done through installing a 2.2.0 database, then updating it to the installed version. in Koha 3.0, /installer/kohaversion.sql MUST contain an uptodate version, as the installer set the DB version to kohaversion after uploading kohaversion.sql. It does NOT run updatedatabase. ==== 2 ==== The update from Koha 2.2 to Koha 3.0 must NOT be done through the webinstaller : updatedatabase is very very long to run and you'll reach Apache timeout for sure. See http://wiki.koha.org/doku.php?id=22_to_30 that contains my notes for upgrading (with some/few UNIMARC specific stuff) ==== 3 ==== (This note was not in my commit) On a fresh install, you'll get an internal server error if you try to load mainpage. It's due to the fact that the database is empty, and I have moved the webinstaller redirection AFTER the auth process. Previously : the webinstall needed checking was done on every page served, it's a big CPU consuming Now : the webinstall needed checking is done only when the user is not authenticated. It's less cpu consuming, but you need to write the installer url specifically for a new install. I don't think it's a real trouble (just say in the release notes / doc : after the tech install, enter "http://your.webserver.com/cgi-bin/koha/installer/install.pl" to do the database setup), and it's worth the cpu gain. If you disagree, argue, it need 1mn to rollback (just move the 5 lines checking the webinstall needed up) -- Paul POULAIN et Henri Damien LAURENT Consultants indépendants en logiciels libres et bibliothéconomie (http://www.koha-fr.org) Tel : 04 91 31 45 19
On 16/08/2007, at 10:38 PM, Paul POULAIN wrote:
Paul POULAIN a écrit :
MJ Ray a écrit :
Sorry for any confusion: I meant having more than one point, so N.S.T.V would still allow 4 numbers, but be Perl-style.
Hope that explains, ah, OK. No problem for me with N.SS.TT.VVV ;-)
OK, it's commited in git. Waiting for libLime validation.
Just a quick note, its not liblime validation :) Its the QA manager (me) and then Joshua the release manager. We just happen to both work for Liblime :) But we arent doing it as Liblime if that makes sense. Ive applied that patches to my QA clone and pushed them up to the RM, so he will do another check and push them to the public clone. Chris -- Chris Cormack chris.cormack@liblime.com VP Research and Development www.liblime.com LibLime +64 21 542 131
Paul POULAIN <paul.poulain@free.fr> wrote:
OK, it's commited in git. [...]
Wow. We've switched to git. Did anyone announce that here?
The kohaversion is in the code directory (in /kohaversion.pl) C4::Context now has a new method C4::Context->KOHAVERSION that returns the koha code version. [...]
Please use a variable $C4::Context::VERSION - that is pretty standard perl (see perldoc/man Exporter) and will make my life much easier. Maybe we should have a C4::Version class that the rest of C4 inherits from, but I'm no guru, so I don't know. Other than that, sounds good to me. Regards, -- MJ Ray - see/vidu http://mjr.towers.org.uk/email.html Experienced webmaster-developers for hire http://www.ttllp.co.uk/ Also: statistician, sysadmin, online shop builder, workers co-op. Writing on koha, debian, sat TV, Kewstoke http://mjr.towers.org.uk/
participants (4)
-
Chris Cormack -
Joshua M. Ferraro -
MJ Ray -
Paul POULAIN