Added the stuff for the text messaging field -- Fixed bug #219
[koha.git] / misc / koha.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   serial tinyint(1),
182   seriestitle text,
183   copyrightdate smallint(6),
184   timestamp timestamp(14),
185   KEY blbnoidx (biblionumber),
186   PRIMARY KEY (biblionumber)
187 );
188
189 #
190 # Table structure for table 'biblioanalysis'
191 #
192 CREATE TABLE biblioanalysis (
193   analyticaltitle text,
194   biblionumber int(11) DEFAULT '0' NOT NULL,
195   analyticalauthor text
196 );
197
198 #
199 # Table structure for table 'biblioitems'
200 #
201 CREATE TABLE biblioitems (
202   biblioitemnumber int(11) DEFAULT '0' NOT NULL,
203   biblionumber int(11) DEFAULT '0' NOT NULL,
204   volume text,
205   number text,
206   classification varchar(25),
207   itemtype varchar(4),
208   isbn varchar(14),
209   issn varchar(9),
210   dewey double(8,6),
211   subclass char(3),
212   publicationyear smallint(6),
213   publishercode varchar(255),
214   volumedate date,
215   volumeddesc varchar(255),
216   timestamp timestamp(14),
217   illus varchar(255),
218   pages varchar(255),
219   notes text,
220   size varchar(255),
221   place varchar(255),
222   KEY bibinoidx (biblioitemnumber),
223   KEY bibnoidx (biblionumber),
224   PRIMARY KEY (biblioitemnumber)
225 );
226
227 #
228 # Table structure for table 'bibliosubject'
229 #
230 CREATE TABLE bibliosubject (
231   subject text NOT NULL,
232   biblionumber int(11) DEFAULT '0' NOT NULL
233 );
234
235 #
236 # Table structure for table 'bibliosubtitle'
237 #
238 CREATE TABLE bibliosubtitle (
239   subtitle text NOT NULL,
240   biblionumber int(11) DEFAULT '0' NOT NULL,
241   KEY bibsubidx (biblionumber)
242 );
243
244 #
245 # Table structure for table 'borexp'
246 #
247 CREATE TABLE borexp (
248   borrowernumber int(11),
249   newexp date
250 );
251
252 #
253 # Table structure for table 'borrowers'
254 #
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,
260   title text,
261   othernames text,
262   initials text NOT NULL,
263   streetaddress text NOT NULL,
264   suburb text,
265   city text NOT NULL,
266   phone text NOT NULL,
267   emailaddress text,
268   faxnumber text,
269   textmessaging text,
270   altstreetaddress text,
271   altsuburb text,
272   altcity text,
273   altphone text,
274   dateofbirth date,
275   branchcode varchar(4) DEFAULT '' NOT NULL,
276   categorycode char(2),
277   dateenrolled date,
278   gonenoaddress tinyint(1),
279   lost tinyint(1),
280   debarred tinyint(1),
281   studentnumber text,
282   school text,
283   contactname text,
284   borrowernotes text,
285   guarantor int(11),
286   area char(2),
287   ethnicity varchar(50),
288   ethnotes varchar(255),
289   sex char(1),
290   expiry date,
291   altnotes varchar(255),
292   altrelationship varchar(100),
293   streetcity text,
294   phoneday varchar(50),
295   preferredcont char(1),
296   physstreet varchar(100),
297   KEY borrowernumber (borrowernumber),
298   KEY cardnumber (cardnumber)
299 );
300
301 #
302 # Table structure for table 'branchcategories'
303 #
304 CREATE TABLE branchcategories (
305   categorycode char(2) DEFAULT '' NOT NULL,
306   branchcode char(4) DEFAULT '' NOT NULL,
307   branchholding int(11)
308 );
309
310 #
311 # Table structure for table 'branches'
312 #
313 CREATE TABLE branches (
314   branchcode varchar(4) DEFAULT '' NOT NULL,
315   branchname text NOT NULL,
316   branchaddress1 text,
317   branchaddress2 text,
318   branchaddress3 text,
319   branchphone text,
320   branchfax text,
321   branchemail text,
322   issuing tinyint(4),
323   UNIQUE branchcode (branchcode)
324 );
325
326 #
327 # Table structure for table 'branchtransfers'
328 #
329 CREATE TABLE branchtransfers (
330   itemnumber int(11) DEFAULT '0' NOT NULL,
331   datesent date DEFAULT '0000-00-00' NOT NULL,
332   frombranch varchar(4),
333   datearrived date,
334   tobranch varchar(4),
335   comments text
336 );
337
338 #
339 # Table structure for table 'catalogueentry'
340 #
341 CREATE TABLE catalogueentry (
342   catalogueentry text NOT NULL,
343   entrytype char(2),
344   see text,
345   seealso text,
346   seeinstead text,
347   biblionumber int(11)
348 );
349
350 #
351 # Table structure for table 'categories'
352 #
353 CREATE TABLE categories (
354   categorycode char(2) DEFAULT '' NOT NULL,
355   description text,
356   enrolmentperiod smallint(6),
357   upperagelimit smallint(6),
358   dateofbirthrequired tinyint(1),
359   finetype varchar(30),
360   bulk tinyint(1),
361   enrolmentfee decimal(28,6),
362   overduenoticerequired tinyint(1),
363   issuelimit smallint(6),
364   reservefee decimal(28,6),
365   UNIQUE categorycode (categorycode)
366 );
367
368 #
369 # Table structure for table 'categoryitem'
370 #
371 CREATE TABLE categoryitem (
372   categorycode char(2) DEFAULT '' NOT NULL,
373   itemtype varchar(4) DEFAULT '' NOT NULL,
374   restrictedtype tinyint(1),
375   rentaldiscount decimal(28,6),
376   reservecharge decimal(28,6),
377   fine decimal(28,6),
378   firstremind int(11),
379   chargeperiod int(11),
380   accountsent int(11),
381   chargename varchar(100)
382 );
383
384 #
385 # Table structure for table 'classification'
386 #
387 CREATE TABLE classification (
388   classification varchar(12) DEFAULT '' NOT NULL
389 );
390
391 #
392 # Table structure for table 'currency'
393 #
394 CREATE TABLE currency (
395   currency varchar(10),
396   rate float(7,5)
397 );
398
399 #
400 # Table structure for table 'deletedbiblio'
401 #
402 CREATE TABLE deletedbiblio (
403   biblionumber int(11) DEFAULT '0' NOT NULL,
404   author text,
405   title text,
406   unititle text,
407   notes text,
408   serial tinyint(1),
409   seriestitle text,
410   copyrightdate smallint(6),
411   timestamp timestamp(14),
412   KEY blbnoidx (biblionumber),
413   PRIMARY KEY (biblionumber)
414 );
415
416 #
417 # Table structure for table 'deletedbiblioitems'
418 #
419 CREATE TABLE deletedbiblioitems (
420   biblioitemnumber int(11) DEFAULT '0' NOT NULL,
421   biblionumber int(11) DEFAULT '0' NOT NULL,
422   volume text,
423   number text,
424   classification varchar(25),
425   itemtype varchar(4),
426   isbn varchar(14),
427   issn varchar(9),
428   dewey double(8,6),
429   subclass char(3),
430   publicationyear smallint(6),
431   publishercode varchar(255),
432   volumedate date,
433   volumeddesc varchar(255),
434   timestamp timestamp(14),
435   illus varchar(255),
436   pages varchar(255),
437   notes text,
438   size varchar(255),
439   KEY bibinoidx (biblioitemnumber),
440   KEY bibnoidx (biblionumber),
441   PRIMARY KEY (biblioitemnumber)
442 );
443
444 #
445 # Table structure for table 'deletedborrowers'
446 #
447 CREATE TABLE deletedborrowers (
448   borrowernumber int(11) DEFAULT '0' NOT NULL,
449   cardnumber varchar(9) DEFAULT '' NOT NULL,
450   surname text NOT NULL,
451   firstname text NOT NULL,
452   title text,
453   othernames text,
454   initials text NOT NULL,
455   streetaddress text NOT NULL,
456   suburb text,
457   city text NOT NULL,
458   phone text NOT NULL,
459   emailaddress text,
460   faxnumber text,
461   altstreetaddress text,
462   altsuburb text,
463   altcity text,
464   altphone text,
465   dateofbirth date,
466   branchcode varchar(4) DEFAULT '' NOT NULL,
467   categorycode char(2),
468   dateenrolled date,
469   gonenoaddress tinyint(1),
470   lost tinyint(1),
471   debarred tinyint(1),
472   studentnumber text,
473   school text,
474   contactname text,
475   borrowernotes text,
476   guarantor int(11),
477   area char(2),
478   ethnicity varchar(50),
479   ethnotes varchar(255),
480   sex char(1),
481   expiry date,
482   altnotes varchar(255),
483   altrelationship varchar(100),
484   streetcity text,
485   phoneday varchar(50),
486   preferredcont varchar(100),
487   physstreet varchar(100),
488   KEY borrowernumber (borrowernumber),
489   KEY cardnumber (cardnumber)
490 );
491
492 #
493 # Table structure for table 'deleteditems'
494 #
495 CREATE TABLE deleteditems (
496   itemnumber int(11) DEFAULT '0' NOT NULL,
497   biblionumber int(11) DEFAULT '0' NOT NULL,
498   multivolumepart varchar(30),
499   biblioitemnumber int(11) DEFAULT '0' NOT NULL,
500   barcode varchar(9) DEFAULT '' NOT NULL,
501   dateaccessioned date,
502   booksellerid varchar(10),
503   homebranch varchar(4),
504   price decimal(28,6),
505   replacementprice decimal(28,6),
506   replacementpricedate date,
507   datelastborrowed date,
508   datelastseen date,
509   multivolume tinyint(1),
510   stack tinyint(1),
511   notforloan tinyint(1),
512   itemlost tinyint(1),
513   wthdrawn tinyint(1),
514   bulk varchar(30),
515   issues smallint(6),
516   renewals smallint(6),
517   reserves smallint(6),
518   restricted tinyint(1),
519   binding decimal(28,6),
520   itemnotes text,
521   holdingbranch varchar(4),
522   interim tinyint(1),
523   timestamp timestamp(14),
524   KEY itembarcodeidx (barcode),
525   KEY itembinoidx (biblioitemnumber),
526   KEY itembibnoidx (biblionumber),
527   PRIMARY KEY (itemnumber),
528   UNIQUE barcode (barcode)
529 );
530
531 #
532 # Table structure for table 'issues'
533 #
534 CREATE TABLE issues (
535   borrowernumber int(11) DEFAULT '0' NOT NULL,
536   itemnumber int(11) DEFAULT '0' NOT NULL,
537   date_due date,
538   branchcode char(4),
539   issuingbranch char(18),
540   returndate date,
541   lastreneweddate date,
542   return char(4),
543   renewals tinyint(4),
544   timestamp timestamp(14),
545   KEY issuesborridx (borrowernumber),
546   KEY issuesitemidx (itemnumber),
547   KEY bordate (borrowernumber,timestamp)
548 );
549
550 #
551 # Table structure for table 'items'
552 #
553 CREATE TABLE items (
554   itemnumber int(11) DEFAULT '0' NOT NULL,
555   biblionumber int(11) DEFAULT '0' NOT NULL,
556   multivolumepart varchar(30),
557   biblioitemnumber int(11) DEFAULT '0' NOT NULL,
558   barcode varchar(9) DEFAULT '' NOT NULL,
559   dateaccessioned date,
560   booksellerid varchar(10),
561   homebranch varchar(4),
562   price decimal(8,2),
563   replacementprice decimal(8,2),
564   replacementpricedate date,
565   datelastborrowed date,
566   datelastseen date,
567   multivolume tinyint(1),
568   stack tinyint(1),
569   notforloan tinyint(1),
570   itemlost tinyint(1),
571   wthdrawn tinyint(1),
572   bulk varchar(30),
573   issues smallint(6),
574   renewals smallint(6),
575   reserves smallint(6),
576   restricted tinyint(1),
577   binding decimal(28,6),
578   itemnotes text,
579   holdingbranch varchar(4),
580   paidfor text,
581   timestamp timestamp(14),
582   KEY itembarcodeidx (barcode),
583   KEY itembinoidx (biblioitemnumber),
584   KEY itembibnoidx (biblionumber),
585   PRIMARY KEY (itemnumber),
586   UNIQUE barcode (barcode)
587 );
588
589 #
590 # Table structure for table 'itemsprices'
591 #
592 CREATE TABLE itemsprices (
593   itemnumber int(11),
594   price1 decimal(28,6),
595   price2 decimal(28,6)
596 );
597
598 #
599 # Table structure for table 'itemtypes'
600 #
601 CREATE TABLE itemtypes (
602   itemtype varchar(4) DEFAULT '' NOT NULL,
603   description text,
604   loanlength smallint(6),
605   renewalsallowed smallint(6),
606   rentalcharge double(16,4),
607   UNIQUE itemtype (itemtype)
608 );
609
610 #
611 # Table structure for table 'multipart'
612 #
613 CREATE TABLE multipart (
614   itemnumber int(11) DEFAULT '0' NOT NULL,
615   other int(11) DEFAULT '0' NOT NULL
616 );
617
618 #
619 # Table structure for table 'multivolume'
620 #
621 CREATE TABLE multivolume (
622   biblionumber int(11) DEFAULT '0' NOT NULL,
623   multivolumepart varchar(30) DEFAULT '' NOT NULL
624 );
625
626 #
627 # Table structure for table 'newitems'
628 #
629 CREATE TABLE newitems (
630   itemnumber int(11) DEFAULT '0' NOT NULL,
631   publishercode varchar(18),
632   biblionumber int(11) DEFAULT '0' NOT NULL,
633   multivolumepart varchar(30),
634   barcode varchar(9) DEFAULT '' NOT NULL,
635   dateaccessioned date,
636   booksellerid varchar(10),
637   homebranch varchar(4),
638   price decimal(28,6),
639   replacementprice decimal(28,6),
640   replacementpricedate date,
641   datelastborrowed date,
642   datelastseen date,
643   multivolume tinyint(1),
644   stack tinyint(1),
645   notforloan tinyint(1),
646   itemlost tinyint(1),
647   wthdrawn tinyint(1),
648   bulk varchar(30),
649   issues smallint(6),
650   renewals smallint(6),
651   reserves smallint(6),
652   restricted tinyint(1),
653   binding decimal(28,6),
654   itemnotes text,
655   holdingbranch varchar(4),
656   interim tinyint(1),
657   volume text,
658   number text,
659   classification varchar(12),
660   itemtype varchar(4),
661   isbn varchar(14),
662   issn varchar(9),
663   dewey double(16,4),
664   subclass char(3),
665   publicationyear smallint(6),
666   KEY itembarcodeidx (barcode),
667   KEY itembibnoidx (biblionumber),
668   PRIMARY KEY (itemnumber)
669 );
670
671 #
672 # Table structure for table 'printers'
673 #
674 CREATE TABLE printers (
675   printername char(40),
676   printqueue char(20),
677   printtype char(20)
678 );
679
680 #
681 # Table structure for table 'procedures'
682 #
683 CREATE TABLE procedures (
684   proccode varchar(4),
685   procdesc text,
686   proclevel smallint(6)
687 );
688
689 #
690 # Table structure for table 'publisher'
691 #
692 CREATE TABLE publisher (
693   publishercode varchar(18) DEFAULT '' NOT NULL,
694   publishername text NOT NULL
695 );
696
697 #
698 # Table structure for table 'reserveconstraints'
699 #
700 CREATE TABLE reserveconstraints (
701   borrowernumber int(11) DEFAULT '0' NOT NULL,
702   reservedate date DEFAULT '0000-00-00' NOT NULL,
703   biblionumber int(11) DEFAULT '0' NOT NULL,
704   biblioitemnumber int(11),
705   timestamp timestamp(14)
706 );
707
708 #
709 # Table structure for table 'reserves'
710 #
711 CREATE TABLE reserves (
712   borrowernumber int(11) DEFAULT '0' NOT NULL,
713   reservedate date DEFAULT '0000-00-00' NOT NULL,
714   biblionumber int(11) DEFAULT '0' NOT NULL,
715   constrainttype char(1),
716   branchcode varchar(4),
717   notificationdate date,
718   reminderdate date,
719   cancellationdate date,
720   reservenotes text,
721   priority smallint(6),
722   found char(1),
723   timestamp timestamp(14),
724   itemnumber int(11)
725 );
726
727 #
728 # Table structure for table 'searchstats'
729 #
730 CREATE TABLE searchstats (
731   time datetime,
732   searchstring text
733 );
734
735 #
736 # Table structure for table 'serialissues'
737 #
738 CREATE TABLE serialissues (
739   biblionumber int(11) DEFAULT '0' NOT NULL,
740   volume varchar(20) DEFAULT '' NOT NULL,
741   number varchar(20) DEFAULT '' NOT NULL,
742   ordernumber smallint(6),
743   issuedate varchar(20),
744   received varchar(18)
745 );
746
747 #
748 # Table structure for table 'statistics'
749 #
750 CREATE TABLE statistics (
751   datetime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
752   branch varchar(4),
753   proccode varchar(4),
754   value double(16,4),
755   type varchar(16),
756   other text,
757   usercode varchar(10),
758   itemnumber int(11),
759   itemtype varchar(4),
760   borrowernumber int(11) default NULL,
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