really proud of this commit :-)
[koha.git] / updater / updatedatabase
1 #!/usr/bin/perl
2
3 # $Id$
4
5 # Database Updater
6 # This script checks for required updates to the database.
7
8 # Part of the Koha Library Software www.koha.org
9 # Licensed under the GPL.
10
11 # Bugs/ToDo:
12 # - Would also be a good idea to offer to do a backup at this time...
13
14 # NOTE:  If you do something more than once in here, make it table driven.
15
16 use strict;
17
18 # CPAN modules
19 use DBI;
20
21 # Koha modules
22 use C4::Context("/etc/koha.conf.tmp");
23         # FIXME - /etc/koha.conf might not exist, so shouldn't use
24         # C4::Context.
25
26 # FIXME - The user might be installing a new database, so can't rely
27 # on /etc/koha.conf anyway.
28
29 my $debug=0;
30
31 my (
32         $sth, $sti,
33         $query,
34         %existingtables,        # tables already in database
35         %types,
36         $table,
37         $column,
38         $type, $null, $key, $default, $extra,
39         $prefitem,              # preference item in systempreferences table
40 );
41
42 my $dbh = C4::Context->dbh;
43
44 #-------------------
45 # Defines
46
47 # Tables to add if they don't exist
48 my %requiretables=(
49     shelfcontents=>"( shelfnumber int not null,
50                                                         itemnumber int not null,
51                                                         flags int)",
52     bookshelf=>"( shelfnumber int auto_increment primary key,
53                                                 shelfname char(255))",
54     z3950queue=>"( id int auto_increment primary key,
55                                                 term text,
56                                                 type char(10),
57                                                 startdate int,
58                                                 enddate int,
59                                                 done smallint,
60                                                 results longblob,
61                                                 numrecords int,
62                                                 servers text,
63                                                 identifier char(30))",
64         z3950results=>"( id int auto_increment primary key,
65                                                 queryid int,
66                                                 server char(255),
67                                                 startdate int,
68                                                 enddate int,
69                                                 results longblob,
70                                                 numrecords int,
71                                                 numdownloaded int,
72                                                 highestseen int,
73                                                 active smallint)",
74         branchrelations=>"( branchcode varchar(4),
75                                                         categorycode varchar(4))",
76         websites=>"( websitenumber int(11) NOT NULL auto_increment,
77                                                 biblionumber int(11) NOT NULL default '0',
78                                                 title text,
79                                                 description text,
80                                                 url varchar(255),
81                                                 PRIMARY KEY (websitenumber) )",
82         marcrecorddone=>"( isbn char(40),
83                                                                 issn char(40),
84                                                                 lccn char(40),
85                                                                 controlnumber char(40))",
86     uploadedmarc=>"( id int(11) NOT NULL auto_increment PRIMARY KEY,
87                                                         marc longblob,
88                                                         hidden smallint(6) default NULL,
89                                                         name varchar(255) default NULL)",
90         ethnicity=>"( code varchar(10) NOT NULL default '',
91                                         name varchar(255) default NULL,
92                                         PRIMARY KEY  (code)   )",
93         sessions=>"( sessionID varchar(255) NOT NULL default '',
94                                                 userid varchar(255) default NULL,
95                                                 ip varchar(16) default NULL,
96                                                 lasttime int,
97                                                 PRIMARY KEY (sessionID)   )",
98     sessionqueries=>"( sessionID varchar(255) NOT NULL default '',
99                                                                 userid char(100) NOT NULL default '',
100                                                                 ip char(18) NOT NULL default '',
101                                                                 url text NOT NULL default ''  )",
102         bibliothesaurus=> "( id bigint(20) NOT NULL auto_increment,
103                                                         freelib char(255) NOT NULL default '',
104                                                         stdlib char(255) NOT NULL default '',
105                                                         category char(10) NOT NULL default '',
106                                                         level tinyint(4) NOT NULL default '1',
107                                                         hierarchy char(80) NOT NULL default '',
108                                                         father bigint(20) NOT NULL default '',
109                                                         PRIMARY KEY  (id),
110                                                         KEY freelib (freelib),
111                                                         KEY stdlib (stdlib),
112                                                         KEY category (category),
113                                                         KEY hierarchy (hierarchy)
114                                                         )",
115         marc_biblio => "(
116                                                 bibid bigint(20) unsigned NOT NULL auto_increment,
117                                                 biblionumber int(11) NOT NULL default '0',
118                                                 datecreated date NOT NULL default '0000-00-00',
119                                                 datemodified date default NULL,
120                                                 origincode char(20) default NULL,
121                                                 PRIMARY KEY  (bibid),
122                                                 KEY origincode (origincode),
123                                                 KEY biblionumber (biblionumber)
124                                                 ) ",
125         marc_blob_subfield => "(
126                                         blobidlink bigint(20) NOT NULL auto_increment,
127                                         subfieldvalue longtext NOT NULL,
128                                         PRIMARY KEY  (blobidlink)
129                                         ) ",
130         marc_subfield_structure => "(
131                                                 tagfield char(3) NOT NULL default '',
132                                                 tagsubfield char(1) NOT NULL default '',
133                                                 liblibrarian char(255) NOT NULL default '',
134                                                 libopac char(255) NOT NULL default '',
135                                                 repeatable tinyint(4) NOT NULL default '0',
136                                                 mandatory tinyint(4) NOT NULL default '0',
137                                                 kohafield char(40)  default NULL,
138                                                 tab tinyint(1) default NULL,
139                                                 authorised_value char(10) default NULL,
140                                                 thesaurus_category char(10) default NULL,
141                                                 value_builder char(80) default NULL,
142                                                 PRIMARY KEY  (tagfield,tagsubfield),
143                                                 KEY kohafield (kohafield),
144                                                 KEY tab (tab)
145                                                 )",
146         marc_subfield_table => "(
147                                                 subfieldid bigint(20) unsigned NOT NULL auto_increment,
148                                                 bibid bigint(20) unsigned NOT NULL default '0',
149                                                 tag char(3) NOT NULL default '',
150                                                 tagorder tinyint(4) NOT NULL default '1',
151                                                 tag_indicator char(2) NOT NULL default '',
152                                                 subfieldcode char(1) NOT NULL default '',
153                                                 subfieldorder tinyint(4) NOT NULL default '1',
154                                                 subfieldvalue varchar(255) default NULL,
155                                                 valuebloblink bigint(20) default NULL,
156                                                 PRIMARY KEY  (subfieldid),
157                                                 KEY bibid (bibid),
158                                                 KEY tag (tag),
159                                                 KEY tag_indicator (tag_indicator),
160                                                 KEY subfieldorder (subfieldorder),
161                                                 KEY subfieldcode (subfieldcode),
162                                                 KEY subfieldvalue (subfieldvalue),
163                                                 KEY tagorder (tagorder)
164                                         )",
165         marc_tag_structure => "(
166                                         tagfield char(3) NOT NULL default '',
167                                         liblibrarian char(255) NOT NULL default '',
168                                         libopac char(255) NOT NULL default '',
169                                         repeatable tinyint(4) NOT NULL default '0',
170                                         mandatory tinyint(4) NOT NULL default '0',
171                                         authorised_value char(10) default NULL,
172                                         PRIMARY KEY  (tagfield)
173                                         )",
174         marc_word => "(
175                                 bibid bigint(20) NOT NULL default '0',
176                                 tag char(3) NOT NULL default '',
177                                 tagorder tinyint(4) NOT NULL default '1',
178                                 subfieldid char(1) NOT NULL default '',
179                                 subfieldorder tinyint(4) NOT NULL default '1',
180                                 word varchar(255) NOT NULL default '',
181                                 sndx_word varchar(255) NOT NULL default '',
182                                 KEY bibid (bibid),
183                                 KEY tag (tag),
184                                 KEY tagorder (tagorder),
185                                 KEY subfieldid (subfieldid),
186                                 KEY subfieldorder (subfieldorder),
187                                 KEY word (word),
188                                 KEY sndx_word (sndx_word)
189                         )",
190         marc_breeding =>"(  id bigint(20) NOT NULL auto_increment,
191                                 file varchar(80) NOT NULL default '',
192                                 isbn varchar(10) NOT NULL default '',
193                                 title varchar(128) default NULL,
194                                 author varchar(80) default NULL,
195                                 marc text NOT NULL,
196                                 encoding varchar(40) default NULL,
197                                 PRIMARY KEY  (id),
198                                 KEY title (title),
199                                 KEY isbn (isbn)
200                         )",
201         authorised_values => "(id int(11) NOT NULL auto_increment,
202                                 category char(10) NOT NULL default '',
203                                 authorised_value char(80) NOT NULL default '',
204                                 lib char(80) NULL,
205                                 PRIMARY KEY  (id),
206                                 KEY name (category)
207                         )",
208         userflags =>            "( bit int(11) NOT NULL default '0',
209                                 flag char(30), flagdesc char(255),
210                                 defaulton int(11)
211                         )",
212 );
213
214
215
216 my %requirefields=(
217         biblio=>{ 'abstract' => 'text' },
218         deletedbiblio=>{ 'abstract' => 'text' },
219         biblioitems=>{ 'lccn' => 'char(25)',
220                         'url' => 'varchar(255)',
221                         'marc' => 'text' },
222         deletedbiblioitems=>{ 'lccn' => 'char(25)',
223                         'url' => 'varchar(255)',
224                         'marc' => 'text' },
225         branchtransfers=>{ 'datearrived' => 'datetime' },
226         statistics=>{'borrowernumber' =>'int(11)'},
227         aqbooksellers=>{'invoicedisc' =>'float(6,4)',
228                                                 'nocalc' => 'int(11)'},
229         borrowers=>{'userid' => 'char(30)',
230                                         'password' => 'char(30)',
231                                         'flags' => 'int(11)'},
232         aqorders=>{'budgetdate' => 'date'},
233         #added so that reference items are not available for reserves...
234         itemtypes=>{'notforloan' => 'smallint(6)'},
235         systempreferences =>{'explanation' => 'char(80)'},
236         z3950servers =>{'syntax' => 'char(80)'},
237 );
238
239 my %dropable_table=(
240                     classification   =>'classification',
241                     multipart        =>'multipart',
242                     multivolume      =>'multivolume',
243                     newitems         =>'newitems',
244                     procedures       =>'procedures',
245                     publisher        =>'publisher',
246                     searchstats      =>'searchstats',
247                     serialissues     =>'serialissues',
248                     );
249
250
251 # The tabledata hash contains data that should be in the tables.
252 # The uniquefieldrequired hash entry is used to determine which (if any) fields
253 # must not exist in the table for this row to be inserted.  If the
254 # uniquefieldrequired entry is already in the table, the existing data is not
255 # modified.
256
257 my %tabledata=(
258     userflags => [
259         { uniquefieldrequired => 'bit', bit => 0, flag => 'superlibrarian', flagdesc => 'Access to all librarian functions', defaulton => 0 },
260         { uniquefieldrequired => 'bit', bit => 1, flag => 'circulate', flagdesc => 'Circulate books', defaulton => 0 },
261         { uniquefieldrequired => 'bit', bit => 2, flag => 'catalogue', flagdesc => 'View Catalogue (Librarian Interface)', defaulton => 0 },
262         { uniquefieldrequired => 'bit', bit => 3, flag => 'parameters', flagdesc => 'Set Koha system paramters', defaulton => 0 },
263         { uniquefieldrequired => 'bit', bit => 4, flag => 'borrowers', flagdesc => 'Add or modify borrowers', defaulton => 0 },
264         { uniquefieldrequired => 'bit', bit => 5, flag => 'permissions', flagdesc => 'Set user permissions', defaulton => 0 },
265         { uniquefieldrequired => 'bit', bit => 6, flag => 'reserveforothers', flagdesc => 'Reserve books for patrons', defaulton => 0 },
266         { uniquefieldrequired => 'bit', bit => 7, flag => 'borrow', flagdesc => 'Borrow books', defaulton => 1 },
267         { uniquefieldrequired => 'bit', bit => 8, flag => 'reserveforself', flagdesc => 'Reserve books for self', defaulton => 0 },
268         { uniquefieldrequired => 'bit', bit => 9, flag => 'editcatalogue', flagdesc => 'Edit Catalogue (Modify bibliographic/holdings data)', defaulton => 0 },
269         { uniquefieldrequired => 'bit', bit => 10, flag => 'updatecharges', flagdesc => 'Update borrower charges', defaulton => 0 },
270     ],
271     systempreferences => [
272         { uniquefieldrequired => 'variable', variable => 'autoMemberNum', value => '1', explanation => '1 or else. If 1, Barcode is auto-calculated' },
273         { uniquefieldrequired => 'variable', variable => 'acquisitions', value => 'simple', explanation => 'normal or simple : whether to use "acqui" or "acqui.simple" acquisition system' },
274         { uniquefieldrequired => 'variable', variable => 'dateformat', value => 'metric', explanation => 'metric, us, or iso' },
275         { uniquefieldrequired => 'variable', variable => 'template', value => 'default', explanation => 'template default name' },
276         { uniquefieldrequired => 'variable', variable => 'autoBarcode', value => '1', explanation => '1 or else. If 1, Barcode is auto-calculated' },
277         { uniquefieldrequired => 'variable', variable => 'insecure', value => 'NO', explanation => 'if YES, no auth at all is needed. Be careful if you set this to yes !' },
278         { uniquefieldrequired => 'variable', variable => 'authoritysep', value => '--', explanation => 'the separator used in authority/thesaurus. Usually --' },
279         { uniquefieldrequired => 'variable', variable => 'opaclanguages', value => 'en', explanation => 'languages' },
280         { uniquefieldrequired => 'variable', variable => 'opacthemes', value => 'default', explanation => 'theme' },
281         { uniquefieldrequired => 'variable', variable => 'timeout', value => '12000000', explanation => 'login timeout' },
282         { uniquefieldrequired => 'variable', variable => 'marc', value => 'ON', explanation => 'MARC support (ON or OFF)' },
283         { uniquefieldrequired => 'variable', variable => 'marcflavour', value => 'MARC21', explanation => 'your MARC flavor (MARC21 or UNIMARC) used for character encoding' },
284         { uniquefieldrequired => 'variable', variable => 'checkdigit', value => 'katipo', explanation => 'none= no check on member cardnumber. katipo= katipo check' },
285         { uniquefieldrequired => 'variable', variable => 'dateformat', value => 'ISO', explanation => 'date format (US mm/dd/yyyy, metric dd/mm/yyy, ISO yyyy/mm/dd) ' },
286         { uniquefieldrequired => 'variable', variable => 'KohaAdminEmailAddress', value => 'your.mail@here', explanation => 'the email adress where borrowers modifs are sent' },
287    ],
288
289 );
290
291
292 my %fielddefinitions=(
293 printers => [
294         { field => 'printername', type => 'char(40)', null => '', key => 'PRI', default => '' },
295         ],
296 aqbookfund => [
297         { field => 'bookfundid', type => 'char(5)', null => '', key => 'PRI', default => '' },
298         ],
299 z3950servers => [
300         { field => 'id', type => 'int', null => '', key => 'PRI', default => '', extra => 'auto_increment' },
301         ],
302 );
303
304
305
306 #-------------------
307 # Initialize
308
309 # Start checking
310
311 # Get version of MySQL database engine.
312 my $mysqlversion=`mysqld --version`;
313 $mysqlversion=~/Ver (\S*) /;
314 $mysqlversion=$1;
315 if ($mysqlversion ge '3.23') {
316         print "Could convert to MyISAM database tables...\n";
317 }
318
319 #---------------------------------
320 # Tables
321
322 # Collect all tables into a list
323 $sth=$dbh->prepare("show tables");
324 $sth->execute;
325 while (my ($table) = $sth->fetchrow) {
326     $existingtables{$table}=1;
327 }
328
329 # Now add any missing tables
330 foreach $table ( keys %requiretables ) {
331         print "Checking $table table...\n" if $debug;
332         unless ($existingtables{$table} ) {
333                 print "Adding $table table...\n";
334                 my $sth=$dbh->prepare(
335                         "create table $table $requiretables{$table}" );
336                 $sth->execute;
337                 if ($sth->err) {
338                                 print "Error : $sth->errstr \n";
339                                 $sth->finish;
340                 } # if error
341         } # unless exists
342 } # foreach
343
344 # now drop useless tables
345 foreach $table ( keys %dropable_table) {
346         print "Dropping unused tables...\n" if $debug;
347         if ($existingtables{$table} ) {
348                 $dbh->do("drop table $table");
349                 if ($dbh->err) {
350                 print "Error : $dbh->errstr \n";
351                 }
352         }
353 }
354 unless ($existingtables{'z3950servers'}) {
355         print "Adding z3950servers table...\n";
356         my $sti=$dbh->prepare("create table z3950servers (
357                                                                                 host char(255),
358                                                                                 port int,
359                                                                                 db char(255),
360                                                                                 userid char(255),
361                                                                                 password char(255),
362                                                                                 name text,
363                                                                                 id int,
364                                                                                 checked smallint,
365                                                                                 rank int)");
366         $sti->execute;
367         $sti=$dbh->prepare("insert into z3950servers
368                                                                 values ('z3950.loc.gov',
369                                                                 7090,
370                                                                 'voyager',
371                                                                 '', '',
372                                                                 'Library of Congress',
373                                                                 1, 1, 1)");
374         $sti->execute;
375 }
376
377 #---------------------------------
378 # Columns
379
380 foreach $table ( keys %requirefields ) {
381         print "Check table $table\n" if $debug;
382         $sth=$dbh->prepare("show columns from $table");
383         $sth->execute();
384         undef %types;
385         while ( ($column, $type, $null, $key, $default, $extra)
386                         = $sth->fetchrow) {
387                 $types{$column}=$type;
388         } # while
389         foreach $column ( keys %{ $requirefields{$table} } )  {
390                 print "  Check column $column\n" if $debug;
391                 if ( ! $types{$column} ) {
392                 # column doesn't exist
393                 print "Adding $column field to $table table...\n";
394                 $query="alter table $table
395                         add column $column " . $requirefields{$table}->{$column} ;
396                 print "Execute: $query\n" if $debug;
397                 my $sti=$dbh->prepare($query);
398                 $sti->execute;
399                         if ($sti->err) {
400                                         print "**Error : $sti->errstr \n";
401                                         $sti->finish;
402                         } # if error
403                 } # if column
404         } # foreach column
405 } # foreach table
406
407 foreach $table ( keys %fielddefinitions ) {
408     print "Check table $table\n" if $debug;
409     $sth=$dbh->prepare("show columns from $table");
410     $sth->execute();
411     my $definitions;
412     while ( ($column, $type, $null, $key, $default, $extra) = $sth->fetchrow) {
413         $definitions->{$column}->{type}=$type;
414         $definitions->{$column}->{null}=$null;
415         $definitions->{$column}->{key}=$key;
416         $definitions->{$column}->{default}=$default;
417         $definitions->{$column}->{extra}=$extra;
418     } # while 
419     my $fieldrow=$fielddefinitions{$table};
420     foreach my $row ( @$fieldrow )  {
421         my $field = $row->{field};
422         my $type = $row->{type};
423         my $null = $row->{null};
424         my $key = $row->{key};
425         my $default = $row->{default};
426         my $extra = $row->{extra};
427         my $def=$definitions->{$field};
428         unless ($type eq $def->{type} && $null eq $def->{null} && $key eq $def->{key} && $default eq $def->{default} && $extra eq $def->{extra}) {
429             if ($null eq '') {
430                 $null='NOT NULL';
431             }
432             if ($key eq 'PRI') {
433                 $key ='PRIMARY KEY';
434             }
435             unless ($extra eq 'auto_increment') {
436                 $extra='';
437             }
438             my $sth=$dbh->prepare("alter table $table change $field $field $type $null $key $extra default ?");
439             $sth->execute($default);
440             print "  Alter $field in $table\n";
441         }
442     }
443 }
444
445 # Get list of columns from items table
446 my %itemtypes;
447
448 $sth=$dbh->prepare("show columns from items");
449 $sth->execute;
450 while (my ($column, $type, $null, $key, $default, $extra) = $sth->fetchrow) {
451         $itemtypes{$column}=$type;
452 }
453
454 unless ($itemtypes{'barcode'} eq 'varchar(20)') {
455         $itemtypes{'barcode'}=~/varchar\((\d+)\)/;
456         my $oldlength=$1;
457         if ($oldlength<20) {
458                 print "Setting maximum barcode length to 20 (was $oldlength).\n";
459                 my $sti=$dbh->prepare("alter table items change barcode barcode varchar(20) not null");
460                 $sti->execute;
461         }
462 }
463
464 # extending the timestamp in branchtransfers...
465 my %branchtransfers;
466
467 $sth=$dbh->prepare("show columns from branchtransfers");
468 $sth->execute;
469 while (my ($column, $type, $null, $key, $default, $extra) = $sth->fetchrow) {
470     $branchtransfers{$column}=$type;
471 }
472
473 unless ($branchtransfers{'datesent'} eq 'datetime') {
474     print "Setting type of datesent in branchtransfers to datetime.\n";
475     my $sti=$dbh->prepare("alter table branchtransfers change datesent datesent datetime");
476     $sti->execute;
477 }
478
479 unless ($branchtransfers{'datearrived'} eq 'datetime') {
480     print "Setting type of datearrived in branchtransfers to datetime.\n";
481     my $sti=$dbh->prepare("alter table branchtransfers change datearrived datearrived datetime");
482     $sti->execute;
483 }
484
485 # changing the branchcategories table around...
486 my %branchcategories;
487
488 $sth=$dbh->prepare("show columns from branchcategories");
489 $sth->execute;
490 while (my ($column, $type, $null, $key, $default, $extra) = $sth->fetchrow) {
491         $branchcategories{$column}=$type;
492 }
493
494 unless ($branchcategories{'categorycode'} eq 'varchar(4)') {
495         print "Setting type of categorycode in branchcategories to varchar(4),\n and making the primary key.\n";
496         my $sti=$dbh->prepare("alter table branchcategories change categorycode categorycode varchar(4) not null");
497         $sti->execute;
498         $sti=$dbh->prepare("alter table branchcategories add primary key (categorycode)");
499         $sti->execute;
500 }
501
502 unless ($branchcategories{'categoryname'} eq 'text') {
503         print "Changing branchcode in branchcategories to categoryname text.\n";
504         my $sth=$dbh->prepare("alter table branchcategories change branchcode categoryname text");
505         $sth->execute;
506 }
507
508 unless ($branchcategories{'codedescription'} eq 'text') {
509         print "Replacing branchholding in branchcategories with codedescription text.\n";
510         my $sth=$dbh->prepare("alter table branchcategories change branchholding codedescription text");
511         $sth->execute;
512 }
513
514
515 # Populate tables with required data
516  
517 foreach my $table (keys %tabledata) {
518     print "Checking for data required in table $table...\n";
519     my $tablerows=$tabledata{$table};
520     foreach my $row (@$tablerows) {
521         my $uniquefieldrequired=$row->{uniquefieldrequired};
522         my $uniquevalue=$row->{$uniquefieldrequired};
523         my $sth=$dbh->prepare("select $uniquefieldrequired from $table where $uniquefieldrequired=?");
524         $sth->execute($uniquevalue);
525         unless ($sth->rows) {
526             print "Adding row to $table: ";
527             my @values;
528             my $fieldlist;
529             my $placeholders;
530             foreach my $field (keys %$row) {
531                 (next) if ($field eq 'uniquefieldrequired');
532                 my $value=$row->{$field};
533                 push @values, $value;
534                 print "  $field => $value";
535                 $fieldlist.="$field,";
536                 $placeholders.="?,";
537             }
538             print "\n";
539             $fieldlist=~s/,$//;
540             $placeholders=~s/,$//;
541             my $sth=$dbh->prepare("insert into $table ($fieldlist) values ($placeholders)");
542             $sth->execute(@values);
543         }
544     }
545 }
546
547 $sth->finish;
548
549 exit;
550
551 # $Log$
552 # Revision 1.42  2003/04/29 16:53:25  tipaul
553 # really proud of this commit :-)
554 # z3950 search and import seems to works fine.
555 # Let me explain how :
556 # * a "search z3950" button is added in the addbiblio template.
557 # * when clicked, a popup appears and z3950/search.pl is called
558 # * z3950/search.pl calls addz3950search in the DB
559 # * the z3950 daemon retrieve the records and stores them in z3950results AND in marc_breeding table.
560 # * as long as there as searches pending, the popup auto refresh every 2 seconds, and says how many searches are pending.
561 # * when the user clicks on a z3950 result => the parent popup is called with the requested biblio, and auto-filled
562 #
563 # Note :
564 # * character encoding support : (It's a nightmare...) In the z3950servers table, a "encoding" column has been added. You can put "UNIMARC" or "USMARC" in this column. Depending on this, the char_decode in C4::Biblio.pm replaces marc-char-encode by an iso 8859-1 encoding. Note that in the breeding import this value has been added too, for a better support.
565 # * the marc_breeding and z3950* tables have been modified : they have an encoding column and the random z3950 number is stored too for convenience => it's the key I use to list only requested biblios in the popup.
566 #
567 # Revision 1.41  2003/04/29 08:09:44  tipaul
568 # z3950 support is coming...
569 # * adding a syntax column in z3950 table = this column will say wether the z3950 must be called with PerferedRecordsyntax => USMARC or PerferedRecordsyntax => UNIMARC. I tried some french UNIMARC z3950 servers, and some only send USMARC, some only UNIMARC, some can answer with both.
570 # Note this is a 1st draft. More to follow (today ? I hope).
571 #
572 # Revision 1.40  2003/04/22 10:48:27  wolfpac444
573 # Added "father" column to bibliothesaurus table
574 #
575 # Revision 1.39  2003/04/04 08:45:00  tipaul
576 # last commits before 1.9.1
577 #
578 # Revision 1.38  2003/03/18 10:58:19  tipaul
579 # adding checkdigit parameter that choose how to check the members cardnumber.
580 # At the moment :
581 # * none = no checking
582 # * katipo = checked as before
583 #
584 # Revision 1.37  2003/01/30 01:47:48  acli
585 # Corrected syntax error reported by Benedict
586 #
587 # Made the indentation somewhat easier to read; the messiness probably caused
588 # the original syntax error.
589 #
590 # Revision 1.36  2003/01/28 15:13:30  tipaul
591 # userflag table now created in upgrade script (bugfix #171)
592 #
593 # Revision 1.35  2003/01/27 03:12:49  acli
594 # Reworded the description for "acquisitions" to make it fit on the screen
595 #
596 # Added "iso" to dateformat, since dateformat is not yet being used anyway
597 #
598 # Revision 1.34  2003/01/23 12:30:02  tipaul
599 # introducint marcflavour in systempref file : used for character decoding
600 #
601 # Revision 1.33  2003/01/21 09:03:27  tipaul
602 # bugfix (NOTE : this bugs makes installation of the 1.3.3 a little fuzzy. Please fix your DB if you installed 1.3.3)
603 #
604 # Revision 1.32  2003/01/16 10:29:45  tipaul
605 # adding a MARC parameter in systempref ( which is ON or OFF)
606 # the search will be a marc search if MARC=ON
607 # and a standard (v1.2) search if MARC=OFF
608 #
609 # Revision 1.31  2003/01/06 13:32:43  tipaul
610 # *** empty log message ***
611 #
612 # Revision 1.29  2003/01/06 11:14:11  tipaul
613 # last bugfixes before 1.3.3 : systempref table correctly filled
614 #
615 # Revision 1.28  2002/12/10 13:27:47  tipaul
616 # bugfixes (davide mails in koha-dev)
617 #
618 # Revision 1.27  2002/11/26 15:04:54  tipaul
619 # road to 1.3.2. Updating db structure during installation
620 #
621 # Revision 1.26  2002/11/12 17:42:40  tonnesen
622 # Merged some features over from rel-1-2, including primary key checking.
623 #
624 # Revision 1.25  2002/11/12 16:44:38  tipaul
625 # road to 1.3.2 :
626 # * many bugfixes
627 # * adding value_builder : you can map a subfield in the marc_subfield_structure to a sub stored in "value_builder" directory. In this directory you can create screen used to build values with any method. In this commit is a 1st draft of the builder for 100$a unimarc french subfield, which is composed of 35 digits, with 12 differents values (only the 4th first are provided for instance)
628 #
629 # Revision 1.24  2002/10/30 14:00:23  arensb
630 # (bug fix): Fixed typo.
631 #
632 # Revision 1.23  2002/10/25 10:55:46  tipaul
633 # Road to 1.3.2
634 # * bugfixes and improvements
635 # * manage mandatory MARC subfields
636 # * new table : authorised_values. this table contains categories and authorised values for the category. On MARC management, you can map a subfield to a authorised_values category. If you do this, the subfield can only be filled with a authorised_value of the selected category.
637 # this submit contains everything needed :
638 # * updatedatabase
639 # * admin screens
640 # * "links" management
641 # * creation of a html-list if a subfield is mapped to an authorised value.
642 #
643 # Note this is different from authorities support, which will come soon.
644 # The authorised_values is supposed to contains a "small" number of authorised values for a category (less than 50-100). If you enter more authorised values than this, it should be hard to find what you want in a BIG list...
645 #
646 # Revision 1.22  2002/10/15 10:08:19  tipaul
647 # fixme corrected, re-indent and adding the marc_breeding table (see commit of marcimport.pl for more explanations about breeding)
648 #
649 # Revision 1.21  2002/10/14 11:48:59  tipaul
650 # bugfix
651 #
652 # Revision 1.20  2002/10/10 04:49:41  arensb
653 # Added some FIXME comments.
654 #
655 # Revision 1.19  2002/10/05 10:17:17  arensb
656 # Merged with arensb-context branch: use C4::Context->dbh instead of
657 # &C4Connect, and generally prefer C4::Context over C4::Database.
658 #
659 # Revision 1.18.2.2  2002/10/05 06:18:43  arensb
660 # Added a whole mess of FIXME comments.
661 #
662 # Revision 1.18.2.1  2002/10/04 02:46:00  arensb
663 # Use C4::Connect instead of C4::Database, C4::Connect->dbh instead
664 # C4Connect.
665 #
666 # Revision 1.18  2002/09/24 13:50:55  tipaul
667 # long WAS the road to 1.3.0...
668 # coming VERY SOON NOW...
669 # modifying installer and buildrelease to update the DB
670 #
671 # Revision 1.17  2002/09/24 12:57:35  tipaul
672 # long WAS the road to 1.3.0...
673 # coming VERY SOON NOW...
674 # modifying installer and buildrelease to update the DB
675 #
676 # Revision 1.16  2002/07/31 02:34:27  finlayt
677 #
678 # added "notforloan" field to the itemtypes table.
679 #
680 # Revision 1.15  2002/07/20 22:30:06  rangi
681 # Making sure fix makes it into the main branch as well
682 # Fix for bug 69
683 #
684 # Revision 1.14  2002/07/08 16:20:26  tonnesen
685 # Added sessionqueries table and password/userid fields to borrowers table
686 #
687 # Revision 1.13  2002/07/04 18:05:36  tonnesen
688 # bug fix
689 #
690 # Revision 1.12  2002/07/04 16:41:06  tonnesen
691 # Merged changes from rel-1-2.  Abstracted table structure changes by alan.
692 #