3 # Host: localhost Database: c4test
4 #--------------------------------------------------------
5 # Server version 3.22.32-log
8 # Table structure for table 'accountlines'
10 CREATE TABLE accountlines (
11 borrowernumber int(11) DEFAULT '0' NOT NULL,
12 accountno smallint(6) DEFAULT '0' NOT NULL,
18 accounttype varchar(5),
19 amountoutstanding decimal(28,6),
20 timestamp timestamp(14),
21 KEY acctsborridx (borrowernumber),
22 KEY timeidx (timestamp)
26 # Table structure for table 'accountoffsets'
28 CREATE TABLE accountoffsets (
29 borrowernumber int(11) DEFAULT '0' NOT NULL,
30 accountno smallint(6) DEFAULT '0' NOT NULL,
31 offsetaccount smallint(6) DEFAULT '0' NOT NULL,
32 offsetamount decimal(28,6),
33 timestamp timestamp(14)
37 # Table structure for table 'additionalauthors'
39 CREATE TABLE additionalauthors (
41 biblionumber int(11) DEFAULT '0' NOT NULL,
42 KEY bibidx (biblionumber)
46 # Table structure for table 'aqbookfund'
48 CREATE TABLE aqbookfund (
49 bookfundid varchar(5) DEFAULT '' NOT NULL,
51 bookfundgroup varchar(5)
55 # Table structure for table 'aqbooksellers'
57 CREATE TABLE aqbooksellers (
67 currency char(3) DEFAULT '' NOT NULL,
68 deliverydays smallint(6),
69 followupdays smallint(6),
70 followupscancel smallint(6),
80 contphone varchar(100),
82 contaltphone varchar(100),
83 contemail varchar(100),
87 invoiceprice varchar(5),
89 listincgst tinyint(4),
90 invoiceincgst tinyint(4),
96 # Table structure for table 'aqbudget'
98 CREATE TABLE aqbudget (
99 bookfundid char(5) DEFAULT '' NOT NULL,
100 startdate date DEFAULT '0000-00-00' NOT NULL,
102 budgetamount decimal(13,2)
106 # Table structure for table 'aqorderbreakdown'
108 CREATE TABLE aqorderbreakdown (
112 bookfundid char(5) DEFAULT '' NOT NULL,
113 allocation smallint(6)
117 # Table structure for table 'aqorderdelivery'
119 CREATE TABLE aqorderdelivery (
120 ordernumber date DEFAULT '0000-00-00' NOT NULL,
121 deliverynumber smallint(6) DEFAULT '0' NOT NULL,
122 deliverydate varchar(18),
123 qtydelivered smallint(6),
124 deliverycomments text
128 # Table structure for table 'aqorders'
130 CREATE TABLE aqorders (
131 ordernumber int(11) DEFAULT '0' NOT NULL auto_increment,
132 biblionumber int(11),
134 requisitionedby varchar(10),
135 authorisedby varchar(10),
136 booksellerid varchar(10) DEFAULT '' NOT NULL,
137 deliverydays smallint(6),
138 followupdays smallint(6),
139 numberfollowupsallowed smallint(6),
140 numberfollowupssent smallint(6),
143 quantity smallint(6),
145 listprice decimal(28,6),
146 totalamount decimal(28,6),
148 booksellerinvoicenumber text,
149 freight decimal(28,6),
150 unitprice decimal(28,6),
151 quantityreceived smallint(6),
153 cancelledby varchar(10),
154 quantityreceiveddamaged smallint(6),
155 datecancellationprinted date,
157 supplierreference text,
158 purchaseordernumber text,
159 subscription tinyint(1),
160 subscriptionfrom date,
162 serialid varchar(30),
164 biblioitemnumber int(11),
165 timestamp timestamp(14),
169 PRIMARY KEY (ordernumber)
173 # Table structure for table 'biblio'
175 CREATE TABLE biblio (
176 biblionumber int(11) DEFAULT '0' NOT NULL,
183 copyrightdate smallint(6),
184 timestamp timestamp(14),
185 KEY blbnoidx (biblionumber),
186 PRIMARY KEY (biblionumber)
190 # Table structure for table 'biblioanalysis'
192 CREATE TABLE biblioanalysis (
193 analyticaltitle text,
194 biblionumber int(11) DEFAULT '0' NOT NULL,
195 analyticalauthor text
199 # Table structure for table 'biblioitems'
201 CREATE TABLE biblioitems (
202 biblioitemnumber int(11) DEFAULT '0' NOT NULL,
203 biblionumber int(11) DEFAULT '0' NOT NULL,
206 classification varchar(25),
212 publicationyear smallint(6),
213 publishercode varchar(255),
215 volumeddesc varchar(255),
216 timestamp timestamp(14),
222 KEY bibinoidx (biblioitemnumber),
223 KEY bibnoidx (biblionumber),
224 PRIMARY KEY (biblioitemnumber)
228 # Table structure for table 'bibliosubject'
230 CREATE TABLE bibliosubject (
231 subject text NOT NULL,
232 biblionumber int(11) DEFAULT '0' NOT NULL
236 # Table structure for table 'bibliosubtitle'
238 CREATE TABLE bibliosubtitle (
239 subtitle text NOT NULL,
240 biblionumber int(11) DEFAULT '0' NOT NULL,
241 KEY bibsubidx (biblionumber)
245 # Table structure for table 'borexp'
247 CREATE TABLE borexp (
248 borrowernumber int(11),
253 # Table structure for table 'borrowers'
255 CREATE TABLE borrowers (
256 borrowernumber int(11) DEFAULT '0' NOT NULL,
257 cardnumber varchar(9) DEFAULT '' NOT NULL,
258 surname text NOT NULL,
259 firstname text NOT NULL,
262 initials text NOT NULL,
263 streetaddress text NOT NULL,
269 altstreetaddress text,
274 branchcode varchar(4) DEFAULT '' NOT NULL,
275 categorycode char(2),
277 gonenoaddress tinyint(1),
286 ethnicity varchar(50),
287 ethnotes varchar(255),
290 altnotes varchar(255),
291 altrelationship varchar(100),
293 phoneday varchar(50),
294 preferredcont char(1),
295 physstreet varchar(100),
296 KEY borrowernumber (borrowernumber),
297 KEY cardnumber (cardnumber)
301 # Table structure for table 'branchcategories'
303 CREATE TABLE branchcategories (
304 categorycode char(2) DEFAULT '' NOT NULL,
305 branchcode char(4) DEFAULT '' NOT NULL,
306 branchholding int(11)
310 # Table structure for table 'branches'
312 CREATE TABLE branches (
313 branchcode varchar(4) DEFAULT '' NOT NULL,
314 branchname text NOT NULL,
322 UNIQUE branchcode (branchcode)
326 # Table structure for table 'branchtransfers'
328 CREATE TABLE branchtransfers (
329 itemnumber int(11) DEFAULT '0' NOT NULL,
330 datesent date DEFAULT '0000-00-00' NOT NULL,
331 frombranch varchar(4),
338 # Table structure for table 'catalogueentry'
340 CREATE TABLE catalogueentry (
341 catalogueentry text NOT NULL,
350 # Table structure for table 'categories'
352 CREATE TABLE categories (
353 categorycode char(2) DEFAULT '' NOT NULL,
355 enrolmentperiod smallint(6),
356 upperagelimit smallint(6),
357 dateofbirthrequired tinyint(1),
358 finetype varchar(30),
360 enrolmentfee decimal(28,6),
361 overduenoticerequired tinyint(1),
362 issuelimit smallint(6),
363 reservefee decimal(28,6),
364 UNIQUE categorycode (categorycode)
368 # Table structure for table 'categoryitem'
370 CREATE TABLE categoryitem (
371 categorycode char(2) DEFAULT '' NOT NULL,
372 itemtype varchar(4) DEFAULT '' NOT NULL,
373 restrictedtype tinyint(1),
374 rentaldiscount decimal(28,6),
375 reservecharge decimal(28,6),
378 chargeperiod int(11),
380 chargename varchar(100)
384 # Table structure for table 'classification'
386 CREATE TABLE classification (
387 classification varchar(12) DEFAULT '' NOT NULL
391 # Table structure for table 'currency'
393 CREATE TABLE currency (
394 currency varchar(10),
399 # Table structure for table 'deletedbiblio'
401 CREATE TABLE deletedbiblio (
402 biblionumber int(11) DEFAULT '0' NOT NULL,
409 copyrightdate smallint(6),
410 timestamp timestamp(14),
411 KEY blbnoidx (biblionumber),
412 PRIMARY KEY (biblionumber)
416 # Table structure for table 'deletedbiblioitems'
418 CREATE TABLE deletedbiblioitems (
419 biblioitemnumber int(11) DEFAULT '0' NOT NULL,
420 biblionumber int(11) DEFAULT '0' NOT NULL,
423 classification varchar(25),
429 publicationyear smallint(6),
430 publishercode varchar(255),
432 volumeddesc varchar(255),
433 timestamp timestamp(14),
438 KEY bibinoidx (biblioitemnumber),
439 KEY bibnoidx (biblionumber),
440 PRIMARY KEY (biblioitemnumber)
444 # Table structure for table 'deletedborrowers'
446 CREATE TABLE deletedborrowers (
447 borrowernumber int(11) DEFAULT '0' NOT NULL,
448 cardnumber varchar(9) DEFAULT '' NOT NULL,
449 surname text NOT NULL,
450 firstname text NOT NULL,
453 initials text NOT NULL,
454 streetaddress text NOT NULL,
460 altstreetaddress text,
465 branchcode varchar(4) DEFAULT '' NOT NULL,
466 categorycode char(2),
468 gonenoaddress tinyint(1),
477 ethnicity varchar(50),
478 ethnotes varchar(255),
481 altnotes varchar(255),
482 altrelationship varchar(100),
484 phoneday varchar(50),
485 preferredcont varchar(100),
486 physstreet varchar(100),
487 KEY borrowernumber (borrowernumber),
488 KEY cardnumber (cardnumber)
492 # Table structure for table 'deleteditems'
494 CREATE TABLE deleteditems (
495 itemnumber int(11) DEFAULT '0' NOT NULL,
496 biblionumber int(11) DEFAULT '0' NOT NULL,
497 multivolumepart varchar(30),
498 biblioitemnumber int(11) DEFAULT '0' NOT NULL,
499 barcode varchar(9) DEFAULT '' NOT NULL,
500 dateaccessioned date,
501 booksellerid varchar(10),
502 homebranch varchar(4),
504 replacementprice decimal(28,6),
505 replacementpricedate date,
506 datelastborrowed date,
508 multivolume tinyint(1),
510 notforloan tinyint(1),
515 renewals smallint(6),
516 reserves smallint(6),
517 restricted tinyint(1),
518 binding decimal(28,6),
520 holdingbranch varchar(4),
522 timestamp timestamp(14),
523 KEY itembarcodeidx (barcode),
524 KEY itembinoidx (biblioitemnumber),
525 KEY itembibnoidx (biblionumber),
526 PRIMARY KEY (itemnumber),
527 UNIQUE barcode (barcode)
531 # Table structure for table 'issues'
533 CREATE TABLE issues (
534 borrowernumber int(11) DEFAULT '0' NOT NULL,
535 itemnumber int(11) DEFAULT '0' NOT NULL,
538 issuingbranch char(18),
540 lastreneweddate date,
543 timestamp timestamp(14),
544 KEY issuesborridx (borrowernumber),
545 KEY issuesitemidx (itemnumber),
546 KEY bordate (borrowernumber,timestamp)
550 # Table structure for table 'items'
553 itemnumber int(11) DEFAULT '0' NOT NULL,
554 biblionumber int(11) DEFAULT '0' NOT NULL,
555 multivolumepart varchar(30),
556 biblioitemnumber int(11) DEFAULT '0' NOT NULL,
557 barcode varchar(9) DEFAULT '' NOT NULL,
558 dateaccessioned date,
559 booksellerid varchar(10),
560 homebranch varchar(4),
562 replacementprice decimal(8,2),
563 replacementpricedate date,
564 datelastborrowed date,
566 multivolume tinyint(1),
568 notforloan tinyint(1),
573 renewals smallint(6),
574 reserves smallint(6),
575 restricted tinyint(1),
576 binding decimal(28,6),
578 holdingbranch varchar(4),
580 timestamp timestamp(14),
581 KEY itembarcodeidx (barcode),
582 KEY itembinoidx (biblioitemnumber),
583 KEY itembibnoidx (biblionumber),
584 PRIMARY KEY (itemnumber),
585 UNIQUE barcode (barcode)
589 # Table structure for table 'itemsprices'
591 CREATE TABLE itemsprices (
593 price1 decimal(28,6),
598 # Table structure for table 'itemtypes'
600 CREATE TABLE itemtypes (
601 itemtype varchar(4) DEFAULT '' NOT NULL,
603 loanlength smallint(6),
604 renewalsallowed smallint(6),
605 rentalcharge double(16,4),
606 UNIQUE itemtype (itemtype)
610 # Table structure for table 'multipart'
612 CREATE TABLE multipart (
613 itemnumber int(11) DEFAULT '0' NOT NULL,
614 other int(11) DEFAULT '0' NOT NULL
618 # Table structure for table 'multivolume'
620 CREATE TABLE multivolume (
621 biblionumber int(11) DEFAULT '0' NOT NULL,
622 multivolumepart varchar(30) DEFAULT '' NOT NULL
626 # Table structure for table 'newitems'
628 CREATE TABLE newitems (
629 itemnumber int(11) DEFAULT '0' NOT NULL,
630 publishercode varchar(18),
631 biblionumber int(11) DEFAULT '0' NOT NULL,
632 multivolumepart varchar(30),
633 barcode varchar(9) DEFAULT '' NOT NULL,
634 dateaccessioned date,
635 booksellerid varchar(10),
636 homebranch varchar(4),
638 replacementprice decimal(28,6),
639 replacementpricedate date,
640 datelastborrowed date,
642 multivolume tinyint(1),
644 notforloan tinyint(1),
649 renewals smallint(6),
650 reserves smallint(6),
651 restricted tinyint(1),
652 binding decimal(28,6),
654 holdingbranch varchar(4),
658 classification varchar(12),
664 publicationyear smallint(6),
665 KEY itembarcodeidx (barcode),
666 KEY itembibnoidx (biblionumber),
667 PRIMARY KEY (itemnumber)
671 # Table structure for table 'printers'
673 CREATE TABLE printers (
674 printername char(40),
680 # Table structure for table 'procedures'
682 CREATE TABLE procedures (
685 proclevel smallint(6)
689 # Table structure for table 'publisher'
691 CREATE TABLE publisher (
692 publishercode varchar(18) DEFAULT '' NOT NULL,
693 publishername text NOT NULL
697 # Table structure for table 'reserveconstraints'
699 CREATE TABLE reserveconstraints (
700 borrowernumber int(11) DEFAULT '0' NOT NULL,
701 reservedate date DEFAULT '0000-00-00' NOT NULL,
702 biblionumber int(11) DEFAULT '0' NOT NULL,
703 biblioitemnumber int(11),
704 timestamp timestamp(14)
708 # Table structure for table 'reserves'
710 CREATE TABLE reserves (
711 borrowernumber int(11) DEFAULT '0' NOT NULL,
712 reservedate date DEFAULT '0000-00-00' NOT NULL,
713 biblionumber int(11) DEFAULT '0' NOT NULL,
714 constrainttype char(1),
715 branchcode varchar(4),
716 notificationdate date,
718 cancellationdate date,
720 priority smallint(6),
722 timestamp timestamp(14),
727 # Table structure for table 'searchstats'
729 CREATE TABLE searchstats (
735 # Table structure for table 'serialissues'
737 CREATE TABLE serialissues (
738 biblionumber int(11) DEFAULT '0' NOT NULL,
739 volume varchar(20) DEFAULT '' NOT NULL,
740 number varchar(20) DEFAULT '' NOT NULL,
741 ordernumber smallint(6),
742 issuedate varchar(20),
747 # Table structure for table 'statistics'
749 CREATE TABLE statistics (
750 datetime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
756 usercode varchar(10),
759 borrowernumber int(11) default NULL,
760 KEY timeidx (datetime)
764 # Table structure for table 'stopwords'
766 CREATE TABLE stopwords (
771 # Table structure for table 'systempreferences'
773 CREATE TABLE systempreferences (
774 variable char(50) DEFAULT '' NOT NULL,
776 PRIMARY KEY (variable)
780 # Table structure for table 'users'
783 usercode varchar(10),