Bug 12461 - Add patron clubs feature
[koha.git] / Koha / Schema / Result / Borrower.pm
1 use utf8;
2 package Koha::Schema::Result::Borrower;
3
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
6
7 =head1 NAME
8
9 Koha::Schema::Result::Borrower
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<borrowers>
19
20 =cut
21
22 __PACKAGE__->table("borrowers");
23
24 =head1 ACCESSORS
25
26 =head2 borrowernumber
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 =head2 cardnumber
33
34   data_type: 'varchar'
35   is_nullable: 1
36   size: 16
37
38 =head2 surname
39
40   data_type: 'mediumtext'
41   is_nullable: 0
42
43 =head2 firstname
44
45   data_type: 'text'
46   is_nullable: 1
47
48 =head2 title
49
50   data_type: 'mediumtext'
51   is_nullable: 1
52
53 =head2 othernames
54
55   data_type: 'mediumtext'
56   is_nullable: 1
57
58 =head2 initials
59
60   data_type: 'text'
61   is_nullable: 1
62
63 =head2 streetnumber
64
65   data_type: 'varchar'
66   is_nullable: 1
67   size: 10
68
69 =head2 streettype
70
71   data_type: 'varchar'
72   is_nullable: 1
73   size: 50
74
75 =head2 address
76
77   data_type: 'mediumtext'
78   is_nullable: 0
79
80 =head2 address2
81
82   data_type: 'text'
83   is_nullable: 1
84
85 =head2 city
86
87   data_type: 'mediumtext'
88   is_nullable: 0
89
90 =head2 state
91
92   data_type: 'text'
93   is_nullable: 1
94
95 =head2 zipcode
96
97   data_type: 'varchar'
98   is_nullable: 1
99   size: 25
100
101 =head2 country
102
103   data_type: 'text'
104   is_nullable: 1
105
106 =head2 email
107
108   data_type: 'mediumtext'
109   is_nullable: 1
110
111 =head2 phone
112
113   data_type: 'text'
114   is_nullable: 1
115
116 =head2 mobile
117
118   data_type: 'varchar'
119   is_nullable: 1
120   size: 50
121
122 =head2 fax
123
124   data_type: 'mediumtext'
125   is_nullable: 1
126
127 =head2 emailpro
128
129   data_type: 'text'
130   is_nullable: 1
131
132 =head2 phonepro
133
134   data_type: 'text'
135   is_nullable: 1
136
137 =head2 B_streetnumber
138
139   accessor: 'b_streetnumber'
140   data_type: 'varchar'
141   is_nullable: 1
142   size: 10
143
144 =head2 B_streettype
145
146   accessor: 'b_streettype'
147   data_type: 'varchar'
148   is_nullable: 1
149   size: 50
150
151 =head2 B_address
152
153   accessor: 'b_address'
154   data_type: 'varchar'
155   is_nullable: 1
156   size: 100
157
158 =head2 B_address2
159
160   accessor: 'b_address2'
161   data_type: 'text'
162   is_nullable: 1
163
164 =head2 B_city
165
166   accessor: 'b_city'
167   data_type: 'mediumtext'
168   is_nullable: 1
169
170 =head2 B_state
171
172   accessor: 'b_state'
173   data_type: 'text'
174   is_nullable: 1
175
176 =head2 B_zipcode
177
178   accessor: 'b_zipcode'
179   data_type: 'varchar'
180   is_nullable: 1
181   size: 25
182
183 =head2 B_country
184
185   accessor: 'b_country'
186   data_type: 'text'
187   is_nullable: 1
188
189 =head2 B_email
190
191   accessor: 'b_email'
192   data_type: 'text'
193   is_nullable: 1
194
195 =head2 B_phone
196
197   accessor: 'b_phone'
198   data_type: 'mediumtext'
199   is_nullable: 1
200
201 =head2 dateofbirth
202
203   data_type: 'date'
204   datetime_undef_if_invalid: 1
205   is_nullable: 1
206
207 =head2 branchcode
208
209   data_type: 'varchar'
210   default_value: (empty string)
211   is_foreign_key: 1
212   is_nullable: 0
213   size: 10
214
215 =head2 categorycode
216
217   data_type: 'varchar'
218   default_value: (empty string)
219   is_foreign_key: 1
220   is_nullable: 0
221   size: 10
222
223 =head2 dateenrolled
224
225   data_type: 'date'
226   datetime_undef_if_invalid: 1
227   is_nullable: 1
228
229 =head2 dateexpiry
230
231   data_type: 'date'
232   datetime_undef_if_invalid: 1
233   is_nullable: 1
234
235 =head2 gonenoaddress
236
237   data_type: 'tinyint'
238   is_nullable: 1
239
240 =head2 lost
241
242   data_type: 'tinyint'
243   is_nullable: 1
244
245 =head2 debarred
246
247   data_type: 'date'
248   datetime_undef_if_invalid: 1
249   is_nullable: 1
250
251 =head2 debarredcomment
252
253   data_type: 'varchar'
254   is_nullable: 1
255   size: 255
256
257 =head2 contactname
258
259   data_type: 'mediumtext'
260   is_nullable: 1
261
262 =head2 contactfirstname
263
264   data_type: 'text'
265   is_nullable: 1
266
267 =head2 contacttitle
268
269   data_type: 'text'
270   is_nullable: 1
271
272 =head2 guarantorid
273
274   data_type: 'integer'
275   is_nullable: 1
276
277 =head2 borrowernotes
278
279   data_type: 'mediumtext'
280   is_nullable: 1
281
282 =head2 relationship
283
284   data_type: 'varchar'
285   is_nullable: 1
286   size: 100
287
288 =head2 sex
289
290   data_type: 'varchar'
291   is_nullable: 1
292   size: 1
293
294 =head2 password
295
296   data_type: 'varchar'
297   is_nullable: 1
298   size: 60
299
300 =head2 flags
301
302   data_type: 'integer'
303   is_nullable: 1
304
305 =head2 userid
306
307   data_type: 'varchar'
308   is_nullable: 1
309   size: 75
310
311 =head2 opacnote
312
313   data_type: 'mediumtext'
314   is_nullable: 1
315
316 =head2 contactnote
317
318   data_type: 'varchar'
319   is_nullable: 1
320   size: 255
321
322 =head2 sort1
323
324   data_type: 'varchar'
325   is_nullable: 1
326   size: 80
327
328 =head2 sort2
329
330   data_type: 'varchar'
331   is_nullable: 1
332   size: 80
333
334 =head2 altcontactfirstname
335
336   data_type: 'varchar'
337   is_nullable: 1
338   size: 255
339
340 =head2 altcontactsurname
341
342   data_type: 'varchar'
343   is_nullable: 1
344   size: 255
345
346 =head2 altcontactaddress1
347
348   data_type: 'varchar'
349   is_nullable: 1
350   size: 255
351
352 =head2 altcontactaddress2
353
354   data_type: 'varchar'
355   is_nullable: 1
356   size: 255
357
358 =head2 altcontactaddress3
359
360   data_type: 'varchar'
361   is_nullable: 1
362   size: 255
363
364 =head2 altcontactstate
365
366   data_type: 'text'
367   is_nullable: 1
368
369 =head2 altcontactzipcode
370
371   data_type: 'varchar'
372   is_nullable: 1
373   size: 50
374
375 =head2 altcontactcountry
376
377   data_type: 'text'
378   is_nullable: 1
379
380 =head2 altcontactphone
381
382   data_type: 'varchar'
383   is_nullable: 1
384   size: 50
385
386 =head2 smsalertnumber
387
388   data_type: 'varchar'
389   is_nullable: 1
390   size: 50
391
392 =head2 sms_provider_id
393
394   data_type: 'integer'
395   is_foreign_key: 1
396   is_nullable: 1
397
398 =head2 privacy
399
400   data_type: 'integer'
401   default_value: 1
402   is_nullable: 0
403
404 =head2 privacy_guarantor_checkouts
405
406   data_type: 'tinyint'
407   default_value: 0
408   is_nullable: 0
409
410 =head2 checkprevcheckout
411
412   data_type: 'varchar'
413   default_value: 'inherit'
414   is_nullable: 0
415   size: 7
416
417 =head2 updated_on
418
419   data_type: 'timestamp'
420   datetime_undef_if_invalid: 1
421   default_value: current_timestamp
422   is_nullable: 0
423
424 =head2 lastseen
425
426   data_type: 'datetime'
427   datetime_undef_if_invalid: 1
428   is_nullable: 1
429
430 =head2 overdrive_auth_token
431
432   data_type: 'text'
433   is_nullable: 1
434
435 =cut
436
437 __PACKAGE__->add_columns(
438   "borrowernumber",
439   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
440   "cardnumber",
441   { data_type => "varchar", is_nullable => 1, size => 16 },
442   "surname",
443   { data_type => "mediumtext", is_nullable => 0 },
444   "firstname",
445   { data_type => "text", is_nullable => 1 },
446   "title",
447   { data_type => "mediumtext", is_nullable => 1 },
448   "othernames",
449   { data_type => "mediumtext", is_nullable => 1 },
450   "initials",
451   { data_type => "text", is_nullable => 1 },
452   "streetnumber",
453   { data_type => "varchar", is_nullable => 1, size => 10 },
454   "streettype",
455   { data_type => "varchar", is_nullable => 1, size => 50 },
456   "address",
457   { data_type => "mediumtext", is_nullable => 0 },
458   "address2",
459   { data_type => "text", is_nullable => 1 },
460   "city",
461   { data_type => "mediumtext", is_nullable => 0 },
462   "state",
463   { data_type => "text", is_nullable => 1 },
464   "zipcode",
465   { data_type => "varchar", is_nullable => 1, size => 25 },
466   "country",
467   { data_type => "text", is_nullable => 1 },
468   "email",
469   { data_type => "mediumtext", is_nullable => 1 },
470   "phone",
471   { data_type => "text", is_nullable => 1 },
472   "mobile",
473   { data_type => "varchar", is_nullable => 1, size => 50 },
474   "fax",
475   { data_type => "mediumtext", is_nullable => 1 },
476   "emailpro",
477   { data_type => "text", is_nullable => 1 },
478   "phonepro",
479   { data_type => "text", is_nullable => 1 },
480   "B_streetnumber",
481   {
482     accessor => "b_streetnumber",
483     data_type => "varchar",
484     is_nullable => 1,
485     size => 10,
486   },
487   "B_streettype",
488   {
489     accessor => "b_streettype",
490     data_type => "varchar",
491     is_nullable => 1,
492     size => 50,
493   },
494   "B_address",
495   {
496     accessor => "b_address",
497     data_type => "varchar",
498     is_nullable => 1,
499     size => 100,
500   },
501   "B_address2",
502   { accessor => "b_address2", data_type => "text", is_nullable => 1 },
503   "B_city",
504   { accessor => "b_city", data_type => "mediumtext", is_nullable => 1 },
505   "B_state",
506   { accessor => "b_state", data_type => "text", is_nullable => 1 },
507   "B_zipcode",
508   {
509     accessor => "b_zipcode",
510     data_type => "varchar",
511     is_nullable => 1,
512     size => 25,
513   },
514   "B_country",
515   { accessor => "b_country", data_type => "text", is_nullable => 1 },
516   "B_email",
517   { accessor => "b_email", data_type => "text", is_nullable => 1 },
518   "B_phone",
519   { accessor => "b_phone", data_type => "mediumtext", is_nullable => 1 },
520   "dateofbirth",
521   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
522   "branchcode",
523   {
524     data_type => "varchar",
525     default_value => "",
526     is_foreign_key => 1,
527     is_nullable => 0,
528     size => 10,
529   },
530   "categorycode",
531   {
532     data_type => "varchar",
533     default_value => "",
534     is_foreign_key => 1,
535     is_nullable => 0,
536     size => 10,
537   },
538   "dateenrolled",
539   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
540   "dateexpiry",
541   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
542   "gonenoaddress",
543   { data_type => "tinyint", is_nullable => 1 },
544   "lost",
545   { data_type => "tinyint", is_nullable => 1 },
546   "debarred",
547   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
548   "debarredcomment",
549   { data_type => "varchar", is_nullable => 1, size => 255 },
550   "contactname",
551   { data_type => "mediumtext", is_nullable => 1 },
552   "contactfirstname",
553   { data_type => "text", is_nullable => 1 },
554   "contacttitle",
555   { data_type => "text", is_nullable => 1 },
556   "guarantorid",
557   { data_type => "integer", is_nullable => 1 },
558   "borrowernotes",
559   { data_type => "mediumtext", is_nullable => 1 },
560   "relationship",
561   { data_type => "varchar", is_nullable => 1, size => 100 },
562   "sex",
563   { data_type => "varchar", is_nullable => 1, size => 1 },
564   "password",
565   { data_type => "varchar", is_nullable => 1, size => 60 },
566   "flags",
567   { data_type => "integer", is_nullable => 1 },
568   "userid",
569   { data_type => "varchar", is_nullable => 1, size => 75 },
570   "opacnote",
571   { data_type => "mediumtext", is_nullable => 1 },
572   "contactnote",
573   { data_type => "varchar", is_nullable => 1, size => 255 },
574   "sort1",
575   { data_type => "varchar", is_nullable => 1, size => 80 },
576   "sort2",
577   { data_type => "varchar", is_nullable => 1, size => 80 },
578   "altcontactfirstname",
579   { data_type => "varchar", is_nullable => 1, size => 255 },
580   "altcontactsurname",
581   { data_type => "varchar", is_nullable => 1, size => 255 },
582   "altcontactaddress1",
583   { data_type => "varchar", is_nullable => 1, size => 255 },
584   "altcontactaddress2",
585   { data_type => "varchar", is_nullable => 1, size => 255 },
586   "altcontactaddress3",
587   { data_type => "varchar", is_nullable => 1, size => 255 },
588   "altcontactstate",
589   { data_type => "text", is_nullable => 1 },
590   "altcontactzipcode",
591   { data_type => "varchar", is_nullable => 1, size => 50 },
592   "altcontactcountry",
593   { data_type => "text", is_nullable => 1 },
594   "altcontactphone",
595   { data_type => "varchar", is_nullable => 1, size => 50 },
596   "smsalertnumber",
597   { data_type => "varchar", is_nullable => 1, size => 50 },
598   "sms_provider_id",
599   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
600   "privacy",
601   { data_type => "integer", default_value => 1, is_nullable => 0 },
602   "privacy_guarantor_checkouts",
603   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
604   "checkprevcheckout",
605   {
606     data_type => "varchar",
607     default_value => "inherit",
608     is_nullable => 0,
609     size => 7,
610   },
611   "updated_on",
612   {
613     data_type => "timestamp",
614     datetime_undef_if_invalid => 1,
615     default_value => \"current_timestamp",
616     is_nullable => 0,
617   },
618   "lastseen",
619   {
620     data_type => "datetime",
621     datetime_undef_if_invalid => 1,
622     is_nullable => 1,
623   },
624   "overdrive_auth_token",
625   { data_type => "text", is_nullable => 1 },
626 );
627
628 =head1 PRIMARY KEY
629
630 =over 4
631
632 =item * L</borrowernumber>
633
634 =back
635
636 =cut
637
638 __PACKAGE__->set_primary_key("borrowernumber");
639
640 =head1 UNIQUE CONSTRAINTS
641
642 =head2 C<cardnumber>
643
644 =over 4
645
646 =item * L</cardnumber>
647
648 =back
649
650 =cut
651
652 __PACKAGE__->add_unique_constraint("cardnumber", ["cardnumber"]);
653
654 =head2 C<userid>
655
656 =over 4
657
658 =item * L</userid>
659
660 =back
661
662 =cut
663
664 __PACKAGE__->add_unique_constraint("userid", ["userid"]);
665
666 =head1 RELATIONS
667
668 =head2 accountlines
669
670 Type: has_many
671
672 Related object: L<Koha::Schema::Result::Accountline>
673
674 =cut
675
676 __PACKAGE__->has_many(
677   "accountlines",
678   "Koha::Schema::Result::Accountline",
679   { "foreign.borrowernumber" => "self.borrowernumber" },
680   { cascade_copy => 0, cascade_delete => 0 },
681 );
682
683 =head2 accountoffsets
684
685 Type: has_many
686
687 Related object: L<Koha::Schema::Result::Accountoffset>
688
689 =cut
690
691 __PACKAGE__->has_many(
692   "accountoffsets",
693   "Koha::Schema::Result::Accountoffset",
694   { "foreign.borrowernumber" => "self.borrowernumber" },
695   { cascade_copy => 0, cascade_delete => 0 },
696 );
697
698 =head2 aqbasketusers
699
700 Type: has_many
701
702 Related object: L<Koha::Schema::Result::Aqbasketuser>
703
704 =cut
705
706 __PACKAGE__->has_many(
707   "aqbasketusers",
708   "Koha::Schema::Result::Aqbasketuser",
709   { "foreign.borrowernumber" => "self.borrowernumber" },
710   { cascade_copy => 0, cascade_delete => 0 },
711 );
712
713 =head2 aqbudgetborrowers
714
715 Type: has_many
716
717 Related object: L<Koha::Schema::Result::Aqbudgetborrower>
718
719 =cut
720
721 __PACKAGE__->has_many(
722   "aqbudgetborrowers",
723   "Koha::Schema::Result::Aqbudgetborrower",
724   { "foreign.borrowernumber" => "self.borrowernumber" },
725   { cascade_copy => 0, cascade_delete => 0 },
726 );
727
728 =head2 aqorder_users
729
730 Type: has_many
731
732 Related object: L<Koha::Schema::Result::AqorderUser>
733
734 =cut
735
736 __PACKAGE__->has_many(
737   "aqorder_users",
738   "Koha::Schema::Result::AqorderUser",
739   { "foreign.borrowernumber" => "self.borrowernumber" },
740   { cascade_copy => 0, cascade_delete => 0 },
741 );
742
743 =head2 article_requests
744
745 Type: has_many
746
747 Related object: L<Koha::Schema::Result::ArticleRequest>
748
749 =cut
750
751 __PACKAGE__->has_many(
752   "article_requests",
753   "Koha::Schema::Result::ArticleRequest",
754   { "foreign.borrowernumber" => "self.borrowernumber" },
755   { cascade_copy => 0, cascade_delete => 0 },
756 );
757
758 =head2 borrower_attributes
759
760 Type: has_many
761
762 Related object: L<Koha::Schema::Result::BorrowerAttribute>
763
764 =cut
765
766 __PACKAGE__->has_many(
767   "borrower_attributes",
768   "Koha::Schema::Result::BorrowerAttribute",
769   { "foreign.borrowernumber" => "self.borrowernumber" },
770   { cascade_copy => 0, cascade_delete => 0 },
771 );
772
773 =head2 borrower_debarments
774
775 Type: has_many
776
777 Related object: L<Koha::Schema::Result::BorrowerDebarment>
778
779 =cut
780
781 __PACKAGE__->has_many(
782   "borrower_debarments",
783   "Koha::Schema::Result::BorrowerDebarment",
784   { "foreign.borrowernumber" => "self.borrowernumber" },
785   { cascade_copy => 0, cascade_delete => 0 },
786 );
787
788 =head2 borrower_files
789
790 Type: has_many
791
792 Related object: L<Koha::Schema::Result::BorrowerFile>
793
794 =cut
795
796 __PACKAGE__->has_many(
797   "borrower_files",
798   "Koha::Schema::Result::BorrowerFile",
799   { "foreign.borrowernumber" => "self.borrowernumber" },
800   { cascade_copy => 0, cascade_delete => 0 },
801 );
802
803 =head2 borrower_message_preferences
804
805 Type: has_many
806
807 Related object: L<Koha::Schema::Result::BorrowerMessagePreference>
808
809 =cut
810
811 __PACKAGE__->has_many(
812   "borrower_message_preferences",
813   "Koha::Schema::Result::BorrowerMessagePreference",
814   { "foreign.borrowernumber" => "self.borrowernumber" },
815   { cascade_copy => 0, cascade_delete => 0 },
816 );
817
818 =head2 borrower_syncs
819
820 Type: has_many
821
822 Related object: L<Koha::Schema::Result::BorrowerSync>
823
824 =cut
825
826 __PACKAGE__->has_many(
827   "borrower_syncs",
828   "Koha::Schema::Result::BorrowerSync",
829   { "foreign.borrowernumber" => "self.borrowernumber" },
830   { cascade_copy => 0, cascade_delete => 0 },
831 );
832
833 =head2 branchcode
834
835 Type: belongs_to
836
837 Related object: L<Koha::Schema::Result::Branch>
838
839 =cut
840
841 __PACKAGE__->belongs_to(
842   "branchcode",
843   "Koha::Schema::Result::Branch",
844   { branchcode => "branchcode" },
845   { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" },
846 );
847
848 =head2 categorycode
849
850 Type: belongs_to
851
852 Related object: L<Koha::Schema::Result::Category>
853
854 =cut
855
856 __PACKAGE__->belongs_to(
857   "categorycode",
858   "Koha::Schema::Result::Category",
859   { categorycode => "categorycode" },
860   { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" },
861 );
862
863 =head2 club_enrollments
864
865 Type: has_many
866
867 Related object: L<Koha::Schema::Result::ClubEnrollment>
868
869 =cut
870
871 __PACKAGE__->has_many(
872   "club_enrollments",
873   "Koha::Schema::Result::ClubEnrollment",
874   { "foreign.borrowernumber" => "self.borrowernumber" },
875   { cascade_copy => 0, cascade_delete => 0 },
876 );
877
878 =head2 course_instructors
879
880 Type: has_many
881
882 Related object: L<Koha::Schema::Result::CourseInstructor>
883
884 =cut
885
886 __PACKAGE__->has_many(
887   "course_instructors",
888   "Koha::Schema::Result::CourseInstructor",
889   { "foreign.borrowernumber" => "self.borrowernumber" },
890   { cascade_copy => 0, cascade_delete => 0 },
891 );
892
893 =head2 creator_batches
894
895 Type: has_many
896
897 Related object: L<Koha::Schema::Result::CreatorBatch>
898
899 =cut
900
901 __PACKAGE__->has_many(
902   "creator_batches",
903   "Koha::Schema::Result::CreatorBatch",
904   { "foreign.borrower_number" => "self.borrowernumber" },
905   { cascade_copy => 0, cascade_delete => 0 },
906 );
907
908 =head2 discharges
909
910 Type: has_many
911
912 Related object: L<Koha::Schema::Result::Discharge>
913
914 =cut
915
916 __PACKAGE__->has_many(
917   "discharges",
918   "Koha::Schema::Result::Discharge",
919   { "foreign.borrower" => "self.borrowernumber" },
920   { cascade_copy => 0, cascade_delete => 0 },
921 );
922
923 =head2 hold_fill_targets
924
925 Type: has_many
926
927 Related object: L<Koha::Schema::Result::HoldFillTarget>
928
929 =cut
930
931 __PACKAGE__->has_many(
932   "hold_fill_targets",
933   "Koha::Schema::Result::HoldFillTarget",
934   { "foreign.borrowernumber" => "self.borrowernumber" },
935   { cascade_copy => 0, cascade_delete => 0 },
936 );
937
938 =head2 housebound_profile
939
940 Type: might_have
941
942 Related object: L<Koha::Schema::Result::HouseboundProfile>
943
944 =cut
945
946 __PACKAGE__->might_have(
947   "housebound_profile",
948   "Koha::Schema::Result::HouseboundProfile",
949   { "foreign.borrowernumber" => "self.borrowernumber" },
950   { cascade_copy => 0, cascade_delete => 0 },
951 );
952
953 =head2 housebound_role
954
955 Type: might_have
956
957 Related object: L<Koha::Schema::Result::HouseboundRole>
958
959 =cut
960
961 __PACKAGE__->might_have(
962   "housebound_role",
963   "Koha::Schema::Result::HouseboundRole",
964   { "foreign.borrowernumber_id" => "self.borrowernumber" },
965   { cascade_copy => 0, cascade_delete => 0 },
966 );
967
968 =head2 housebound_visit_chooser_brwnumbers
969
970 Type: has_many
971
972 Related object: L<Koha::Schema::Result::HouseboundVisit>
973
974 =cut
975
976 __PACKAGE__->has_many(
977   "housebound_visit_chooser_brwnumbers",
978   "Koha::Schema::Result::HouseboundVisit",
979   { "foreign.chooser_brwnumber" => "self.borrowernumber" },
980   { cascade_copy => 0, cascade_delete => 0 },
981 );
982
983 =head2 housebound_visit_deliverer_brwnumbers
984
985 Type: has_many
986
987 Related object: L<Koha::Schema::Result::HouseboundVisit>
988
989 =cut
990
991 __PACKAGE__->has_many(
992   "housebound_visit_deliverer_brwnumbers",
993   "Koha::Schema::Result::HouseboundVisit",
994   { "foreign.deliverer_brwnumber" => "self.borrowernumber" },
995   { cascade_copy => 0, cascade_delete => 0 },
996 );
997
998 =head2 issues
999
1000 Type: has_many
1001
1002 Related object: L<Koha::Schema::Result::Issue>
1003
1004 =cut
1005
1006 __PACKAGE__->has_many(
1007   "issues",
1008   "Koha::Schema::Result::Issue",
1009   { "foreign.borrowernumber" => "self.borrowernumber" },
1010   { cascade_copy => 0, cascade_delete => 0 },
1011 );
1012
1013 =head2 items_last_borrowers
1014
1015 Type: has_many
1016
1017 Related object: L<Koha::Schema::Result::ItemsLastBorrower>
1018
1019 =cut
1020
1021 __PACKAGE__->has_many(
1022   "items_last_borrowers",
1023   "Koha::Schema::Result::ItemsLastBorrower",
1024   { "foreign.borrowernumber" => "self.borrowernumber" },
1025   { cascade_copy => 0, cascade_delete => 0 },
1026 );
1027
1028 =head2 message_queues
1029
1030 Type: has_many
1031
1032 Related object: L<Koha::Schema::Result::MessageQueue>
1033
1034 =cut
1035
1036 __PACKAGE__->has_many(
1037   "message_queues",
1038   "Koha::Schema::Result::MessageQueue",
1039   { "foreign.borrowernumber" => "self.borrowernumber" },
1040   { cascade_copy => 0, cascade_delete => 0 },
1041 );
1042
1043 =head2 messages
1044
1045 Type: has_many
1046
1047 Related object: L<Koha::Schema::Result::Message>
1048
1049 =cut
1050
1051 __PACKAGE__->has_many(
1052   "messages",
1053   "Koha::Schema::Result::Message",
1054   { "foreign.manager_id" => "self.borrowernumber" },
1055   { cascade_copy => 0, cascade_delete => 0 },
1056 );
1057
1058 =head2 old_issues
1059
1060 Type: has_many
1061
1062 Related object: L<Koha::Schema::Result::OldIssue>
1063
1064 =cut
1065
1066 __PACKAGE__->has_many(
1067   "old_issues",
1068   "Koha::Schema::Result::OldIssue",
1069   { "foreign.borrowernumber" => "self.borrowernumber" },
1070   { cascade_copy => 0, cascade_delete => 0 },
1071 );
1072
1073 =head2 old_reserves
1074
1075 Type: has_many
1076
1077 Related object: L<Koha::Schema::Result::OldReserve>
1078
1079 =cut
1080
1081 __PACKAGE__->has_many(
1082   "old_reserves",
1083   "Koha::Schema::Result::OldReserve",
1084   { "foreign.borrowernumber" => "self.borrowernumber" },
1085   { cascade_copy => 0, cascade_delete => 0 },
1086 );
1087
1088 =head2 opac_news
1089
1090 Type: has_many
1091
1092 Related object: L<Koha::Schema::Result::OpacNews>
1093
1094 =cut
1095
1096 __PACKAGE__->has_many(
1097   "opac_news",
1098   "Koha::Schema::Result::OpacNews",
1099   { "foreign.borrowernumber" => "self.borrowernumber" },
1100   { cascade_copy => 0, cascade_delete => 0 },
1101 );
1102
1103 =head2 patron_list_patrons
1104
1105 Type: has_many
1106
1107 Related object: L<Koha::Schema::Result::PatronListPatron>
1108
1109 =cut
1110
1111 __PACKAGE__->has_many(
1112   "patron_list_patrons",
1113   "Koha::Schema::Result::PatronListPatron",
1114   { "foreign.borrowernumber" => "self.borrowernumber" },
1115   { cascade_copy => 0, cascade_delete => 0 },
1116 );
1117
1118 =head2 patron_lists
1119
1120 Type: has_many
1121
1122 Related object: L<Koha::Schema::Result::PatronList>
1123
1124 =cut
1125
1126 __PACKAGE__->has_many(
1127   "patron_lists",
1128   "Koha::Schema::Result::PatronList",
1129   { "foreign.owner" => "self.borrowernumber" },
1130   { cascade_copy => 0, cascade_delete => 0 },
1131 );
1132
1133 =head2 patronimage
1134
1135 Type: might_have
1136
1137 Related object: L<Koha::Schema::Result::Patronimage>
1138
1139 =cut
1140
1141 __PACKAGE__->might_have(
1142   "patronimage",
1143   "Koha::Schema::Result::Patronimage",
1144   { "foreign.borrowernumber" => "self.borrowernumber" },
1145   { cascade_copy => 0, cascade_delete => 0 },
1146 );
1147
1148 =head2 ratings
1149
1150 Type: has_many
1151
1152 Related object: L<Koha::Schema::Result::Rating>
1153
1154 =cut
1155
1156 __PACKAGE__->has_many(
1157   "ratings",
1158   "Koha::Schema::Result::Rating",
1159   { "foreign.borrowernumber" => "self.borrowernumber" },
1160   { cascade_copy => 0, cascade_delete => 0 },
1161 );
1162
1163 =head2 reserves
1164
1165 Type: has_many
1166
1167 Related object: L<Koha::Schema::Result::Reserve>
1168
1169 =cut
1170
1171 __PACKAGE__->has_many(
1172   "reserves",
1173   "Koha::Schema::Result::Reserve",
1174   { "foreign.borrowernumber" => "self.borrowernumber" },
1175   { cascade_copy => 0, cascade_delete => 0 },
1176 );
1177
1178 =head2 reviews
1179
1180 Type: has_many
1181
1182 Related object: L<Koha::Schema::Result::Review>
1183
1184 =cut
1185
1186 __PACKAGE__->has_many(
1187   "reviews",
1188   "Koha::Schema::Result::Review",
1189   { "foreign.borrowernumber" => "self.borrowernumber" },
1190   { cascade_copy => 0, cascade_delete => 0 },
1191 );
1192
1193 =head2 sms_provider
1194
1195 Type: belongs_to
1196
1197 Related object: L<Koha::Schema::Result::SmsProvider>
1198
1199 =cut
1200
1201 __PACKAGE__->belongs_to(
1202   "sms_provider",
1203   "Koha::Schema::Result::SmsProvider",
1204   { id => "sms_provider_id" },
1205   {
1206     is_deferrable => 1,
1207     join_type     => "LEFT",
1208     on_delete     => "SET NULL",
1209     on_update     => "CASCADE",
1210   },
1211 );
1212
1213 =head2 subscriptionroutinglists
1214
1215 Type: has_many
1216
1217 Related object: L<Koha::Schema::Result::Subscriptionroutinglist>
1218
1219 =cut
1220
1221 __PACKAGE__->has_many(
1222   "subscriptionroutinglists",
1223   "Koha::Schema::Result::Subscriptionroutinglist",
1224   { "foreign.borrowernumber" => "self.borrowernumber" },
1225   { cascade_copy => 0, cascade_delete => 0 },
1226 );
1227
1228 =head2 tags_all
1229
1230 Type: has_many
1231
1232 Related object: L<Koha::Schema::Result::TagAll>
1233
1234 =cut
1235
1236 __PACKAGE__->has_many(
1237   "tags_all",
1238   "Koha::Schema::Result::TagAll",
1239   { "foreign.borrowernumber" => "self.borrowernumber" },
1240   { cascade_copy => 0, cascade_delete => 0 },
1241 );
1242
1243 =head2 tags_approvals
1244
1245 Type: has_many
1246
1247 Related object: L<Koha::Schema::Result::TagsApproval>
1248
1249 =cut
1250
1251 __PACKAGE__->has_many(
1252   "tags_approvals",
1253   "Koha::Schema::Result::TagsApproval",
1254   { "foreign.approved_by" => "self.borrowernumber" },
1255   { cascade_copy => 0, cascade_delete => 0 },
1256 );
1257
1258 =head2 user_permissions
1259
1260 Type: has_many
1261
1262 Related object: L<Koha::Schema::Result::UserPermission>
1263
1264 =cut
1265
1266 __PACKAGE__->has_many(
1267   "user_permissions",
1268   "Koha::Schema::Result::UserPermission",
1269   { "foreign.borrowernumber" => "self.borrowernumber" },
1270   { cascade_copy => 0, cascade_delete => 0 },
1271 );
1272
1273 =head2 virtualshelfcontents
1274
1275 Type: has_many
1276
1277 Related object: L<Koha::Schema::Result::Virtualshelfcontent>
1278
1279 =cut
1280
1281 __PACKAGE__->has_many(
1282   "virtualshelfcontents",
1283   "Koha::Schema::Result::Virtualshelfcontent",
1284   { "foreign.borrowernumber" => "self.borrowernumber" },
1285   { cascade_copy => 0, cascade_delete => 0 },
1286 );
1287
1288 =head2 virtualshelfshares
1289
1290 Type: has_many
1291
1292 Related object: L<Koha::Schema::Result::Virtualshelfshare>
1293
1294 =cut
1295
1296 __PACKAGE__->has_many(
1297   "virtualshelfshares",
1298   "Koha::Schema::Result::Virtualshelfshare",
1299   { "foreign.borrowernumber" => "self.borrowernumber" },
1300   { cascade_copy => 0, cascade_delete => 0 },
1301 );
1302
1303 =head2 virtualshelves
1304
1305 Type: has_many
1306
1307 Related object: L<Koha::Schema::Result::Virtualshelve>
1308
1309 =cut
1310
1311 __PACKAGE__->has_many(
1312   "virtualshelves",
1313   "Koha::Schema::Result::Virtualshelve",
1314   { "foreign.owner" => "self.borrowernumber" },
1315   { cascade_copy => 0, cascade_delete => 0 },
1316 );
1317
1318 =head2 basketnoes
1319
1320 Type: many_to_many
1321
1322 Composing rels: L</aqbasketusers> -> basketno
1323
1324 =cut
1325
1326 __PACKAGE__->many_to_many("basketnoes", "aqbasketusers", "basketno");
1327
1328 =head2 budgets
1329
1330 Type: many_to_many
1331
1332 Composing rels: L</aqbudgetborrowers> -> budget
1333
1334 =cut
1335
1336 __PACKAGE__->many_to_many("budgets", "aqbudgetborrowers", "budget");
1337
1338 =head2 courses
1339
1340 Type: many_to_many
1341
1342 Composing rels: L</course_instructors> -> course
1343
1344 =cut
1345
1346 __PACKAGE__->many_to_many("courses", "course_instructors", "course");
1347
1348 =head2 ordernumbers
1349
1350 Type: many_to_many
1351
1352 Composing rels: L</aqorder_users> -> ordernumber
1353
1354 =cut
1355
1356 __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber");
1357
1358
1359 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-04-26 16:17:25
1360 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Qq3fmJ73x8Qv+Pqbs7zkow
1361
1362 __PACKAGE__->belongs_to(
1363     "guarantor",
1364     "Koha::Schema::Result::Borrower",
1365     { borrowernumber => "guarantorid" },
1366 );
1367
1368 __PACKAGE__->add_columns(
1369     '+lost' => { is_boolean => 1 },
1370     '+gonenoaddress' => { is_boolean => 1 }
1371 );
1372
1373 sub koha_objects_class {
1374     'Koha::Patrons';
1375 }
1376
1377 1;