Modifications for new acqui.simple
[koha.git] / database.mysql
1 # MySQL dump 7.1
2 #
3 # Host: localhost    Database: c4test
4 #--------------------------------------------------------
5 # Server version        3.22.32-log
6
7 #
8 # Table structure for table 'accountlines'
9 #
10 CREATE TABLE accountlines (
11   borrowernumber int(11) DEFAULT '0' NOT NULL,
12   accountno smallint(6) DEFAULT '0' NOT NULL,
13   itemnumber int(11),
14   date date,
15   amount decimal(28,6),
16   description text,
17   dispute text,
18   accounttype varchar(5),
19   amountoutstanding decimal(28,6),
20   timestamp timestamp(14),
21   KEY acctsborridx (borrowernumber),
22   KEY timeidx (timestamp)
23 );
24
25 #
26 # Table structure for table 'accountoffsets'
27 #
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)
34 );
35
36 #
37 # Table structure for table 'additionalauthors'
38 #
39 CREATE TABLE additionalauthors (
40   author text NOT NULL,
41   biblionumber int(11) DEFAULT '0' NOT NULL,
42   KEY bibidx (biblionumber)
43 );
44
45 #
46 # Table structure for table 'aqbookfund'
47 #
48 CREATE TABLE aqbookfund (
49   bookfundid varchar(5) DEFAULT '' NOT NULL,
50   bookfundname text,
51   bookfundgroup varchar(5)
52 );
53
54 #
55 # Table structure for table 'aqbooksellers'
56 #
57 CREATE TABLE aqbooksellers (
58   id int(11),
59   name text,
60   address1 text,
61   address2 text,
62   address3 text,
63   address4 text,
64   phone varchar(30),
65   accountnumber text,
66   othersupplier text,
67   currency char(3) DEFAULT '' NOT NULL,
68   deliverydays smallint(6),
69   followupdays smallint(6),
70   followupscancel smallint(6),
71   specialty text,
72   booksellerfax text,
73   notes text,
74   bookselleremail text,
75   booksellerurl text,
76   contact varchar(100),
77   postal text,
78   url varchar(255),
79   contpos varchar(100),
80   contphone varchar(100),
81   contfax varchar(100),
82   contaltphone varchar(100),
83   contemail varchar(100),
84   contnotes text,
85   active tinyint(4),
86   listprice varchar(5),
87   invoiceprice varchar(5),
88   gstreg tinyint(4),
89   listincgst tinyint(4),
90   invoiceincgst tinyint(4),
91   discount float(6,4),
92   fax varchar(50)
93 );
94
95 #
96 # Table structure for table 'aqbudget'
97 #
98 CREATE TABLE aqbudget (
99   bookfundid char(5) DEFAULT '' NOT NULL,
100   startdate date DEFAULT '0000-00-00' NOT NULL,
101   enddate date,
102   budgetamount decimal(13,2)
103 );
104
105 #
106 # Table structure for table 'aqorderbreakdown'
107 #
108 CREATE TABLE aqorderbreakdown (
109   ordernumber int(11),
110   linenumber int(11),
111   branchcode char(4),
112   bookfundid char(5) DEFAULT '' NOT NULL,
113   allocation smallint(6)
114 );
115
116 #
117 # Table structure for table 'aqorderdelivery'
118 #
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
125 );
126
127 #
128 # Table structure for table 'aqorders'
129 #
130 CREATE TABLE aqorders (
131   ordernumber int(11) DEFAULT '0' NOT NULL auto_increment,
132   biblionumber int(11),
133   title text,
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),
141   entrydate date,
142   dateprinted date,
143   quantity smallint(6),
144   currency char(3),
145   listprice decimal(28,6),
146   totalamount decimal(28,6),
147   datereceived date,
148   booksellerinvoicenumber text,
149   freight decimal(28,6),
150   unitprice decimal(28,6),
151   quantityreceived smallint(6),
152   sourced text,
153   cancelledby varchar(10),
154   quantityreceiveddamaged smallint(6),
155   datecancellationprinted date,
156   notes text,
157   supplierreference text,
158   purchaseordernumber text,
159   subscription tinyint(1),
160   subscriptionfrom date,
161   subscriptionto date,
162   serialid varchar(30),
163   basketno int(11),
164   biblioitemnumber int(11),
165   timestamp timestamp(14),
166   rrp decimal(13,2),
167   ecost decimal(13,2),
168   gst decimal(13,2),
169   PRIMARY KEY (ordernumber)
170 );
171
172 #
173 # Table structure for table 'biblio'
174 #
175 CREATE TABLE biblio (
176   biblionumber int(11) DEFAULT '0' NOT NULL,
177   author text,
178   title text,
179   unititle text,
180   notes text,
181   abstract text,
182   serial tinyint(1),
183   seriestitle text,
184   copyrightdate smallint(6),
185   timestamp timestamp(14),
186   KEY blbnoidx (biblionumber),
187   PRIMARY KEY (biblionumber)
188 );
189
190 #
191 # Table structure for table 'biblioanalysis'
192 #
193 CREATE TABLE biblioanalysis (
194   analyticaltitle text,
195   biblionumber int(11) DEFAULT '0' NOT NULL,
196   analyticalauthor text
197 );
198
199 #
200 # Table structure for table 'biblioitems'
201 #
202 CREATE TABLE biblioitems (
203   biblioitemnumber int(11) DEFAULT '0' NOT NULL,
204   biblionumber int(11) DEFAULT '0' NOT NULL,
205   volume text,
206   number text,
207   classification varchar(25),
208   itemtype varchar(4),
209   url varchar(255),
210   isbn varchar(14),
211   issn varchar(9),
212   dewey double(8,6),
213   subclass char(3),
214   publicationyear smallint(6),
215   publishercode varchar(255),
216   volumedate date,
217   volumeddesc varchar(255),
218   timestamp timestamp(14),
219   illus varchar(255),
220   pages varchar(255),
221   notes text,
222   size varchar(255),
223   place varchar(255),
224   KEY bibinoidx (biblioitemnumber),
225   KEY bibnoidx (biblionumber),
226   PRIMARY KEY (biblioitemnumber)
227 );
228
229 #
230 # Table structure for table 'bibliosubject'
231 #
232 CREATE TABLE bibliosubject (
233   subject text NOT NULL,
234   biblionumber int(11) DEFAULT '0' NOT NULL
235 );
236
237 #
238 # Table structure for table 'bibliosubtitle'
239 #
240 CREATE TABLE bibliosubtitle (
241   subtitle text NOT NULL,
242   biblionumber int(11) DEFAULT '0' NOT NULL,
243   KEY bibsubidx (biblionumber)
244 );
245
246 #
247 # Table structure for table 'borexp'
248 #
249 CREATE TABLE borexp (
250   borrowernumber int(11),
251   newexp date
252 );
253
254 #
255 # Table structure for table 'borrowers'
256 #
257 CREATE TABLE borrowers (
258   borrowernumber int(11) DEFAULT '0' NOT NULL,
259   cardnumber varchar(9) DEFAULT '' NOT NULL,
260   surname text NOT NULL,
261   firstname text NOT NULL,
262   title text,
263   othernames text,
264   initials text NOT NULL,
265   streetaddress text NOT NULL,
266   suburb text,
267   city text NOT NULL,
268   phone text NOT NULL,
269   emailaddress text,
270   faxnumber text,
271   altstreetaddress text,
272   altsuburb text,
273   altcity text,
274   altphone text,
275   dateofbirth date,
276   branchcode varchar(4) DEFAULT '' NOT NULL,
277   categorycode char(2),
278   dateenrolled date,
279   gonenoaddress tinyint(1),
280   lost tinyint(1),
281   debarred tinyint(1),
282   studentnumber text,
283   school text,
284   contactname text,
285   borrowernotes text,
286   guarantor int(11),
287   area char(2),
288   ethnicity varchar(50),
289   ethnotes varchar(255),
290   sex char(1),
291   expiry date,
292   altnotes varchar(255),
293   altrelationship varchar(100),
294   streetcity text,
295   phoneday varchar(50),
296   preferredcont char(1),
297   physstreet varchar(100),
298   KEY borrowernumber (borrowernumber),
299   KEY cardnumber (cardnumber)
300 );
301
302 #
303 # Table structure for table 'branchcategories'
304 #
305 CREATE TABLE branchcategories (
306   categorycode char(2) DEFAULT '' NOT NULL,
307   branchcode char(4) DEFAULT '' NOT NULL,
308   branchholding int(11)
309 );
310
311 #
312 # Table structure for table 'branches'
313 #
314 CREATE TABLE branches (
315   branchcode varchar(4) DEFAULT '' NOT NULL,
316   branchname text NOT NULL,
317   branchaddress1 text,
318   branchaddress2 text,
319   branchaddress3 text,
320   branchphone text,
321   branchfax text,
322   branchemail text,
323   issuing tinyint(4),
324   UNIQUE branchcode (branchcode)
325 );
326
327 #
328 # Table structure for table 'branchtransfers'
329 #
330 CREATE TABLE branchtransfers (
331   itemnumber int(11) DEFAULT '0' NOT NULL,
332   datesent date DEFAULT '0000-00-00' NOT NULL,
333   frombranch varchar(4),
334   datearrived date,
335   tobranch varchar(4),
336   comments text
337 );
338
339 #
340 # Table structure for table 'catalogueentry'
341 #
342 CREATE TABLE catalogueentry (
343   catalogueentry text NOT NULL,
344   entrytype char(2),
345   see text,
346   seealso text,
347   seeinstead text,
348   biblionumber int(11)
349 );
350
351 #
352 # Table structure for table 'categories'
353 #
354 CREATE TABLE categories (
355   categorycode char(2) DEFAULT '' NOT NULL,
356   description text,
357   enrolmentperiod smallint(6),
358   upperagelimit smallint(6),
359   dateofbirthrequired tinyint(1),
360   finetype varchar(30),
361   bulk tinyint(1),
362   enrolmentfee decimal(28,6),
363   overduenoticerequired tinyint(1),
364   issuelimit smallint(6),
365   reservefee decimal(28,6),
366   UNIQUE categorycode (categorycode)
367 );
368
369 #
370 # Table structure for table 'categoryitem'
371 #
372 CREATE TABLE categoryitem (
373   categorycode char(2) DEFAULT '' NOT NULL,
374   itemtype varchar(4) DEFAULT '' NOT NULL,
375   restrictedtype tinyint(1),
376   rentaldiscount decimal(28,6),
377   reservecharge decimal(28,6),
378   fine decimal(28,6),
379   firstremind int(11),
380   chargeperiod int(11),
381   accountsent int(11),
382   chargename varchar(100)
383 );
384
385 #
386 # Table structure for table 'classification'
387 #
388 CREATE TABLE classification (
389   classification varchar(12) DEFAULT '' NOT NULL
390 );
391
392 #
393 # Table structure for table 'currency'
394 #
395 CREATE TABLE currency (
396   currency varchar(10),
397   rate float(7,5)
398 );
399
400 #
401 # Table structure for table 'deletedbiblio'
402 #
403 CREATE TABLE deletedbiblio (
404   biblionumber int(11) DEFAULT '0' NOT NULL,
405   author text,
406   title text,
407   unititle text,
408   notes text,
409   serial tinyint(1),
410   seriestitle text,
411   copyrightdate smallint(6),
412   timestamp timestamp(14),
413   KEY blbnoidx (biblionumber),
414   PRIMARY KEY (biblionumber)
415 );
416
417 #
418 # Table structure for table 'deletedbiblioitems'
419 #
420 CREATE TABLE deletedbiblioitems (
421   biblioitemnumber int(11) DEFAULT '0' NOT NULL,
422   biblionumber int(11) DEFAULT '0' NOT NULL,
423   volume text,
424   number text,
425   classification varchar(25),
426   itemtype varchar(4),
427   isbn varchar(14),
428   issn varchar(9),
429   dewey double(8,6),
430   subclass char(3),
431   publicationyear smallint(6),
432   publishercode varchar(255),
433   volumedate date,
434   volumeddesc varchar(255),
435   timestamp timestamp(14),
436   illus varchar(255),
437   pages varchar(255),
438   notes text,
439   size varchar(255),
440   KEY bibinoidx (biblioitemnumber),
441   KEY bibnoidx (biblionumber),
442   PRIMARY KEY (biblioitemnumber)
443 );
444
445 #
446 # Table structure for table 'deletedborrowers'
447 #
448 CREATE TABLE deletedborrowers (
449   borrowernumber int(11) DEFAULT '0' NOT NULL,
450   cardnumber varchar(9) DEFAULT '' NOT NULL,
451   surname text NOT NULL,
452   firstname text NOT NULL,
453   title text,
454   othernames text,
455   initials text NOT NULL,
456   streetaddress text NOT NULL,
457   suburb text,
458   city text NOT NULL,
459   phone text NOT NULL,
460   emailaddress text,
461   faxnumber text,
462   altstreetaddress text,
463   altsuburb text,
464   altcity text,
465   altphone text,
466   dateofbirth date,
467   branchcode varchar(4) DEFAULT '' NOT NULL,
468   categorycode char(2),
469   dateenrolled date,
470   gonenoaddress tinyint(1),
471   lost tinyint(1),
472   debarred tinyint(1),
473   studentnumber text,
474   school text,
475   contactname text,
476   borrowernotes text,
477   guarantor int(11),
478   area char(2),
479   ethnicity varchar(50),
480   ethnotes varchar(255),
481   sex char(1),
482   expiry date,
483   altnotes varchar(255),
484   altrelationship varchar(100),
485   streetcity text,
486   phoneday varchar(50),
487   preferredcont varchar(100),
488   physstreet varchar(100),
489   KEY borrowernumber (borrowernumber),
490   KEY cardnumber (cardnumber)
491 );
492
493 #
494 # Table structure for table 'deleteditems'
495 #
496 CREATE TABLE deleteditems (
497   itemnumber int(11) DEFAULT '0' NOT NULL,
498   biblionumber int(11) DEFAULT '0' NOT NULL,
499   multivolumepart varchar(30),
500   biblioitemnumber int(11) DEFAULT '0' NOT NULL,
501   barcode varchar(9) DEFAULT '' NOT NULL,
502   dateaccessioned date,
503   booksellerid varchar(10),
504   homebranch varchar(4),
505   price decimal(28,6),
506   replacementprice decimal(28,6),
507   replacementpricedate date,
508   datelastborrowed date,
509   datelastseen date,
510   multivolume tinyint(1),
511   stack tinyint(1),
512   notforloan tinyint(1),
513   itemlost tinyint(1),
514   wthdrawn tinyint(1),
515   bulk varchar(30),
516   issues smallint(6),
517   renewals smallint(6),
518   reserves smallint(6),
519   restricted tinyint(1),
520   binding decimal(28,6),
521   itemnotes text,
522   holdingbranch varchar(4),
523   interim tinyint(1),
524   timestamp timestamp(14),
525   KEY itembarcodeidx (barcode),
526   KEY itembinoidx (biblioitemnumber),
527   KEY itembibnoidx (biblionumber),
528   PRIMARY KEY (itemnumber),
529   UNIQUE barcode (barcode)
530 );
531
532 #
533 # Table structure for table 'issues'
534 #
535 CREATE TABLE issues (
536   borrowernumber int(11) DEFAULT '0' NOT NULL,
537   itemnumber int(11) DEFAULT '0' NOT NULL,
538   date_due date,
539   branchcode char(4),
540   issuingbranch char(18),
541   returndate date,
542   lastreneweddate date,
543   return char(4),
544   renewals tinyint(4),
545   timestamp timestamp(14),
546   KEY issuesborridx (borrowernumber),
547   KEY issuesitemidx (itemnumber),
548   KEY bordate (borrowernumber,timestamp)
549 );
550
551 #
552 # Table structure for table 'items'
553 #
554 CREATE TABLE items (
555   itemnumber int(11) DEFAULT '0' NOT NULL,
556   biblionumber int(11) DEFAULT '0' NOT NULL,
557   multivolumepart varchar(30),
558   biblioitemnumber int(11) DEFAULT '0' NOT NULL,
559   barcode varchar(9) DEFAULT '' NOT NULL,
560   dateaccessioned date,
561   booksellerid varchar(10),
562   homebranch varchar(4),
563   price decimal(8,2),
564   replacementprice decimal(8,2),
565   replacementpricedate date,
566   datelastborrowed date,
567   datelastseen date,
568   multivolume tinyint(1),
569   stack tinyint(1),
570   notforloan tinyint(1),
571   itemlost tinyint(1),
572   wthdrawn tinyint(1),
573   bulk varchar(30),
574   issues smallint(6),
575   renewals smallint(6),
576   reserves smallint(6),
577   restricted tinyint(1),
578   binding decimal(28,6),
579   itemnotes text,
580   holdingbranch varchar(4),
581   paidfor text,
582   timestamp timestamp(14),
583   KEY itembarcodeidx (barcode),
584   KEY itembinoidx (biblioitemnumber),
585   KEY itembibnoidx (biblionumber),
586   PRIMARY KEY (itemnumber),
587   UNIQUE barcode (barcode)
588 );
589
590 #
591 # Table structure for table 'itemsprices'
592 #
593 CREATE TABLE itemsprices (
594   itemnumber int(11),
595   price1 decimal(28,6),
596   price2 decimal(28,6)
597 );
598
599 #
600 # Table structure for table 'itemtypes'
601 #
602 CREATE TABLE itemtypes (
603   itemtype varchar(4) DEFAULT '' NOT NULL,
604   description text,
605   loanlength smallint(6),
606   renewalsallowed smallint(6),
607   rentalcharge double(16,4),
608   UNIQUE itemtype (itemtype)
609 );
610
611 #
612 # Table structure for table 'multipart'
613 #
614 CREATE TABLE multipart (
615   itemnumber int(11) DEFAULT '0' NOT NULL,
616   other int(11) DEFAULT '0' NOT NULL
617 );
618
619 #
620 # Table structure for table 'multivolume'
621 #
622 CREATE TABLE multivolume (
623   biblionumber int(11) DEFAULT '0' NOT NULL,
624   multivolumepart varchar(30) DEFAULT '' NOT NULL
625 );
626
627 #
628 # Table structure for table 'newitems'
629 #
630 CREATE TABLE newitems (
631   itemnumber int(11) DEFAULT '0' NOT NULL,
632   publishercode varchar(18),
633   biblionumber int(11) DEFAULT '0' NOT NULL,
634   multivolumepart varchar(30),
635   barcode varchar(9) DEFAULT '' NOT NULL,
636   dateaccessioned date,
637   booksellerid varchar(10),
638   homebranch varchar(4),
639   price decimal(28,6),
640   replacementprice decimal(28,6),
641   replacementpricedate date,
642   datelastborrowed date,
643   datelastseen date,
644   multivolume tinyint(1),
645   stack tinyint(1),
646   notforloan tinyint(1),
647   itemlost tinyint(1),
648   wthdrawn tinyint(1),
649   bulk varchar(30),
650   issues smallint(6),
651   renewals smallint(6),
652   reserves smallint(6),
653   restricted tinyint(1),
654   binding decimal(28,6),
655   itemnotes text,
656   holdingbranch varchar(4),
657   interim tinyint(1),
658   volume text,
659   number text,
660   classification varchar(12),
661   itemtype varchar(4),
662   isbn varchar(14),
663   issn varchar(9),
664   dewey double(16,4),
665   subclass char(3),
666   publicationyear smallint(6),
667   KEY itembarcodeidx (barcode),
668   KEY itembibnoidx (biblionumber),
669   PRIMARY KEY (itemnumber)
670 );
671
672 #
673 # Table structure for table 'printers'
674 #
675 CREATE TABLE printers (
676   printername char(40),
677   printqueue char(20),
678   printtype char(20)
679 );
680
681 #
682 # Table structure for table 'procedures'
683 #
684 CREATE TABLE procedures (
685   proccode varchar(4),
686   procdesc text,
687   proclevel smallint(6)
688 );
689
690 #
691 # Table structure for table 'publisher'
692 #
693 CREATE TABLE publisher (
694   publishercode varchar(18) DEFAULT '' NOT NULL,
695   publishername text NOT NULL
696 );
697
698 #
699 # Table structure for table 'reserveconstraints'
700 #
701 CREATE TABLE reserveconstraints (
702   borrowernumber int(11) DEFAULT '0' NOT NULL,
703   reservedate date DEFAULT '0000-00-00' NOT NULL,
704   biblionumber int(11) DEFAULT '0' NOT NULL,
705   biblioitemnumber int(11),
706   timestamp timestamp(14)
707 );
708
709 #
710 # Table structure for table 'reserves'
711 #
712 CREATE TABLE reserves (
713   borrowernumber int(11) DEFAULT '0' NOT NULL,
714   reservedate date DEFAULT '0000-00-00' NOT NULL,
715   biblionumber int(11) DEFAULT '0' NOT NULL,
716   constrainttype char(1),
717   branchcode varchar(4),
718   notificationdate date,
719   reminderdate date,
720   cancellationdate date,
721   reservenotes text,
722   priority smallint(6),
723   found char(1),
724   timestamp timestamp(14),
725   itemnumber int(11)
726 );
727
728 #
729 # Table structure for table 'searchstats'
730 #
731 CREATE TABLE searchstats (
732   time datetime,
733   searchstring text
734 );
735
736 #
737 # Table structure for table 'serialissues'
738 #
739 CREATE TABLE serialissues (
740   biblionumber int(11) DEFAULT '0' NOT NULL,
741   volume varchar(20) DEFAULT '' NOT NULL,
742   number varchar(20) DEFAULT '' NOT NULL,
743   ordernumber smallint(6),
744   issuedate varchar(20),
745   received varchar(18)
746 );
747
748 #
749 # Table structure for table 'statistics'
750 #
751 CREATE TABLE statistics (
752   datetime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
753   branch varchar(4),
754   proccode varchar(4),
755   value double(16,4),
756   type varchar(16),
757   other text,
758   usercode varchar(10),
759   itemnumber int(11),
760   itemtype varchar(4),
761   KEY timeidx (datetime)
762 );
763
764 #
765 # Table structure for table 'stopwords'
766 #
767 CREATE TABLE stopwords (
768   word varchar(255)
769 );
770
771 #
772 # Table structure for table 'systempreferences'
773 #
774 CREATE TABLE systempreferences (
775   variable char(50) DEFAULT '' NOT NULL,
776   value char(200),
777   PRIMARY KEY (variable)
778 );
779
780 #
781 # Table structure for table 'users'
782 #
783 CREATE TABLE users (
784   usercode varchar(10),
785   username text,
786   password text,
787   level smallint(6)
788 );
789