-
Notifications
You must be signed in to change notification settings - Fork 62
/
update22to30.pl
executable file
·2218 lines (2136 loc) · 80.8 KB
/
update22to30.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/perl
# $Id$
# Database Updater
# This script checks for required updates to the database.
# Part of the Koha Library Software www.koha.org
# Licensed under the GPL.
# Bugs/ToDo:
# - Would also be a good idea to offer to do a backup at this time...
# NOTE: If you do something more than once in here, make it table driven.
use strict;
# CPAN modules
use DBI;
use Getopt::Long;
# Koha modules
use C4::Context;
use MARC::Record;
use MARC::File::XML ( BinaryEncoding => 'utf8' );
# FIXME - The user might be installing a new database, so can't rely
# on /etc/koha.conf anyway.
my $debug = 0;
my (
$sth, $sti,
$query,
%existingtables, # tables already in database
%types,
$table,
$column,
$type, $null, $key, $default, $extra,
$prefitem, # preference item in systempreferences table
);
my $silent;
GetOptions(
's' =>\$silent
);
my $dbh = C4::Context->dbh;
$|=1; # flushes output
my $DBversion = "3.00.00.000";
# if we are upgrading from Koha 2.2, then we need to run the complete & long updatedatabase
# Tables to add if they don't exist
my %requiretables = (
action_logs => "(
`timestamp` TIMESTAMP NOT NULL ,
`user` INT( 11 ) NOT NULL default '0' ,
`module` TEXT default '',
`action` TEXT default '' ,
`object` INT(11) NULL ,
`info` TEXT default '' ,
PRIMARY KEY ( `timestamp` , `user` )
)",
letter => "(
module varchar(20) NOT NULL default '',
code varchar(20) NOT NULL default '',
name varchar(100) NOT NULL default '',
title varchar(200) NOT NULL default '',
content text,
PRIMARY KEY (module,code)
)",
alert =>"(
alertid int(11) NOT NULL auto_increment,
borrowernumber int(11) NOT NULL default '0',
type varchar(10) NOT NULL default '',
externalid varchar(20) NOT NULL default '',
PRIMARY KEY (alertid),
KEY borrowernumber (borrowernumber),
KEY type (type,externalid)
)",
opac_news => "(
`idnew` int(10) unsigned NOT NULL auto_increment,
`title` varchar(250) NOT NULL default '',
`new` text NOT NULL,
`lang` varchar(4) NOT NULL default '',
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY (`idnew`)
)",
repeatable_holidays => "(
`id` int(11) NOT NULL auto_increment,
`branchcode` varchar(4) NOT NULL default '',
`weekday` smallint(6) default NULL,
`day` smallint(6) default NULL,
`month` smallint(6) default NULL,
`title` varchar(50) NOT NULL default '',
`description` text NOT NULL,
PRIMARY KEY (`id`)
)",
special_holidays => "(
`id` int(11) NOT NULL auto_increment,
`branchcode` varchar(4) NOT NULL default '',
`day` smallint(6) NOT NULL default '0',
`month` smallint(6) NOT NULL default '0',
`year` smallint(6) NOT NULL default '0',
`isexception` smallint(1) NOT NULL default '1',
`title` varchar(50) NOT NULL default '',
`description` text NOT NULL,
PRIMARY KEY (`id`)
)",
overduerules =>"(`branchcode` varchar(255) NOT NULL default '',
`categorycode` char(2) NOT NULL default '',
`delay1` int(4) default '0',
`letter1` varchar(20) default NULL,
`debarred1` char(1) default '0',
`delay2` int(4) default '0',
`debarred2` char(1) default '0',
`letter2` varchar(20) default NULL,
`delay3` int(4) default '0',
`letter3` varchar(20) default NULL,
`debarred3` int(1) default '0',
PRIMARY KEY (`branchcode`,`categorycode`)
)",
cities => "(`cityid` int auto_increment,
`city_name` char(100) NOT NULL,
`city_zipcode` char(20),
PRIMARY KEY (`cityid`)
)",
roadtype => "(`roadtypeid` int auto_increment,
`road_type` char(100) NOT NULL,
PRIMARY KEY (`roadtypeid`)
)",
labels => "(
labelid int(11) NOT NULL auto_increment,
itemnumber varchar(100) NOT NULL default '',
timestamp timestamp(14) NOT NULL,
PRIMARY KEY (labelid)
)",
labels_conf => "(
id int(4) NOT NULL auto_increment,
barcodetype char(100) default '',
title tinyint(1) default '0',
isbn tinyint(1) default '0',
itemtype tinyint(1) default '0',
barcode tinyint(1) default '0',
dewey tinyint(1) default '0',
class tinyint(1) default '0',
author tinyint(1) default '0',
papertype char(100) default '',
startrow int(2) default NULL,
PRIMARY KEY (id)
)",
reviews => "(
reviewid integer NOT NULL auto_increment,
borrowernumber integer,
biblionumber integer,
review text,
approved tinyint,
datereviewed datetime,
PRIMARY KEY (reviewid)
)",
subscriptionroutinglist=>"(
routingid integer NOT NULL auto_increment,
borrowernumber integer,
ranking integer,
subscriptionid integer,
PRIMARY KEY (routingid)
)",
notifys => "(
notify_id int(11) NOT NULL default '0',
`borrowernumber` int(11) NOT NULL default '0',
`itemnumber` int(11) NOT NULL default '0',
`notify_date` date NOT NULL default '0000-00-00',
`notify_send_date` date default NULL,
`notify_level` int(1) NOT NULL default '0',
`method` varchar(20) NOT NULL default ''
)",
charges => "(
`charge_id` varchar(5) NOT NULL default '',
`description` text NOT NULL,
`amount` decimal(28,6) NOT NULL default '0.000000',
`min` int(4) NOT NULL default '0',
`max` int(4) NOT NULL default '0',
`level` int(1) NOT NULL default '0',
PRIMARY KEY (`charge_id`)
)",
tags => "(
`entry` varchar(255) NOT NULL default '',
`weight` bigint(20) NOT NULL default '0',
PRIMARY KEY (`entry`)
)
",
zebraqueue => "(
`id` int NOT NULL auto_increment,
`biblio_auth_number` int NOT NULL,
`operation` char(20) NOT NULL,
`server` char(20) NOT NULL ,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci AUTO_INCREMENT=1",
);
my %requirefields = (
subscription => { 'letter' => 'char(20) NULL', 'distributedto' => 'text NULL', 'firstacquidate'=>'date NOT NULL','irregularity'=>'TEXT NULL default \'\'','numberpattern'=>'TINYINT(3) NULL default 0', 'callnumber'=>'text NULL', 'hemisphere' =>'TINYINT(3) NULL default 0', 'issuesatonce'=>'TINYINT(3) NOT NULL default 1', 'branchcode' =>'varchar(12) NOT NULL default \'\'', 'manualhistory'=>'TINYINT(1) NOT NULL default 0','internalnotes'=>'LONGTEXT NULL default \'\''},
itemtypes => { 'imageurl' => 'char(200) NULL'},
aqbookfund => { 'branchcode' => 'varchar(4) NULL'},
aqbudget => { 'branchcode' => 'varchar(4) NULL'},
auth_header => { 'marc' => 'BLOB NOT NULL', 'linkid' => 'BIGINT(20) NULL'},
auth_subfield_structure =>{ 'hidden' => 'TINYINT(3) NOT NULL default 0', 'kohafield' => 'VARCHAR(45) NULL', 'linkid' => 'TINYINT(1) NOT NULL default 0', 'isurl' => 'TINYINT(1)', 'frameworkcode'=>'VARCHAR(8) NOT NULL'},
marc_breeding => { 'isbn' => 'varchar(13) NOT NULL'},
serial =>{ 'publisheddate' => 'date', 'claimdate' => 'date', 'itemnumber'=>'text NULL','routingnotes'=>'text NULL',},
statistics => { 'associatedborrower' => 'integer'},
z3950servers =>{ "name" =>"text", "description" => "text NOT NULL",
"position" =>"enum('primary','secondary','') NOT NULL default 'primary'", "icon" =>"text",
"type" =>"enum('zed','opensearch') NOT NULL default 'zed'",
},
issues =>{ 'issuedate'=>"date NOT NULL default '0000-00-00'", },
# tablename => { 'field' => 'fieldtype' },
);
# Enter here the table to delete.
my @TableToDelete = qw(
additionalauthors
bibliosubject
bibliosubtitle
bibliothesaurus
);
my %uselessfields = (
# tablename => "field1,field2",
borrowers => "suburb,altstreetaddress,altsuburb,altcity,studentnumber,school,area,preferredcont,altcp",
deletedborrowers=> "suburb,altstreetaddress,altsuburb,altcity,studentnumber,school,area,preferredcont,altcp",
);
# the other hash contains other actions that can't be done elsewhere. they are done
# either BEFORE of AFTER everything else, depending on "when" entry (default => AFTER)
# The tabledata hash contains data that should be in the tables.
# The uniquefieldrequired hash entry is used to determine which (if any) fields
# must not exist in the table for this row to be inserted. If the
# uniquefieldrequired entry is already in the table, the existing data is not
# modified, unless the forceupdate hash entry is also set. Fields in the
# anonymous "forceupdate" hash will be forced to be updated to the default
# values given in the %tabledata hash.
my %tabledata = (
# tablename => [
# { uniquefielrequired => 'fieldname', # the primary key in the table
# fieldname => fieldvalue,
# fieldname2 => fieldvalue2,
# },
# ],
systempreferences => [
{
uniquefieldrequired => 'variable',
variable => 'useDaysMode',
value => 'Calendar',
forceupdate => { 'explanation' => 1,
'type' => 1},
explanation => 'How to calculate return dates : Calendar means holidays will be controled, Days means the return date don\'t depend on holidays',
type => 'Choice',
options => 'Calendar|Days'
},
{
uniquefieldrequired => 'variable',
variable => 'DebugLevel',
value => '0',
forceupdate => { 'explanation' => 1,
'type' => 1},
explanation => 'Set the level of error info sent to the browser. 0=none, 1=some, 2=most',
type => 'Choice',
options => '0|1|2'
},
{
uniquefieldrequired => 'variable',
variable => 'BorrowersTitles',
value => 'Mr|Mrs|Miss|Ms',
forceupdate => { 'explanation' => 1,
'type' => 1},
explanation => 'List all Titles for borrowers',
type => 'free',
},
{
uniquefieldrequired => 'variable',
variable => 'BorrowerMandatoryField',
value => 'cardnumber|surname|address',
forceupdate => { 'explanation' => 1,
'type' => 1},
explanation => 'List all mandatory fields for borrowers',
type => 'free',
},
{
uniquefieldrequired => 'variable',
variable => 'borrowerRelationship',
value => 'father|mother,grand-mother',
forceupdate => { 'explanation' => 1,
'type' => 1},
explanation => 'The relationships between a guarantor & a guarantee (separated by | or ,)',
type => 'free',
},
{
uniquefieldrequired => 'variable',
variable => 'ReservesMaxPickUpDelay',
value => '10',
forceupdate => { 'explanation' => 1,
'type' => 1},
explanation => 'Maximum delay to pick up a reserved document',
type => 'free',
},
{
uniquefieldrequired => 'variable',
variable => 'TransfersMaxDaysWarning',
value => '3',
forceupdate => { 'explanation' => 1,
'type' => 1},
explanation => 'Max delay before considering the transfer has potentialy a problem',
type => 'free',
},
{
uniquefieldrequired => 'variable',
variable => 'memberofinstitution',
value => '0',
forceupdate => { 'explanation' => 1,
'type' => 1},
explanation => 'Are your patrons members of institutions',
type => 'YesNo',
},
{
uniquefieldrequired => 'variable',
variable => 'ReadingHistory',
value => '0',
forceupdate => { 'explanation' => 1,
'type' => 1},
explanation => 'Allow reading record info retrievable from issues and oldissues tables',
type => 'YesNo',
},
{
uniquefieldrequired => 'variable',
variable => 'IssuingInProcess',
value => '0',
forceupdate => { 'explanation' => 1,
'type' => 1},
explanation => 'Allow no debt alert if the patron is issuing item that accumulate debt',
type => 'YesNo',
},
{
uniquefieldrequired => 'variable',
variable => 'AutomaticItemReturn',
value => '1',
forceupdate => { 'explanation' => 1,
'type' => 1},
explanation => 'This Variable allow or not to return automaticly to his homebranch',
type => 'YesNo',
},
{
uniquefieldrequired => 'variable',
variable => 'reviewson',
value => '0',
forceupdate => { 'explanation' => 1,
'type' => 1},
explanation => 'Allows patrons to submit reviews from the opac',
type => 'YesNo',
},
{
uniquefieldrequired => 'variable',
variable => 'intranet_includes',
value => 'includes',
forceupdate => { 'explanation' => 1,
'type' => 1},
explanation => 'The includes directory you want for specific look of Koha (includes or includes_npl for example)',
type => 'Free',
},
{
uniquefieldrequired => 'variable',
variable => 'AutoLocation',
value => '0',
forceupdate => { 'explanation' => 1,
'type' => 1},
explanation => 'switch to activate or not Autolocation, if Yes, the Librarian can\'t change his location, it\'s defined by branchip',
type => 'YesNo',
},
{
uniquefieldrequired => 'variable',
variable => 'serialsadditems',
value => '0',
forceupdate => {
'explanation' => 1,
'type' => 1
},
explanation => 'If set, a new item will be automatically added when receiving an issue',
type => 'YesNo',
},
{
uniquefieldrequired => 'variable',
variable => 'expandedSearchOption',
value => '0',
forceupdate => {
'explanation' => 1,
'type' => 1
},
explanation => 'search among marc field',
type => 'YesNo',
},
{
uniquefieldrequired => 'variable',
variable => 'RequestOnOpac',
value => '1',
forceupdate => { 'explanation' => 1,
'type' => 1},
explanation => 'option to allow reserves on opac',
type => 'YesNo',
},
{
uniquefieldrequired => 'variable',
variable => 'OpacCloud',
value => '1',
forceupdate => { 'explanation' => 1,
'type' => 1},
explanation => 'Enable / Disable cloud link on OPAC (Require to run misc/cronjobs/build_browser_and_cloud.pl on the server)',
type => 'YesNo',
},
{
uniquefieldrequired => 'variable',
variable => 'OpacBrowser',
value => '1',
forceupdate => { 'explanation' => 1,
'type' => 1},
explanation => 'Enable/Disable browser link on OPAC (Require to run misc/cronjobs/build_browser_and_cloud.pl on the server)',
type => 'YesNo',
},
{
uniquefieldrequired => 'variable',
variable => 'OpacTopissue',
value => '1',
forceupdate => { 'explanation' => 1,
'type' => 1},
explanation => 'Enable / Disable the top issue link on OPAC',
type => 'YesNo',
},
{
uniquefieldrequired => 'variable',
variable => 'OpacAuthorities',
value => '1',
forceupdate => { 'explanation' => 1,
'type' => 1},
explanation => 'Enable / Disable the search authority link on OPAC',
type => 'YesNo',
},
{
uniquefieldrequired => 'variable',
variable => 'CataloguingLog',
value => '0',
forceupdate => {'explanation' => 1, 'type' => 1},
explanation => 'Active this if you want to log cataloguing action.',
type => 'YesNo',
},
{
uniquefieldrequired => 'variable',
variable => 'BorrowersLog',
value => '0',
forceupdate => {'explanation' => 1, 'type' => 1},
explanation => 'Active this if you want to log borrowers edition/creation/deletion...',
type => 'YesNo',
},
{
uniquefieldrequired => 'variable',
variable => 'SubscriptionLog',
value => '0',
forceupdate => {'explanation' => 1, 'type' => 1},
explanation => 'Active this if you want to log Subscription action',
type => 'YesNo',
},
{
uniquefieldrequired => 'variable',
variable => 'IssueLog',
value => '0',
forceupdate => {'explanation' => 1, 'type' => 1},
explanation => 'Active this if you want to log issue.',
type => 'YesNo',
},
{
uniquefieldrequired => 'variable',
variable => 'ReturnLog',
value => '0',
forceupdate => {'explanation' => 1, 'type' => 1},
explanation => 'Active this if you want to log the circulation return',
type => 'YesNo',
},
{
uniquefieldrequired => 'variable',
variable => 'Version',
value => '3.0',
forceupdate => {'explanation' => 1, 'type' => 1},
explanation => 'Koha Version',
type => 'Free',
},
{
uniquefieldrequired => 'variable',
variable => 'LetterLog',
value => '0',
forceupdate => {'explanation' => 1, 'type' => 1},
explanation => 'Active this if you want to log all the letter sent',
type => 'YesNo',
},
{
uniquefieldrequired => 'variable',
variable => 'FinesLog',
value => '0',
forceupdate => {'explanation' => 1, 'type' => 1},
explanation => 'Active this if you want to log fines',
type => 'YesNo',
},
{
uniquefieldrequired => 'variable',
variable => 'NoZebra',
value => '0',
forceupdate => {'explanation' => 1, 'type' => 1},
explanation => 'Active this if you want NOT to use zebra (large libraries should avoid this parameters)',
type => 'YesNo',
},
{
uniquefieldrequired => 'variable',
variable => 'NoZebraIndexes',
value => '0',
forceupdate => {'explanation' => 1, 'type' => 1},
explanation => "Enter a specific hash for NoZebra indexes. Enter : 'indexname' => '100a,245a,500*','index2' => '...'",
type => 'Free',
},
{
uniquefieldrequired => 'variable',
variable => 'uppercasesurnames',
value => '0',
forceupdate => {'explanation' => 1, 'type' => 1},
explanation => "Force Surnames to be uppercase",
type => 'YesNo',
},
],
userflags => [
{
uniquefieldrequired => 'bit',
bit => '14',
flag => 'editauthorities',
flagdesc => 'allow to edit authorities',
defaulton => '0',
},
{
uniquefieldrequired => 'bit',
bit => '15',
flag => 'serials',
flagdesc => 'allow to manage serials subscriptions',
defaulton => '0',
},
{
uniquefieldrequired => 'bit',
bit => '16',
flag => 'reports',
flagdesc => 'allow to access to the reports module',
defaulton => '0',
},
],
authorised_values => [
{
uniquefieldrequired => 'id',
category => 'SUGGEST',
authorised_value => 'Not enough budget',
lib => 'This book it too much expensive',
}
],
);
my %fielddefinitions = (
# fieldname => [
# { field => 'fieldname',
# type => 'fieldtype',
# null => '',
# key => '',
# default => ''
# },
# ],
aqbasket => [
{
field => 'booksellerid',
type => 'int(11)',
null => 'NOT NULL',
key => '',
default => '1',
extra => '',
},
],
aqbookfund => [
{
field => 'bookfundid',
type => 'varchar(5)',
null => 'NOT NULL',
key => 'PRI',
default => '',
extra => '',
},
],
aqbooksellers => [
{
field => 'id',
type => 'int(11)',
null => 'NOT NULL',
key => 'PRI',
default => '',
extra => 'auto_increment',
},
{
field => 'listprice',
type => 'varchar(10)',
null => 'NULL',
key => '',
default => '',
extra => '',
},
{
field => 'invoiceprice',
type => 'varchar(10)',
null => 'NULL',
key => '',
default => '',
extra => '',
},
{
field => 'invoicedisc',
type => 'float(6,4)',
null => 'NULL',
key => '',
default => 'NULL',
extra => '',
},
],
aqbudget => [
{
field => 'bookfundid',
type => 'varchar(5)',
null => 'NOT NULL',
key => '',
default => '',
exra => '',
},
],
accountlines => [
{
field => 'notify_id',
type => 'int(11)',
null => 'NOT NULL',
key => '',
default => '0',
extra => '',
},
{
field => 'notify_level',
type => 'int(2)',
null => 'NOT NULL',
key => '',
default => '0',
extra => '',
},
{
field => 'accountno',
type => 'smallint(6)',
null => 'NOT NULL',
key => '',
default => '0',
extra => '',
},
{
field => 'description',
type => 'mediumtext',
null => 'NULL',
},
{
field => 'dispute',
type => 'mediumtext',
null => 'NULL',
},
],
borrowers => [
{ field => 'firstname',
type => 'text',
null => 'NULL',
},
{ field => 'initials',
type => 'text',
null => 'NULL',
},
{ field => 'B_email',
type => 'text',
null => 'NULL',
after => 'B_zipcode',
},
{
field => 'streetnumber', # street number (hidden if streettable table is empty)
type => 'char(10)',
null => 'NULL',
after => 'initials',
},
{
field => 'streettype', # street table, list builded from a system table
type => 'char(50)',
null => 'NULL',
after => 'streetnumber',
},
{ field => 'phone',
type => 'text',
null => 'NULL',
},
{
field => 'B_streetnumber', # street number (hidden if streettable table is empty)
type => 'char(10)',
null => 'NULL',
after => 'fax',
},
{
field => 'B_streettype', # street table, list builded from a system table
type => 'char(50)',
null => 'NULL',
after => 'B_streetnumber',
},
{
field => 'phonepro',
type => 'text',
null => 'NULL',
after => 'fax',
},
{
field => 'address2', # complement address
type => 'text',
null => 'NULL',
after => 'address',
},
{
field => 'emailpro',
type => 'text',
null => 'NULL',
after => 'fax',
},
{
field => 'contactfirstname', # contact's firstname
type => 'text',
null => 'NULL',
after => 'contactname',
},
{
field => 'contacttitle', # contact's title
type => 'text',
null => 'NULL',
after => 'contactfirstname',
},
{
field => 'branchcode',
type => 'varchar(10)',
null => 'NOT NULL',
default => '',
extra => '',
},
{
field => 'categorycode',
type => 'varchar(10)',
null => 'NOT NULL',
default => '',
extra => '',
}
],
biblioitems => [
{
field => 'itemtype',
type => 'varchar(10)',
null => 'NOT NULL',
key => '',
default => '',
extra => '',
},
{
field => 'lcsort',
type => 'varchar(25)',
null => 'NULL',
key => '',
default => '',
extra => '',
},
{
field => 'ccode',
type => 'varchar(4)',
null => 'NULL',
key => '',
default => '',
extra => '',
},
{
field => 'dewey',
type => 'varchar(30)',
null => 'null',
default => '',
extra => '',
},
{
field => 'publicationyear',
type => 'text',
null => 'null',
default => '',
extra => '',
},
{
field => 'collectiontitle',
type => 'mediumtext',
null => 'null',
default => '',
extra => '',
},
{
field => 'collectionissn',
type => 'mediumtext',
null => 'null',
default => '',
extra => '',
},
{
field => 'collectionvolume',
type => 'mediumtext',
null => 'null',
default => '',
extra => '',
},
{
field => 'editionstatement',
type => 'text',
null => 'null',
default => '',
extra => '',
},
{
field => 'editionresponsibility',
type => 'text',
null => 'null',
default => '',
extra => '',
},
],
deletedbiblioitems => [
{
field => 'itemtype',
type => 'varchar(10)',
null => 'NOT NULL',
default => '',
extra => '',
},
{
field => 'dewey',
type => 'varchar(30)',
null => 'null',
default => '',
extra => '',
},
],
branches => [
{
field => 'branchip',
type => 'varchar(15)',
null => 'NULL',
key => '',
default => '',
extra => '',
},
{
field => 'branchprinter',
type => 'varchar(100)',
null => 'NULL',
key => '',
default => '',
extra => '',
},
{
field => 'branchcode',
type => 'varchar(10)',
null => 'NOT NULL',
default => '',
extra => '',
}
],
branchtransfers =>[
{
field => 'frombranch',
type => 'VARCHAR(10)',
null => 'NOT NULL',
key => '',
default => '',
extra => '',
},
{
field => 'tobranch',
type => 'VARCHAR(10)',
null => 'NOT NULL',
key => '',
default => '',
}
],
categories => [
{
field => 'category_type',
type => 'char(1)',
null => 'NOT NULL',
key => '',
default => 'A',
extra => '',
},
{
field => 'categorycode',
type => 'varchar(10)',
null => 'NOT NULL',
key => 'PRI',
default => '',
extra => '',
},
],
deletedborrowers => [
{ field => 'firstname',
type => 'text',
null => 'NULL',
},
{ field => 'initials',
type => 'text',
null => 'NULL',
},
{ field => 'B_email',
type => 'text',
null => 'NULL',
after => 'B_zipcode',
},
{
field => 'streetnumber', # street number (hidden if streettable table is empty)
type => 'char(10)',
null => 'NULL',
after => 'initials',
},
{
field => 'streettype', # street table, list builded from a system table
type => 'char(50)',
null => 'NULL',
after => 'streetnumber',
},
{ field => 'phone',
type => 'text',
null => 'NULL',
},
{
field => 'B_streetnumber', # street number (hidden if streettable table is empty)
type => 'char(10)',
null => 'NULL',
after => 'fax',
},
{
field => 'B_streettype', # street table, list builded from a system table
type => 'char(50)',
null => 'NULL',
after => 'B_streetnumber',
},
{
field => 'phonepro',
type => 'text',
null => 'NULL',
after => 'fax',
},
{
field => 'address2', # complement address
type => 'text',
null => 'NULL',
after => 'address',
},
{
field => 'emailpro',
type => 'text',
null => 'NULL',
after => 'fax',
},
{
field => 'contactfirstname', # contact's firstname
type => 'text',
null => 'NULL',
after => 'contactname',
},
{
field => 'contacttitle', # contact's title
type => 'text',
null => 'NULL',
after => 'contactfirstname',
},