6 # This script checks for required updates to the database.
8 # Part of the Koha Library Software www.koha.org
9 # Licensed under the GPL.
12 # - Would also be a good idea to offer to do a backup at this time...
14 # NOTE: If you do something more than once in here, make it table driven.
24 # FIXME - The user might be installing a new database, so can't rely
25 # on /etc/koha.conf anyway.
32 %existingtables, # tables already in database
36 $type, $null, $key, $default, $extra,
37 $prefitem, # preference item in systempreferences table
40 my $dbh = C4::Context->dbh;
45 # Tables to add if they don't exist
47 shelfcontents => "( shelfnumber int not null,
48 itemnumber int not null,
50 bookshelf => "( shelfnumber int auto_increment primary key,
51 shelfname char(255))",
52 z3950queue => "( id int auto_increment primary key,
61 identifier char(30))",
62 z3950results => "( id int auto_increment primary key,
72 branchrelations => "( branchcode varchar(4),
73 categorycode varchar(4))",
74 websites => "( websitenumber int(11) NOT NULL auto_increment,
75 biblionumber int(11) NOT NULL default '0',
79 PRIMARY KEY (websitenumber) )",
80 marcrecorddone => "( isbn char(40),
83 controlnumber char(40))",
84 uploadedmarc => "( id int(11) NOT NULL auto_increment PRIMARY KEY,
86 hidden smallint(6) default NULL,
87 name varchar(255) default NULL)",
88 ethnicity => "( code varchar(10) NOT NULL default '',
89 name varchar(255) default NULL,
90 PRIMARY KEY (code) )",
91 sessions => "( sessionID varchar(255) NOT NULL default '',
92 userid varchar(255) default NULL,
93 ip varchar(16) default NULL,
95 PRIMARY KEY (sessionID) )",
96 sessionqueries => "( sessionID varchar(255) NOT NULL default '',
97 userid char(100) NOT NULL default '',
98 ip char(18) NOT NULL default '',
99 url text NOT NULL default '' )",
100 bibliothesaurus => "( id bigint(20) NOT NULL auto_increment,
101 freelib char(255) NOT NULL default '',
102 stdlib char(255) NOT NULL default '',
103 category char(10) NOT NULL default '',
104 level tinyint(4) NOT NULL default '1',
105 hierarchy char(80) NOT NULL default '',
106 father char(80) NOT NULL default '',
108 KEY freelib (freelib),
110 KEY category (category),
111 KEY hierarchy (hierarchy)
114 bibid bigint(20) unsigned NOT NULL auto_increment,
115 biblionumber int(11) NOT NULL default '0',
116 datecreated date NOT NULL default '0000-00-00',
117 datemodified date default NULL,
118 origincode char(20) default NULL,
120 KEY origincode (origincode),
121 KEY biblionumber (biblionumber)
123 marc_blob_subfield => "(
124 blobidlink bigint(20) NOT NULL auto_increment,
125 subfieldvalue longtext NOT NULL,
126 PRIMARY KEY (blobidlink)
128 marc_subfield_structure => "(
129 tagfield char(3) NOT NULL default '',
130 tagsubfield char(1) NOT NULL default '',
131 liblibrarian char(255) NOT NULL default '',
132 libopac char(255) NOT NULL default '',
133 repeatable tinyint(4) NOT NULL default '0',
134 mandatory tinyint(4) NOT NULL default '0',
135 kohafield char(40) default NULL,
136 tab tinyint(1) default NULL,
137 authorised_value char(10) default NULL,
138 thesaurus_category char(10) default NULL,
139 value_builder char(80) default NULL,
140 PRIMARY KEY (tagfield,tagsubfield),
141 KEY kohafield (kohafield),
144 marc_subfield_table => "(
145 subfieldid bigint(20) unsigned NOT NULL auto_increment,
146 bibid bigint(20) unsigned NOT NULL default '0',
147 tag char(3) NOT NULL default '',
148 tagorder tinyint(4) NOT NULL default '1',
149 tag_indicator char(2) NOT NULL default '',
150 subfieldcode char(1) NOT NULL default '',
151 subfieldorder tinyint(4) NOT NULL default '1',
152 subfieldvalue varchar(255) default NULL,
153 valuebloblink bigint(20) default NULL,
154 PRIMARY KEY (subfieldid),
157 KEY tag_indicator (tag_indicator),
158 KEY subfieldorder (subfieldorder),
159 KEY subfieldcode (subfieldcode),
160 KEY subfieldvalue (subfieldvalue),
161 KEY tagorder (tagorder)
163 marc_tag_structure => "(
164 tagfield char(3) NOT NULL default '',
165 liblibrarian char(255) NOT NULL default '',
166 libopac char(255) NOT NULL default '',
167 repeatable tinyint(4) NOT NULL default '0',
168 mandatory tinyint(4) NOT NULL default '0',
169 authorised_value char(10) default NULL,
170 PRIMARY KEY (tagfield)
173 bibid bigint(20) NOT NULL default '0',
174 tag char(3) NOT NULL default '',
175 tagorder tinyint(4) NOT NULL default '1',
176 subfieldid char(1) NOT NULL default '',
177 subfieldorder tinyint(4) NOT NULL default '1',
178 word varchar(255) NOT NULL default '',
179 sndx_word varchar(255) NOT NULL default '',
182 KEY tagorder (tagorder),
183 KEY subfieldid (subfieldid),
184 KEY subfieldorder (subfieldorder),
186 KEY sndx_word (sndx_word)
188 marc_breeding => "( id bigint(20) NOT NULL auto_increment,
189 file varchar(80) NOT NULL default '',
190 isbn varchar(10) NOT NULL default '',
191 title varchar(128) default NULL,
192 author varchar(80) default NULL,
194 encoding varchar(40) default NULL,
199 authorised_values => "(id int(11) NOT NULL auto_increment,
200 category char(10) NOT NULL default '',
201 authorised_value char(80) NOT NULL default '',
206 userflags => "( bit int(11) NOT NULL default '0',
207 flag char(30), flagdesc char(255),
212 my %requirefields = (
213 biblio => { 'abstract' => 'text' },
214 deletedbiblio => { 'abstract' => 'text', 'marc' => 'blob' },
215 deleteditems => { 'marc' => 'blob' },
217 'lccn' => 'char(25)',
218 'url' => 'varchar(255)',
221 deletedbiblioitems => {
222 'lccn' => 'char(25)',
223 'url' => 'varchar(255)',
226 branchtransfers => { 'datearrived' => 'datetime' },
227 statistics => { 'borrowernumber' => 'int(11)' },
229 'invoicedisc' => 'float(6,4)',
230 'nocalc' => 'int(11)'
233 'userid' => 'char(30)',
234 'password' => 'char(30)',
235 'flags' => 'int(11)',
236 'textmessaging' => 'varchar(30)',
237 'zipcode' => 'varchar(25)',
238 'homezipcode' => 'varchar(25)',
240 aqorders => { 'budgetdate' => 'date' },
241 aqbudget => {'aqbudgetid' => 'tinyint(4) auto_increment primary key'},
243 #added so that reference items are not available for reserves...
244 itemtypes => { 'notforloan' => 'smallint(6)' },
245 systempreferences => { 'explanation' => 'char(80)',
246 'type' => 'char(20)',
247 'options' => 'text' },
248 z3950servers => { 'syntax' => 'char(80)' },
251 my %dropable_table = (
252 classification => 'classification',
253 multipart => 'multipart',
254 multivolume => 'multivolume',
255 newitems => 'newitems',
256 procedures => 'procedures',
257 publisher => 'publisher',
258 searchstats => 'searchstats',
259 serialissues => 'serialissues',
262 # the other hash contains other actions that can't be done elsewhere. they are done
263 # either BEFORE of AFTER everything else, depending on "when" entry (default => AFTER)
265 # The tabledata hash contains data that should be in the tables.
266 # The uniquefieldrequired hash entry is used to determine which (if any) fields
267 # must not exist in the table for this row to be inserted. If the
268 # uniquefieldrequired entry is already in the table, the existing data is not
269 # modified, unless the forceupdate hash entry is also set. Fields in the
270 # anonymous "forceupdate" hash will be forced to be updated to the default
271 # values given in the %tabledata hash.
276 uniquefieldrequired => 'bit',
278 flag => 'superlibrarian',
279 flagdesc => 'Access to all librarian functions',
283 uniquefieldrequired => 'bit',
286 flagdesc => 'Circulate books',
290 uniquefieldrequired => 'bit',
293 flagdesc => 'View Catalogue (Librarian Interface)',
297 uniquefieldrequired => 'bit',
299 flag => 'parameters',
300 flagdesc => 'Set Koha system paramters',
304 uniquefieldrequired => 'bit',
307 flagdesc => 'Add or modify borrowers',
311 uniquefieldrequired => 'bit',
313 flag => 'permissions',
314 flagdesc => 'Set user permissions',
318 uniquefieldrequired => 'bit',
320 flag => 'reserveforothers',
321 flagdesc => 'Reserve books for patrons',
325 uniquefieldrequired => 'bit',
328 flagdesc => 'Borrow books',
332 uniquefieldrequired => 'bit',
334 flag => 'reserveforself',
335 flagdesc => 'Reserve books for self',
339 uniquefieldrequired => 'bit',
341 flag => 'editcatalogue',
342 flagdesc => 'Edit Catalogue (Modify bibliographic/holdings data)',
346 uniquefieldrequired => 'bit',
348 flag => 'updatecharges',
349 flagdesc => 'Update borrower charges',
353 systempreferences => [
355 uniquefieldrequired => 'variable',
356 forceupdate => { 'explanation' => 1,
358 variable => 'autoMemberNum',
360 explanation => 'Member number is auto-calculated',
365 uniquefieldrequired => 'variable',
366 forceupdate => { 'explanation' => 1,
369 variable => 'acquisitions',
372 'Normal, budget-based acquisitions, or Simple bibliographic-data acquisitions',
374 options => 'simple|normal'
377 uniquefieldrequired => 'variable',
378 forceupdate => { 'explanation' => 1,
381 variable => 'dateformat',
384 'date format (US mm/dd/yyyy, metric dd/mm/yyy, ISO yyyy/mm/dd)',
386 options => 'metric|us|iso'
389 uniquefieldrequired => 'variable',
390 variable => 'template',
391 forceupdate => { 'explanation' => 1,
394 explanation => 'Preference order for intranet interface templates',
398 uniquefieldrequired => 'variable',
399 variable => 'autoBarcode',
400 forceupdate => { 'explanation' => 1,
403 explanation => 'Barcode is auto-calculated',
407 uniquefieldrequired => 'variable',
408 variable => 'insecure',
409 forceupdate => { 'explanation' => 1,
413 'If YES, no auth at all is needed. Be careful if you set this to yes!',
417 uniquefieldrequired => 'variable',
418 variable => 'authoritysep',
419 forceupdate => { 'explanation' => 1,
424 'the separator used in authority/thesaurus. Usually --',
429 uniquefieldrequired => 'variable',
430 variable => 'opaclanguages',
431 forceupdate => { 'explanation' => 1,
434 explanation => 'Set the preferred order for translations. The top language will be tried first.',
438 uniquefieldrequired => 'variable',
439 variable => 'opacthemes',
440 forceupdate => { 'explanation' => 1,
443 explanation => 'Set the preferred order for themes. The top theme will be tried first.',
447 uniquefieldrequired => 'variable',
448 variable => 'timeout',
449 forceupdate => { 'explanation' => 1,
452 explanation => 'Inactivity timeout for cookies authentication (in seconds)',
456 uniquefieldrequired => 'variable',
458 forceupdate => { 'explanation' => 1,
461 explanation => 'Turn on MARC support',
465 uniquefieldrequired => 'variable',
466 variable => 'marcflavour',
467 forceupdate => { 'explanation' => 1,
472 'your MARC flavor (MARC21 or UNIMARC) used for character encoding',
474 options => 'MARC21|UNIMARC'
477 uniquefieldrequired => 'variable',
478 variable => 'checkdigit',
480 forceupdate => { 'explanation' => 1,
483 explanation => 'Validity checks on membership number: none or "Katipo" style checks',
485 options => 'none|katipo'
488 uniquefieldrequired => 'variable',
489 variable => 'maxoutstanding',
490 forceupdate => { 'explanation' => 1,
494 'maximum amount withstanding to be able make reserves ',
498 uniquefieldrequired => 'variable',
499 variable => 'maxreserves',
500 forceupdate => { 'explanation' => 1,
504 'maximum number of reserves a member can make',
509 uniquefieldrequired => 'variable',
510 variable => 'noissuescharge',
511 forceupdate => { 'explanation' => 1,
515 'maximum amount withstanding to be able to check out an item',
520 uniquefieldrequired => 'variable',
521 variable => 'KohaAdminEmailAddress',
522 forceupdate => { 'explanation' => 1,
524 value => 'your.mail@here',
525 explanation => 'the email address where borrowers modifs are sent',
529 uniquefieldrequired => 'variable',
531 forceupdate => { 'explanation' => 1,
534 explanation => 'the gist rate. NOT in %, but in numeric form (0.12 for 12%)',
541 my %fielddefinitions = (
544 field => 'printername',
553 field => 'bookfundid',
562 field => 'aqbudgetid',
563 type => 'tinyint(4)',
567 extra => 'auto_increment'
577 extra => 'auto_increment'
582 field => 'z3950random',
583 type => 'varchar(40)',
591 type => 'varchar(40)',
605 # Get version of MySQL database engine.
606 my $mysqlversion = `mysqld --version`;
607 $mysqlversion =~ /Ver (\S*) /;
609 if ( $mysqlversion ge '3.23' ) {
610 print "Could convert to MyISAM database tables...\n";
613 #---------------------------------
616 # Collect all tables into a list
617 $sth = $dbh->prepare("show tables");
619 while ( my ($table) = $sth->fetchrow ) {
620 $existingtables{$table} = 1;
624 # Now add any missing tables
625 foreach $table ( keys %requiretables ) {
626 print "Checking $table table...\n" if $debug;
627 unless ( $existingtables{$table} ) {
628 print "Adding $table table...\n";
629 my $sth = $dbh->prepare("create table $table $requiretables{$table}");
632 print "Error : $sth->errstr \n";
638 # now drop useless tables
639 foreach $table ( keys %dropable_table ) {
640 print "Dropping unused tables...\n" if $debug;
641 if ( $existingtables{$table} ) {
642 $dbh->do("drop table $table");
644 print "Error : $dbh->errstr \n";
648 unless ( $existingtables{'z3950servers'} ) {
649 #MJR: added syntax entries to close bug 624
650 print "Adding z3950servers table...\n";
651 my $sti = $dbh->prepare( "create table z3950servers (
664 $sti = $dbh->prepare( "insert into z3950servers
665 values ('z3950.loc.gov',
669 'Library of Congress',
675 #---------------------------------
678 foreach $table ( keys %requirefields ) {
679 print "Check table $table\n" if $debug;
680 $sth = $dbh->prepare("show columns from $table");
683 while ( ( $column, $type, $null, $key, $default, $extra ) = $sth->fetchrow )
685 $types{$column} = $type;
687 foreach $column ( keys %{ $requirefields{$table} } ) {
688 print " Check column $column [$types{$column}]\n" if $debug;
689 if ( !$types{$column} ) {
691 # column doesn't exist
692 print "Adding $column field to $table table...\n";
693 $query = "alter table $table
694 add column $column " . $requirefields{$table}->{$column};
695 print "Execute: $query\n" if $debug;
696 my $sti = $dbh->prepare($query);
699 print "**Error : $sti->errstr \n";
706 foreach $table ( keys %fielddefinitions ) {
707 print "Check table $table\n" if $debug;
708 $sth = $dbh->prepare("show columns from $table");
711 while ( ( $column, $type, $null, $key, $default, $extra ) = $sth->fetchrow )
713 $definitions->{$column}->{type} = $type;
714 $definitions->{$column}->{null} = $null;
715 $definitions->{$column}->{key} = $key;
716 $definitions->{$column}->{default} = $default;
717 $definitions->{$column}->{extra} = $extra;
719 my $fieldrow = $fielddefinitions{$table};
720 foreach my $row (@$fieldrow) {
721 my $field = $row->{field};
722 my $type = $row->{type};
723 my $null = $row->{null};
724 my $key = $row->{key};
725 my $default = $row->{default};
726 $default="''" unless $default;
727 my $extra = $row->{extra};
728 my $def = $definitions->{$field};
729 unless ( $type eq $def->{type}
730 && $null eq $def->{null}
731 && $key eq $def->{key}
732 && $default eq $def->{default}
733 && $extra eq $def->{extra} )
739 if ( $key eq 'PRI' ) {
740 $key = 'PRIMARY KEY';
742 unless ( $extra eq 'auto_increment' ) {
745 # if it's a new column use "add", if it's an old one, use "change".
747 if ($definitions->{$field}->{type}) {
748 $action="change $field"
752 # if it's a primary key, drop the previous pk, before altering the table
754 if ($key ne 'PRIMARY KEY') {
755 $sth =$dbh->prepare("alter table $table $action $field $type $null $key $extra default ?");
757 $sth =$dbh->prepare("alter table $table drop primary key, $action $field $type $null $key $extra default ?");
759 $sth->execute($default);
760 print " Alter $field in $table\n";
765 # Get list of columns from borrowers table
768 $sth = $dbh->prepare("show columns from borrowers");
770 while ( my ( $column, $type, $null, $key, $default, $extra ) = $sth->fetchrow )
772 $itemtypes{$column} = $type;
773 $nullenabled{$column} = $null;
776 unless ( $itemtypes{'cardnumber'} eq 'varchar(20)' ) {
777 $itemtypes{'cardnumber'} =~ /varchar\((\d+)\)/;
779 if ( $oldlength < 16 ) {
780 print "Setting maximum cardnumber length to 16 (was $oldlength) and marking unique.\n";
783 "alter table borrowers change cardnumber cardnumber varchar(16)");
788 "alter table borrowers drop index cardnumber");
793 "alter table borrowers add unique(cardnumber)");
799 # Get list of columns from items table
800 $sth = $dbh->prepare("show columns from items");
802 while ( my ( $column, $type, $null, $key, $default, $extra ) = $sth->fetchrow )
804 $itemtypes{$column} = $type;
805 $nullenabled{$column} = $null;
808 unless ( $itemtypes{'barcode'} eq 'varchar(20)' ) {
809 $itemtypes{'barcode'} =~ /varchar\((\d+)\)/;
811 if ( $oldlength < 20 ) {
812 print "Setting maximum barcode length to 20 (was $oldlength).\n";
815 "alter table items change barcode barcode varchar(20)");
820 # dropping unique barcode index & setting barcode to null allowed.
822 $sth = $dbh->prepare("show index from items");
824 while ( my ( $table, $non_unique, $key_name, $Seq_in_index, $Column_name, $Collation, $cardinality, $sub_part, $Packed, $comment ) = $sth->fetchrow )
826 if ($key_name eq 'barcode' && $non_unique eq 0) {
827 print "dropping BARCODE index to enable empty barcodes\n";
828 $dbh->do("ALTER TABLE `items` DROP INDEX `barcode`");
831 $dbh->do("ALTER TABLE `items` CHANGE `barcode` `barcode` VARCHAR( 20 )") unless ($nullenabled{barcode} eq 'YES');
833 # changing z3950daemon field to NULL in marc_breeding
834 $dbh->do("ALTER TABLE `marc_breeding` CHANGE `z3950random` `z3950random` VARCHAR( 40 )");
836 # making borrowernumber an auto_increment field
837 $dbh->do("ALTER TABLE `borrowers` CHANGE `borrowernumber` `borrowernumber` INTEGER auto_increment");
839 # extending the timestamp in branchtransfers...
842 $sth = $dbh->prepare("show columns from branchtransfers");
844 while ( my ( $column, $type, $null, $key, $default, $extra ) = $sth->fetchrow )
846 $branchtransfers{$column} = $type;
849 unless ( $branchtransfers{'datesent'} eq 'datetime' ) {
850 print "Setting type of datesent in branchtransfers to datetime.\n";
853 "alter table branchtransfers change datesent datesent datetime");
857 unless ( $branchtransfers{'datearrived'} eq 'datetime' ) {
858 print "Setting type of datearrived in branchtransfers to datetime.\n";
861 "alter table branchtransfers change datearrived datearrived datetime");
865 # changing the branchcategories table around...
866 my %branchcategories;
868 $sth = $dbh->prepare("show columns from branchcategories");
870 while ( my ( $column, $type, $null, $key, $default, $extra ) = $sth->fetchrow )
872 $branchcategories{$column} = $type;
875 unless ( $branchcategories{'categorycode'} eq 'varchar(4)' ) {
877 "Setting type of categorycode in branchcategories to varchar(4),\n and making the primary key.\n";
880 "alter table branchcategories change categorycode categorycode varchar(4) not null"
885 "alter table branchcategories add primary key (categorycode)");
889 unless ( $branchcategories{'categoryname'} eq 'text' ) {
890 print "Changing branchcode in branchcategories to categoryname text.\n";
893 "alter table branchcategories change branchcode categoryname text");
897 unless ( $branchcategories{'codedescription'} eq 'text' ) {
899 "Replacing branchholding in branchcategories with codedescription text.\n";
902 "alter table branchcategories change branchholding codedescription text"
907 # Populate tables with required data
909 foreach my $table ( keys %tabledata ) {
910 print "Checking for data required in table $table...\n";
911 my $tablerows = $tabledata{$table};
912 foreach my $row (@$tablerows) {
913 my $uniquefieldrequired = $row->{uniquefieldrequired};
914 my $uniquevalue = $row->{$uniquefieldrequired};
915 my $forceupdate = $row->{forceupdate};
918 "select $uniquefieldrequired from $table where $uniquefieldrequired=?"
920 $sth->execute($uniquevalue);
922 foreach my $field (keys %$forceupdate) {
923 if ($forceupdate->{$field}) {
924 my $sth=$dbh->prepare("update systempreferences set $field=? where $uniquefieldrequired=?");
925 $sth->execute($row->{$field}, $uniquevalue);
929 print "Adding row to $table: ";
933 foreach my $field ( keys %$row ) {
934 next if $field eq 'uniquefieldrequired';
935 next if $field eq 'forceupdate';
936 my $value = $row->{$field};
937 push @values, $value;
938 print " $field => $value";
939 $fieldlist .= "$field,";
940 $placeholders .= "?,";
943 $fieldlist =~ s/,$//;
944 $placeholders =~ s/,$//;
947 "insert into $table ($fieldlist) values ($placeholders)");
948 $sth->execute(@values);
958 # Revision 1.66 2003/11/12 16:14:42 slef
959 # lengthen cardnumber to 16 and make it unique
961 # Revision 1.65 2003/11/06 15:07:11 tipaul
962 # adding marc fields in deletedbiblio & deleteditems
964 # Revision 1.64 2003/10/23 20:33:53 rangi
965 # Making the borrowenumber an auto_increment field
967 # Revision 1.63 2003/10/20 16:13:01 slef
968 # Omitted annotation added. Closes: 624
970 # Revision 1.62 2003/10/20 16:10:19 slef
971 # Adding USMARC to LOC z3950 entry
973 # Revision 1.61 2003/10/01 15:03:45 tipaul
974 # oups... typo fix in z3950random field definition
976 # Revision 1.59 2003/09/30 16:22:05 tipaul
977 # adding barcode NOT mandatory feature. Just run updatedatabase to get it.
978 # Note it's impossible to issue an item without barcode, as issue/returns is based on barcode...
980 # Revision 1.58 2003/07/16 04:08:29 acli
981 # Minor spelling correction
983 # Revision 1.57 2003/07/11 11:50:29 tipaul
984 # fixing a bug that occured when adding a field into a table.
986 # Revision 1.56 2003/07/07 15:37:20 tipaul
987 # *** empty log message ***
989 # Revision 1.53 2003/07/07 14:11:16 tipaul
990 # fixing bug #526 : gst rate is now calculated through systempref gist entry.
992 # * was harcoded to 12,5%
993 # * some bugs in template parameters prevented the javascript to work.
994 # * some bugs prevented some calculations to be done properly.
996 # Revision 1.52 2003/06/23 15:54:32 tipaul
997 # *** empty log message ***
999 # Revision 1.51 2003/06/23 11:27:29 tipaul
1000 # *** empty log message ***
1002 # Revision 1.50 2003/06/11 21:28:22 tonnesen
1003 # Added modifications required to the systempreferences table by the new
1004 # systempreferences.pl script. The systempreferences.pl script will not work
1005 # properly until this table is updated.
1007 # Revision 1.49 2003/05/26 10:41:53 tipaul
1008 # bugfix : borrowers modifs overwritten by stupid hash entry existing twice.
1010 # Revision 1.48 2003/05/20 19:50:45 slef
1011 # Initial fix to bug 456: hardwired paths
1013 # Revision 1.47 2003/05/15 12:23:33 tipaul
1014 # adding zipcode and homezipcode into borrowers table (bug #246
1016 # Revision 1.46 2003/05/08 12:48:24 wolfpac444
1017 # Added "noissuescharge" parameter
1019 # Revision 1.45 2003/05/08 12:26:16 wolfpac444
1022 # Revision 1.44 2003/05/03 05:39:57 rangi
1024 # (Wording changes in the explanation fields in system preferences)
1026 # Revision 1.43 2003/05/02 23:01:09 rangi
1027 # Adding the textmessaging column to the borrowers table.
1028 # insertdata.pl is expecting this to exist, and hence modifying/adding
1029 # borrowers was broken.
1031 # Also ran they script thru perltidy
1033 # Revision 1.42 2003/04/29 16:53:25 tipaul
1034 # really proud of this commit :-)
1035 # z3950 search and import seems to works fine.
1036 # Let me explain how :
1037 # * a "search z3950" button is added in the addbiblio template.
1038 # * when clicked, a popup appears and z3950/search.pl is called
1039 # * z3950/search.pl calls addz3950search in the DB
1040 # * the z3950 daemon retrieve the records and stores them in z3950results AND in marc_breeding table.
1041 # * as long as there as searches pending, the popup auto refresh every 2 seconds, and says how many searches are pending.
1042 # * when the user clicks on a z3950 result => the parent popup is called with the requested biblio, and auto-filled
1045 # * 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.
1046 # * 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.
1048 # Revision 1.41 2003/04/29 08:09:44 tipaul
1049 # z3950 support is coming...
1050 # * 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.
1051 # Note this is a 1st draft. More to follow (today ? I hope).
1053 # Revision 1.40 2003/04/22 10:48:27 wolfpac444
1054 # Added "father" column to bibliothesaurus table
1056 # Revision 1.39 2003/04/04 08:45:00 tipaul
1057 # last commits before 1.9.1
1059 # Revision 1.38 2003/03/18 10:58:19 tipaul
1060 # adding checkdigit parameter that choose how to check the members cardnumber.
1062 # * none = no checking
1063 # * katipo = checked as before
1065 # Revision 1.37 2003/01/30 01:47:48 acli
1066 # Corrected syntax error reported by Benedict
1068 # Made the indentation somewhat easier to read; the messiness probably caused
1069 # the original syntax error.
1071 # Revision 1.36 2003/01/28 15:13:30 tipaul
1072 # userflag table now created in upgrade script (bugfix #171)
1074 # Revision 1.35 2003/01/27 03:12:49 acli
1075 # Reworded the description for "acquisitions" to make it fit on the screen
1077 # Added "iso" to dateformat, since dateformat is not yet being used anyway
1079 # Revision 1.34 2003/01/23 12:30:02 tipaul
1080 # introducint marcflavour in systempref file : used for character decoding
1082 # Revision 1.33 2003/01/21 09:03:27 tipaul
1083 # bugfix (NOTE : this bugs makes installation of the 1.3.3 a little fuzzy. Please fix your DB if you installed 1.3.3)
1085 # Revision 1.32 2003/01/16 10:29:45 tipaul
1086 # adding a MARC parameter in systempref ( which is ON or OFF)
1087 # the search will be a marc search if MARC=ON
1088 # and a standard (v1.2) search if MARC=OFF
1090 # Revision 1.31 2003/01/06 13:32:43 tipaul
1091 # *** empty log message ***
1093 # Revision 1.29 2003/01/06 11:14:11 tipaul
1094 # last bugfixes before 1.3.3 : systempref table correctly filled
1096 # Revision 1.28 2002/12/10 13:27:47 tipaul
1097 # bugfixes (davide mails in koha-dev)
1099 # Revision 1.27 2002/11/26 15:04:54 tipaul
1100 # road to 1.3.2. Updating db structure during installation
1102 # Revision 1.26 2002/11/12 17:42:40 tonnesen
1103 # Merged some features over from rel-1-2, including primary key checking.
1105 # Revision 1.25 2002/11/12 16:44:38 tipaul
1108 # * 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)
1110 # Revision 1.24 2002/10/30 14:00:23 arensb
1111 # (bug fix): Fixed typo.
1113 # Revision 1.23 2002/10/25 10:55:46 tipaul
1115 # * bugfixes and improvements
1116 # * manage mandatory MARC subfields
1117 # * 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.
1118 # this submit contains everything needed :
1121 # * "links" management
1122 # * creation of a html-list if a subfield is mapped to an authorised value.
1124 # Note this is different from authorities support, which will come soon.
1125 # 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...
1127 # Revision 1.22 2002/10/15 10:08:19 tipaul
1128 # fixme corrected, re-indent and adding the marc_breeding table (see commit of marcimport.pl for more explanations about breeding)
1130 # Revision 1.21 2002/10/14 11:48:59 tipaul
1133 # Revision 1.20 2002/10/10 04:49:41 arensb
1134 # Added some FIXME comments.
1136 # Revision 1.19 2002/10/05 10:17:17 arensb
1137 # Merged with arensb-context branch: use C4::Context->dbh instead of
1138 # &C4Connect, and generally prefer C4::Context over C4::Database.
1140 # Revision 1.18.2.2 2002/10/05 06:18:43 arensb
1141 # Added a whole mess of FIXME comments.
1143 # Revision 1.18.2.1 2002/10/04 02:46:00 arensb
1144 # Use C4::Connect instead of C4::Database, C4::Connect->dbh instead
1147 # Revision 1.18 2002/09/24 13:50:55 tipaul
1148 # long WAS the road to 1.3.0...
1149 # coming VERY SOON NOW...
1150 # modifying installer and buildrelease to update the DB
1152 # Revision 1.17 2002/09/24 12:57:35 tipaul
1153 # long WAS the road to 1.3.0...
1154 # coming VERY SOON NOW...
1155 # modifying installer and buildrelease to update the DB
1157 # Revision 1.16 2002/07/31 02:34:27 finlayt
1159 # added "notforloan" field to the itemtypes table.
1161 # Revision 1.15 2002/07/20 22:30:06 rangi
1162 # Making sure fix makes it into the main branch as well
1165 # Revision 1.14 2002/07/08 16:20:26 tonnesen
1166 # Added sessionqueries table and password/userid fields to borrowers table
1168 # Revision 1.13 2002/07/04 18:05:36 tonnesen
1171 # Revision 1.12 2002/07/04 16:41:06 tonnesen
1172 # Merged changes from rel-1-2. Abstracted table structure changes by alan.