Bug 20691: Add ability to turn feature on and off
[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: 32
37
38 =head2 surname
39
40   data_type: 'longtext'
41   is_nullable: 1
42
43 =head2 firstname
44
45   data_type: 'mediumtext'
46   is_nullable: 1
47
48 =head2 title
49
50   data_type: 'longtext'
51   is_nullable: 1
52
53 =head2 othernames
54
55   data_type: 'longtext'
56   is_nullable: 1
57
58 =head2 initials
59
60   data_type: 'mediumtext'
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: 'longtext'
78   is_nullable: 1
79
80 =head2 address2
81
82   data_type: 'mediumtext'
83   is_nullable: 1
84
85 =head2 city
86
87   data_type: 'longtext'
88   is_nullable: 1
89
90 =head2 state
91
92   data_type: 'mediumtext'
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: 'mediumtext'
104   is_nullable: 1
105
106 =head2 email
107
108   data_type: 'longtext'
109   is_nullable: 1
110
111 =head2 phone
112
113   data_type: 'mediumtext'
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: 'longtext'
125   is_nullable: 1
126
127 =head2 emailpro
128
129   data_type: 'mediumtext'
130   is_nullable: 1
131
132 =head2 phonepro
133
134   data_type: 'mediumtext'
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: 'mediumtext'
162   is_nullable: 1
163
164 =head2 B_city
165
166   accessor: 'b_city'
167   data_type: 'longtext'
168   is_nullable: 1
169
170 =head2 B_state
171
172   accessor: 'b_state'
173   data_type: 'mediumtext'
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: 'mediumtext'
187   is_nullable: 1
188
189 =head2 B_email
190
191   accessor: 'b_email'
192   data_type: 'mediumtext'
193   is_nullable: 1
194
195 =head2 B_phone
196
197   accessor: 'b_phone'
198   data_type: 'longtext'
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 date_renewed
236
237   data_type: 'date'
238   datetime_undef_if_invalid: 1
239   is_nullable: 1
240
241 =head2 gonenoaddress
242
243   data_type: 'tinyint'
244   is_nullable: 1
245
246 =head2 lost
247
248   data_type: 'tinyint'
249   is_nullable: 1
250
251 =head2 debarred
252
253   data_type: 'date'
254   datetime_undef_if_invalid: 1
255   is_nullable: 1
256
257 =head2 debarredcomment
258
259   data_type: 'varchar'
260   is_nullable: 1
261   size: 255
262
263 =head2 contactname
264
265   data_type: 'longtext'
266   is_nullable: 1
267
268 =head2 contactfirstname
269
270   data_type: 'mediumtext'
271   is_nullable: 1
272
273 =head2 contacttitle
274
275   data_type: 'mediumtext'
276   is_nullable: 1
277
278 =head2 borrowernotes
279
280   data_type: 'longtext'
281   is_nullable: 1
282
283 =head2 relationship
284
285   data_type: 'varchar'
286   is_nullable: 1
287   size: 100
288
289 =head2 sex
290
291   data_type: 'varchar'
292   is_nullable: 1
293   size: 1
294
295 =head2 password
296
297   data_type: 'varchar'
298   is_nullable: 1
299   size: 60
300
301 =head2 flags
302
303   data_type: 'integer'
304   is_nullable: 1
305
306 =head2 userid
307
308   data_type: 'varchar'
309   is_nullable: 1
310   size: 75
311
312 =head2 opacnote
313
314   data_type: 'longtext'
315   is_nullable: 1
316
317 =head2 contactnote
318
319   data_type: 'varchar'
320   is_nullable: 1
321   size: 255
322
323 =head2 sort1
324
325   data_type: 'varchar'
326   is_nullable: 1
327   size: 80
328
329 =head2 sort2
330
331   data_type: 'varchar'
332   is_nullable: 1
333   size: 80
334
335 =head2 altcontactfirstname
336
337   data_type: 'varchar'
338   is_nullable: 1
339   size: 255
340
341 =head2 altcontactsurname
342
343   data_type: 'varchar'
344   is_nullable: 1
345   size: 255
346
347 =head2 altcontactaddress1
348
349   data_type: 'varchar'
350   is_nullable: 1
351   size: 255
352
353 =head2 altcontactaddress2
354
355   data_type: 'varchar'
356   is_nullable: 1
357   size: 255
358
359 =head2 altcontactaddress3
360
361   data_type: 'varchar'
362   is_nullable: 1
363   size: 255
364
365 =head2 altcontactstate
366
367   data_type: 'mediumtext'
368   is_nullable: 1
369
370 =head2 altcontactzipcode
371
372   data_type: 'varchar'
373   is_nullable: 1
374   size: 50
375
376 =head2 altcontactcountry
377
378   data_type: 'mediumtext'
379   is_nullable: 1
380
381 =head2 altcontactphone
382
383   data_type: 'varchar'
384   is_nullable: 1
385   size: 50
386
387 =head2 smsalertnumber
388
389   data_type: 'varchar'
390   is_nullable: 1
391   size: 50
392
393 =head2 sms_provider_id
394
395   data_type: 'integer'
396   is_foreign_key: 1
397   is_nullable: 1
398
399 =head2 privacy
400
401   data_type: 'integer'
402   default_value: 1
403   is_nullable: 0
404
405 =head2 privacy_guarantor_fines
406
407   data_type: 'tinyint'
408   default_value: 0
409   is_nullable: 0
410
411 =head2 privacy_guarantor_checkouts
412
413   data_type: 'tinyint'
414   default_value: 0
415   is_nullable: 0
416
417 =head2 checkprevcheckout
418
419   data_type: 'varchar'
420   default_value: 'inherit'
421   is_nullable: 0
422   size: 7
423
424 =head2 updated_on
425
426   data_type: 'timestamp'
427   datetime_undef_if_invalid: 1
428   default_value: current_timestamp
429   is_nullable: 0
430
431 =head2 lastseen
432
433   data_type: 'datetime'
434   datetime_undef_if_invalid: 1
435   is_nullable: 1
436
437 =head2 lang
438
439   data_type: 'varchar'
440   default_value: 'default'
441   is_nullable: 0
442   size: 25
443
444 =head2 login_attempts
445
446   data_type: 'integer'
447   default_value: 0
448   is_nullable: 1
449
450 =head2 overdrive_auth_token
451
452   data_type: 'mediumtext'
453   is_nullable: 1
454
455 =head2 anonymized
456
457   data_type: 'tinyint'
458   default_value: 0
459   is_nullable: 0
460
461 =cut
462
463 __PACKAGE__->add_columns(
464   "borrowernumber",
465   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
466   "cardnumber",
467   { data_type => "varchar", is_nullable => 1, size => 32 },
468   "surname",
469   { data_type => "longtext", is_nullable => 1 },
470   "firstname",
471   { data_type => "mediumtext", is_nullable => 1 },
472   "title",
473   { data_type => "longtext", is_nullable => 1 },
474   "othernames",
475   { data_type => "longtext", is_nullable => 1 },
476   "initials",
477   { data_type => "mediumtext", is_nullable => 1 },
478   "streetnumber",
479   { data_type => "varchar", is_nullable => 1, size => 10 },
480   "streettype",
481   { data_type => "varchar", is_nullable => 1, size => 50 },
482   "address",
483   { data_type => "longtext", is_nullable => 1 },
484   "address2",
485   { data_type => "mediumtext", is_nullable => 1 },
486   "city",
487   { data_type => "longtext", is_nullable => 1 },
488   "state",
489   { data_type => "mediumtext", is_nullable => 1 },
490   "zipcode",
491   { data_type => "varchar", is_nullable => 1, size => 25 },
492   "country",
493   { data_type => "mediumtext", is_nullable => 1 },
494   "email",
495   { data_type => "longtext", is_nullable => 1 },
496   "phone",
497   { data_type => "mediumtext", is_nullable => 1 },
498   "mobile",
499   { data_type => "varchar", is_nullable => 1, size => 50 },
500   "fax",
501   { data_type => "longtext", is_nullable => 1 },
502   "emailpro",
503   { data_type => "mediumtext", is_nullable => 1 },
504   "phonepro",
505   { data_type => "mediumtext", is_nullable => 1 },
506   "B_streetnumber",
507   {
508     accessor => "b_streetnumber",
509     data_type => "varchar",
510     is_nullable => 1,
511     size => 10,
512   },
513   "B_streettype",
514   {
515     accessor => "b_streettype",
516     data_type => "varchar",
517     is_nullable => 1,
518     size => 50,
519   },
520   "B_address",
521   {
522     accessor => "b_address",
523     data_type => "varchar",
524     is_nullable => 1,
525     size => 100,
526   },
527   "B_address2",
528   { accessor => "b_address2", data_type => "mediumtext", is_nullable => 1 },
529   "B_city",
530   { accessor => "b_city", data_type => "longtext", is_nullable => 1 },
531   "B_state",
532   { accessor => "b_state", data_type => "mediumtext", is_nullable => 1 },
533   "B_zipcode",
534   {
535     accessor => "b_zipcode",
536     data_type => "varchar",
537     is_nullable => 1,
538     size => 25,
539   },
540   "B_country",
541   { accessor => "b_country", data_type => "mediumtext", is_nullable => 1 },
542   "B_email",
543   { accessor => "b_email", data_type => "mediumtext", is_nullable => 1 },
544   "B_phone",
545   { accessor => "b_phone", data_type => "longtext", is_nullable => 1 },
546   "dateofbirth",
547   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
548   "branchcode",
549   {
550     data_type => "varchar",
551     default_value => "",
552     is_foreign_key => 1,
553     is_nullable => 0,
554     size => 10,
555   },
556   "categorycode",
557   {
558     data_type => "varchar",
559     default_value => "",
560     is_foreign_key => 1,
561     is_nullable => 0,
562     size => 10,
563   },
564   "dateenrolled",
565   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
566   "dateexpiry",
567   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
568   "date_renewed",
569   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
570   "gonenoaddress",
571   { data_type => "tinyint", is_nullable => 1 },
572   "lost",
573   { data_type => "tinyint", is_nullable => 1 },
574   "debarred",
575   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
576   "debarredcomment",
577   { data_type => "varchar", is_nullable => 1, size => 255 },
578   "contactname",
579   { data_type => "longtext", is_nullable => 1 },
580   "contactfirstname",
581   { data_type => "mediumtext", is_nullable => 1 },
582   "contacttitle",
583   { data_type => "mediumtext", is_nullable => 1 },
584   "borrowernotes",
585   { data_type => "longtext", is_nullable => 1 },
586   "relationship",
587   { data_type => "varchar", is_nullable => 1, size => 100 },
588   "sex",
589   { data_type => "varchar", is_nullable => 1, size => 1 },
590   "password",
591   { data_type => "varchar", is_nullable => 1, size => 60 },
592   "flags",
593   { data_type => "integer", is_nullable => 1 },
594   "userid",
595   { data_type => "varchar", is_nullable => 1, size => 75 },
596   "opacnote",
597   { data_type => "longtext", is_nullable => 1 },
598   "contactnote",
599   { data_type => "varchar", is_nullable => 1, size => 255 },
600   "sort1",
601   { data_type => "varchar", is_nullable => 1, size => 80 },
602   "sort2",
603   { data_type => "varchar", is_nullable => 1, size => 80 },
604   "altcontactfirstname",
605   { data_type => "varchar", is_nullable => 1, size => 255 },
606   "altcontactsurname",
607   { data_type => "varchar", is_nullable => 1, size => 255 },
608   "altcontactaddress1",
609   { data_type => "varchar", is_nullable => 1, size => 255 },
610   "altcontactaddress2",
611   { data_type => "varchar", is_nullable => 1, size => 255 },
612   "altcontactaddress3",
613   { data_type => "varchar", is_nullable => 1, size => 255 },
614   "altcontactstate",
615   { data_type => "mediumtext", is_nullable => 1 },
616   "altcontactzipcode",
617   { data_type => "varchar", is_nullable => 1, size => 50 },
618   "altcontactcountry",
619   { data_type => "mediumtext", is_nullable => 1 },
620   "altcontactphone",
621   { data_type => "varchar", is_nullable => 1, size => 50 },
622   "smsalertnumber",
623   { data_type => "varchar", is_nullable => 1, size => 50 },
624   "sms_provider_id",
625   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
626   "privacy",
627   { data_type => "integer", default_value => 1, is_nullable => 0 },
628   "privacy_guarantor_fines",
629   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
630   "privacy_guarantor_checkouts",
631   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
632   "checkprevcheckout",
633   {
634     data_type => "varchar",
635     default_value => "inherit",
636     is_nullable => 0,
637     size => 7,
638   },
639   "updated_on",
640   {
641     data_type => "timestamp",
642     datetime_undef_if_invalid => 1,
643     default_value => \"current_timestamp",
644     is_nullable => 0,
645   },
646   "lastseen",
647   {
648     data_type => "datetime",
649     datetime_undef_if_invalid => 1,
650     is_nullable => 1,
651   },
652   "lang",
653   {
654     data_type => "varchar",
655     default_value => "default",
656     is_nullable => 0,
657     size => 25,
658   },
659   "login_attempts",
660   { data_type => "integer", default_value => 0, is_nullable => 1 },
661   "overdrive_auth_token",
662   { data_type => "mediumtext", is_nullable => 1 },
663   "anonymized",
664   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
665 );
666
667 =head1 PRIMARY KEY
668
669 =over 4
670
671 =item * L</borrowernumber>
672
673 =back
674
675 =cut
676
677 __PACKAGE__->set_primary_key("borrowernumber");
678
679 =head1 UNIQUE CONSTRAINTS
680
681 =head2 C<cardnumber>
682
683 =over 4
684
685 =item * L</cardnumber>
686
687 =back
688
689 =cut
690
691 __PACKAGE__->add_unique_constraint("cardnumber", ["cardnumber"]);
692
693 =head2 C<userid>
694
695 =over 4
696
697 =item * L</userid>
698
699 =back
700
701 =cut
702
703 __PACKAGE__->add_unique_constraint("userid", ["userid"]);
704
705 =head1 RELATIONS
706
707 =head2 accountlines
708
709 Type: has_many
710
711 Related object: L<Koha::Schema::Result::Accountline>
712
713 =cut
714
715 __PACKAGE__->has_many(
716   "accountlines",
717   "Koha::Schema::Result::Accountline",
718   { "foreign.borrowernumber" => "self.borrowernumber" },
719   { cascade_copy => 0, cascade_delete => 0 },
720 );
721
722 =head2 accountlines_managers
723
724 Type: has_many
725
726 Related object: L<Koha::Schema::Result::Accountline>
727
728 =cut
729
730 __PACKAGE__->has_many(
731   "accountlines_managers",
732   "Koha::Schema::Result::Accountline",
733   { "foreign.manager_id" => "self.borrowernumber" },
734   { cascade_copy => 0, cascade_delete => 0 },
735 );
736
737 =head2 api_keys
738
739 Type: has_many
740
741 Related object: L<Koha::Schema::Result::ApiKey>
742
743 =cut
744
745 __PACKAGE__->has_many(
746   "api_keys",
747   "Koha::Schema::Result::ApiKey",
748   { "foreign.patron_id" => "self.borrowernumber" },
749   { cascade_copy => 0, cascade_delete => 0 },
750 );
751
752 =head2 aqbasketusers
753
754 Type: has_many
755
756 Related object: L<Koha::Schema::Result::Aqbasketuser>
757
758 =cut
759
760 __PACKAGE__->has_many(
761   "aqbasketusers",
762   "Koha::Schema::Result::Aqbasketuser",
763   { "foreign.borrowernumber" => "self.borrowernumber" },
764   { cascade_copy => 0, cascade_delete => 0 },
765 );
766
767 =head2 aqbudgetborrowers
768
769 Type: has_many
770
771 Related object: L<Koha::Schema::Result::Aqbudgetborrower>
772
773 =cut
774
775 __PACKAGE__->has_many(
776   "aqbudgetborrowers",
777   "Koha::Schema::Result::Aqbudgetborrower",
778   { "foreign.borrowernumber" => "self.borrowernumber" },
779   { cascade_copy => 0, cascade_delete => 0 },
780 );
781
782 =head2 aqorder_users
783
784 Type: has_many
785
786 Related object: L<Koha::Schema::Result::AqorderUser>
787
788 =cut
789
790 __PACKAGE__->has_many(
791   "aqorder_users",
792   "Koha::Schema::Result::AqorderUser",
793   { "foreign.borrowernumber" => "self.borrowernumber" },
794   { cascade_copy => 0, cascade_delete => 0 },
795 );
796
797 =head2 aqorders
798
799 Type: has_many
800
801 Related object: L<Koha::Schema::Result::Aqorder>
802
803 =cut
804
805 __PACKAGE__->has_many(
806   "aqorders",
807   "Koha::Schema::Result::Aqorder",
808   { "foreign.created_by" => "self.borrowernumber" },
809   { cascade_copy => 0, cascade_delete => 0 },
810 );
811
812 =head2 article_requests
813
814 Type: has_many
815
816 Related object: L<Koha::Schema::Result::ArticleRequest>
817
818 =cut
819
820 __PACKAGE__->has_many(
821   "article_requests",
822   "Koha::Schema::Result::ArticleRequest",
823   { "foreign.borrowernumber" => "self.borrowernumber" },
824   { cascade_copy => 0, cascade_delete => 0 },
825 );
826
827 =head2 borrower_attributes
828
829 Type: has_many
830
831 Related object: L<Koha::Schema::Result::BorrowerAttribute>
832
833 =cut
834
835 __PACKAGE__->has_many(
836   "borrower_attributes",
837   "Koha::Schema::Result::BorrowerAttribute",
838   { "foreign.borrowernumber" => "self.borrowernumber" },
839   { cascade_copy => 0, cascade_delete => 0 },
840 );
841
842 =head2 borrower_debarments
843
844 Type: has_many
845
846 Related object: L<Koha::Schema::Result::BorrowerDebarment>
847
848 =cut
849
850 __PACKAGE__->has_many(
851   "borrower_debarments",
852   "Koha::Schema::Result::BorrowerDebarment",
853   { "foreign.borrowernumber" => "self.borrowernumber" },
854   { cascade_copy => 0, cascade_delete => 0 },
855 );
856
857 =head2 borrower_files
858
859 Type: has_many
860
861 Related object: L<Koha::Schema::Result::BorrowerFile>
862
863 =cut
864
865 __PACKAGE__->has_many(
866   "borrower_files",
867   "Koha::Schema::Result::BorrowerFile",
868   { "foreign.borrowernumber" => "self.borrowernumber" },
869   { cascade_copy => 0, cascade_delete => 0 },
870 );
871
872 =head2 borrower_message_preferences
873
874 Type: has_many
875
876 Related object: L<Koha::Schema::Result::BorrowerMessagePreference>
877
878 =cut
879
880 __PACKAGE__->has_many(
881   "borrower_message_preferences",
882   "Koha::Schema::Result::BorrowerMessagePreference",
883   { "foreign.borrowernumber" => "self.borrowernumber" },
884   { cascade_copy => 0, cascade_delete => 0 },
885 );
886
887 =head2 borrower_relationships_guarantees
888
889 Type: has_many
890
891 Related object: L<Koha::Schema::Result::BorrowerRelationship>
892
893 =cut
894
895 __PACKAGE__->has_many(
896   "borrower_relationships_guarantees",
897   "Koha::Schema::Result::BorrowerRelationship",
898   { "foreign.guarantee_id" => "self.borrowernumber" },
899   { cascade_copy => 0, cascade_delete => 0 },
900 );
901
902 =head2 borrower_relationships_guarantors
903
904 Type: has_many
905
906 Related object: L<Koha::Schema::Result::BorrowerRelationship>
907
908 =cut
909
910 __PACKAGE__->has_many(
911   "borrower_relationships_guarantors",
912   "Koha::Schema::Result::BorrowerRelationship",
913   { "foreign.guarantor_id" => "self.borrowernumber" },
914   { cascade_copy => 0, cascade_delete => 0 },
915 );
916
917 =head2 branchcode
918
919 Type: belongs_to
920
921 Related object: L<Koha::Schema::Result::Branch>
922
923 =cut
924
925 __PACKAGE__->belongs_to(
926   "branchcode",
927   "Koha::Schema::Result::Branch",
928   { branchcode => "branchcode" },
929   { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" },
930 );
931
932 =head2 categorycode
933
934 Type: belongs_to
935
936 Related object: L<Koha::Schema::Result::Category>
937
938 =cut
939
940 __PACKAGE__->belongs_to(
941   "categorycode",
942   "Koha::Schema::Result::Category",
943   { categorycode => "categorycode" },
944   { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" },
945 );
946
947 =head2 club_enrollments
948
949 Type: has_many
950
951 Related object: L<Koha::Schema::Result::ClubEnrollment>
952
953 =cut
954
955 __PACKAGE__->has_many(
956   "club_enrollments",
957   "Koha::Schema::Result::ClubEnrollment",
958   { "foreign.borrowernumber" => "self.borrowernumber" },
959   { cascade_copy => 0, cascade_delete => 0 },
960 );
961
962 =head2 course_instructors
963
964 Type: has_many
965
966 Related object: L<Koha::Schema::Result::CourseInstructor>
967
968 =cut
969
970 __PACKAGE__->has_many(
971   "course_instructors",
972   "Koha::Schema::Result::CourseInstructor",
973   { "foreign.borrowernumber" => "self.borrowernumber" },
974   { cascade_copy => 0, cascade_delete => 0 },
975 );
976
977 =head2 creator_batches
978
979 Type: has_many
980
981 Related object: L<Koha::Schema::Result::CreatorBatch>
982
983 =cut
984
985 __PACKAGE__->has_many(
986   "creator_batches",
987   "Koha::Schema::Result::CreatorBatch",
988   { "foreign.borrower_number" => "self.borrowernumber" },
989   { cascade_copy => 0, cascade_delete => 0 },
990 );
991
992 =head2 discharges
993
994 Type: has_many
995
996 Related object: L<Koha::Schema::Result::Discharge>
997
998 =cut
999
1000 __PACKAGE__->has_many(
1001   "discharges",
1002   "Koha::Schema::Result::Discharge",
1003   { "foreign.borrower" => "self.borrowernumber" },
1004   { cascade_copy => 0, cascade_delete => 0 },
1005 );
1006
1007 =head2 hold_fill_targets
1008
1009 Type: has_many
1010
1011 Related object: L<Koha::Schema::Result::HoldFillTarget>
1012
1013 =cut
1014
1015 __PACKAGE__->has_many(
1016   "hold_fill_targets",
1017   "Koha::Schema::Result::HoldFillTarget",
1018   { "foreign.borrowernumber" => "self.borrowernumber" },
1019   { cascade_copy => 0, cascade_delete => 0 },
1020 );
1021
1022 =head2 housebound_profile
1023
1024 Type: might_have
1025
1026 Related object: L<Koha::Schema::Result::HouseboundProfile>
1027
1028 =cut
1029
1030 __PACKAGE__->might_have(
1031   "housebound_profile",
1032   "Koha::Schema::Result::HouseboundProfile",
1033   { "foreign.borrowernumber" => "self.borrowernumber" },
1034   { cascade_copy => 0, cascade_delete => 0 },
1035 );
1036
1037 =head2 housebound_role
1038
1039 Type: might_have
1040
1041 Related object: L<Koha::Schema::Result::HouseboundRole>
1042
1043 =cut
1044
1045 __PACKAGE__->might_have(
1046   "housebound_role",
1047   "Koha::Schema::Result::HouseboundRole",
1048   { "foreign.borrowernumber_id" => "self.borrowernumber" },
1049   { cascade_copy => 0, cascade_delete => 0 },
1050 );
1051
1052 =head2 housebound_visit_chooser_brwnumbers
1053
1054 Type: has_many
1055
1056 Related object: L<Koha::Schema::Result::HouseboundVisit>
1057
1058 =cut
1059
1060 __PACKAGE__->has_many(
1061   "housebound_visit_chooser_brwnumbers",
1062   "Koha::Schema::Result::HouseboundVisit",
1063   { "foreign.chooser_brwnumber" => "self.borrowernumber" },
1064   { cascade_copy => 0, cascade_delete => 0 },
1065 );
1066
1067 =head2 housebound_visit_deliverer_brwnumbers
1068
1069 Type: has_many
1070
1071 Related object: L<Koha::Schema::Result::HouseboundVisit>
1072
1073 =cut
1074
1075 __PACKAGE__->has_many(
1076   "housebound_visit_deliverer_brwnumbers",
1077   "Koha::Schema::Result::HouseboundVisit",
1078   { "foreign.deliverer_brwnumber" => "self.borrowernumber" },
1079   { cascade_copy => 0, cascade_delete => 0 },
1080 );
1081
1082 =head2 illcomments
1083
1084 Type: has_many
1085
1086 Related object: L<Koha::Schema::Result::Illcomment>
1087
1088 =cut
1089
1090 __PACKAGE__->has_many(
1091   "illcomments",
1092   "Koha::Schema::Result::Illcomment",
1093   { "foreign.borrowernumber" => "self.borrowernumber" },
1094   { cascade_copy => 0, cascade_delete => 0 },
1095 );
1096
1097 =head2 illrequests
1098
1099 Type: has_many
1100
1101 Related object: L<Koha::Schema::Result::Illrequest>
1102
1103 =cut
1104
1105 __PACKAGE__->has_many(
1106   "illrequests",
1107   "Koha::Schema::Result::Illrequest",
1108   { "foreign.borrowernumber" => "self.borrowernumber" },
1109   { cascade_copy => 0, cascade_delete => 0 },
1110 );
1111
1112 =head2 issues
1113
1114 Type: has_many
1115
1116 Related object: L<Koha::Schema::Result::Issue>
1117
1118 =cut
1119
1120 __PACKAGE__->has_many(
1121   "issues",
1122   "Koha::Schema::Result::Issue",
1123   { "foreign.borrowernumber" => "self.borrowernumber" },
1124   { cascade_copy => 0, cascade_delete => 0 },
1125 );
1126
1127 =head2 items_last_borrowers
1128
1129 Type: has_many
1130
1131 Related object: L<Koha::Schema::Result::ItemsLastBorrower>
1132
1133 =cut
1134
1135 __PACKAGE__->has_many(
1136   "items_last_borrowers",
1137   "Koha::Schema::Result::ItemsLastBorrower",
1138   { "foreign.borrowernumber" => "self.borrowernumber" },
1139   { cascade_copy => 0, cascade_delete => 0 },
1140 );
1141
1142 =head2 message_queues
1143
1144 Type: has_many
1145
1146 Related object: L<Koha::Schema::Result::MessageQueue>
1147
1148 =cut
1149
1150 __PACKAGE__->has_many(
1151   "message_queues",
1152   "Koha::Schema::Result::MessageQueue",
1153   { "foreign.borrowernumber" => "self.borrowernumber" },
1154   { cascade_copy => 0, cascade_delete => 0 },
1155 );
1156
1157 =head2 messages
1158
1159 Type: has_many
1160
1161 Related object: L<Koha::Schema::Result::Message>
1162
1163 =cut
1164
1165 __PACKAGE__->has_many(
1166   "messages",
1167   "Koha::Schema::Result::Message",
1168   { "foreign.manager_id" => "self.borrowernumber" },
1169   { cascade_copy => 0, cascade_delete => 0 },
1170 );
1171
1172 =head2 messages_borrowernumbers
1173
1174 Type: has_many
1175
1176 Related object: L<Koha::Schema::Result::Message>
1177
1178 =cut
1179
1180 __PACKAGE__->has_many(
1181   "messages_borrowernumbers",
1182   "Koha::Schema::Result::Message",
1183   { "foreign.borrowernumber" => "self.borrowernumber" },
1184   { cascade_copy => 0, cascade_delete => 0 },
1185 );
1186
1187 =head2 old_issues
1188
1189 Type: has_many
1190
1191 Related object: L<Koha::Schema::Result::OldIssue>
1192
1193 =cut
1194
1195 __PACKAGE__->has_many(
1196   "old_issues",
1197   "Koha::Schema::Result::OldIssue",
1198   { "foreign.borrowernumber" => "self.borrowernumber" },
1199   { cascade_copy => 0, cascade_delete => 0 },
1200 );
1201
1202 =head2 old_reserves
1203
1204 Type: has_many
1205
1206 Related object: L<Koha::Schema::Result::OldReserve>
1207
1208 =cut
1209
1210 __PACKAGE__->has_many(
1211   "old_reserves",
1212   "Koha::Schema::Result::OldReserve",
1213   { "foreign.borrowernumber" => "self.borrowernumber" },
1214   { cascade_copy => 0, cascade_delete => 0 },
1215 );
1216
1217 =head2 opac_news
1218
1219 Type: has_many
1220
1221 Related object: L<Koha::Schema::Result::OpacNews>
1222
1223 =cut
1224
1225 __PACKAGE__->has_many(
1226   "opac_news",
1227   "Koha::Schema::Result::OpacNews",
1228   { "foreign.borrowernumber" => "self.borrowernumber" },
1229   { cascade_copy => 0, cascade_delete => 0 },
1230 );
1231
1232 =head2 patron_consents
1233
1234 Type: has_many
1235
1236 Related object: L<Koha::Schema::Result::PatronConsent>
1237
1238 =cut
1239
1240 __PACKAGE__->has_many(
1241   "patron_consents",
1242   "Koha::Schema::Result::PatronConsent",
1243   { "foreign.borrowernumber" => "self.borrowernumber" },
1244   { cascade_copy => 0, cascade_delete => 0 },
1245 );
1246
1247 =head2 patron_list_patrons
1248
1249 Type: has_many
1250
1251 Related object: L<Koha::Schema::Result::PatronListPatron>
1252
1253 =cut
1254
1255 __PACKAGE__->has_many(
1256   "patron_list_patrons",
1257   "Koha::Schema::Result::PatronListPatron",
1258   { "foreign.borrowernumber" => "self.borrowernumber" },
1259   { cascade_copy => 0, cascade_delete => 0 },
1260 );
1261
1262 =head2 patron_lists
1263
1264 Type: has_many
1265
1266 Related object: L<Koha::Schema::Result::PatronList>
1267
1268 =cut
1269
1270 __PACKAGE__->has_many(
1271   "patron_lists",
1272   "Koha::Schema::Result::PatronList",
1273   { "foreign.owner" => "self.borrowernumber" },
1274   { cascade_copy => 0, cascade_delete => 0 },
1275 );
1276
1277 =head2 patronimage
1278
1279 Type: might_have
1280
1281 Related object: L<Koha::Schema::Result::Patronimage>
1282
1283 =cut
1284
1285 __PACKAGE__->might_have(
1286   "patronimage",
1287   "Koha::Schema::Result::Patronimage",
1288   { "foreign.borrowernumber" => "self.borrowernumber" },
1289   { cascade_copy => 0, cascade_delete => 0 },
1290 );
1291
1292 =head2 ratings
1293
1294 Type: has_many
1295
1296 Related object: L<Koha::Schema::Result::Rating>
1297
1298 =cut
1299
1300 __PACKAGE__->has_many(
1301   "ratings",
1302   "Koha::Schema::Result::Rating",
1303   { "foreign.borrowernumber" => "self.borrowernumber" },
1304   { cascade_copy => 0, cascade_delete => 0 },
1305 );
1306
1307 =head2 reserves
1308
1309 Type: has_many
1310
1311 Related object: L<Koha::Schema::Result::Reserve>
1312
1313 =cut
1314
1315 __PACKAGE__->has_many(
1316   "reserves",
1317   "Koha::Schema::Result::Reserve",
1318   { "foreign.borrowernumber" => "self.borrowernumber" },
1319   { cascade_copy => 0, cascade_delete => 0 },
1320 );
1321
1322 =head2 reviews
1323
1324 Type: has_many
1325
1326 Related object: L<Koha::Schema::Result::Review>
1327
1328 =cut
1329
1330 __PACKAGE__->has_many(
1331   "reviews",
1332   "Koha::Schema::Result::Review",
1333   { "foreign.borrowernumber" => "self.borrowernumber" },
1334   { cascade_copy => 0, cascade_delete => 0 },
1335 );
1336
1337 =head2 sms_provider
1338
1339 Type: belongs_to
1340
1341 Related object: L<Koha::Schema::Result::SmsProvider>
1342
1343 =cut
1344
1345 __PACKAGE__->belongs_to(
1346   "sms_provider",
1347   "Koha::Schema::Result::SmsProvider",
1348   { id => "sms_provider_id" },
1349   {
1350     is_deferrable => 1,
1351     join_type     => "LEFT",
1352     on_delete     => "SET NULL",
1353     on_update     => "CASCADE",
1354   },
1355 );
1356
1357 =head2 subscriptionroutinglists
1358
1359 Type: has_many
1360
1361 Related object: L<Koha::Schema::Result::Subscriptionroutinglist>
1362
1363 =cut
1364
1365 __PACKAGE__->has_many(
1366   "subscriptionroutinglists",
1367   "Koha::Schema::Result::Subscriptionroutinglist",
1368   { "foreign.borrowernumber" => "self.borrowernumber" },
1369   { cascade_copy => 0, cascade_delete => 0 },
1370 );
1371
1372 =head2 suggestions_acceptedbies
1373
1374 Type: has_many
1375
1376 Related object: L<Koha::Schema::Result::Suggestion>
1377
1378 =cut
1379
1380 __PACKAGE__->has_many(
1381   "suggestions_acceptedbies",
1382   "Koha::Schema::Result::Suggestion",
1383   { "foreign.acceptedby" => "self.borrowernumber" },
1384   { cascade_copy => 0, cascade_delete => 0 },
1385 );
1386
1387 =head2 suggestions_managedbies
1388
1389 Type: has_many
1390
1391 Related object: L<Koha::Schema::Result::Suggestion>
1392
1393 =cut
1394
1395 __PACKAGE__->has_many(
1396   "suggestions_managedbies",
1397   "Koha::Schema::Result::Suggestion",
1398   { "foreign.managedby" => "self.borrowernumber" },
1399   { cascade_copy => 0, cascade_delete => 0 },
1400 );
1401
1402 =head2 suggestions_rejectedbies
1403
1404 Type: has_many
1405
1406 Related object: L<Koha::Schema::Result::Suggestion>
1407
1408 =cut
1409
1410 __PACKAGE__->has_many(
1411   "suggestions_rejectedbies",
1412   "Koha::Schema::Result::Suggestion",
1413   { "foreign.rejectedby" => "self.borrowernumber" },
1414   { cascade_copy => 0, cascade_delete => 0 },
1415 );
1416
1417 =head2 suggestions_suggestedbies
1418
1419 Type: has_many
1420
1421 Related object: L<Koha::Schema::Result::Suggestion>
1422
1423 =cut
1424
1425 __PACKAGE__->has_many(
1426   "suggestions_suggestedbies",
1427   "Koha::Schema::Result::Suggestion",
1428   { "foreign.suggestedby" => "self.borrowernumber" },
1429   { cascade_copy => 0, cascade_delete => 0 },
1430 );
1431
1432 =head2 tags_all
1433
1434 Type: has_many
1435
1436 Related object: L<Koha::Schema::Result::TagAll>
1437
1438 =cut
1439
1440 __PACKAGE__->has_many(
1441   "tags_all",
1442   "Koha::Schema::Result::TagAll",
1443   { "foreign.borrowernumber" => "self.borrowernumber" },
1444   { cascade_copy => 0, cascade_delete => 0 },
1445 );
1446
1447 =head2 tags_approvals
1448
1449 Type: has_many
1450
1451 Related object: L<Koha::Schema::Result::TagsApproval>
1452
1453 =cut
1454
1455 __PACKAGE__->has_many(
1456   "tags_approvals",
1457   "Koha::Schema::Result::TagsApproval",
1458   { "foreign.approved_by" => "self.borrowernumber" },
1459   { cascade_copy => 0, cascade_delete => 0 },
1460 );
1461
1462 =head2 user_permissions
1463
1464 Type: has_many
1465
1466 Related object: L<Koha::Schema::Result::UserPermission>
1467
1468 =cut
1469
1470 __PACKAGE__->has_many(
1471   "user_permissions",
1472   "Koha::Schema::Result::UserPermission",
1473   { "foreign.borrowernumber" => "self.borrowernumber" },
1474   { cascade_copy => 0, cascade_delete => 0 },
1475 );
1476
1477 =head2 virtualshelfcontents
1478
1479 Type: has_many
1480
1481 Related object: L<Koha::Schema::Result::Virtualshelfcontent>
1482
1483 =cut
1484
1485 __PACKAGE__->has_many(
1486   "virtualshelfcontents",
1487   "Koha::Schema::Result::Virtualshelfcontent",
1488   { "foreign.borrowernumber" => "self.borrowernumber" },
1489   { cascade_copy => 0, cascade_delete => 0 },
1490 );
1491
1492 =head2 virtualshelfshares
1493
1494 Type: has_many
1495
1496 Related object: L<Koha::Schema::Result::Virtualshelfshare>
1497
1498 =cut
1499
1500 __PACKAGE__->has_many(
1501   "virtualshelfshares",
1502   "Koha::Schema::Result::Virtualshelfshare",
1503   { "foreign.borrowernumber" => "self.borrowernumber" },
1504   { cascade_copy => 0, cascade_delete => 0 },
1505 );
1506
1507 =head2 virtualshelves
1508
1509 Type: has_many
1510
1511 Related object: L<Koha::Schema::Result::Virtualshelve>
1512
1513 =cut
1514
1515 __PACKAGE__->has_many(
1516   "virtualshelves",
1517   "Koha::Schema::Result::Virtualshelve",
1518   { "foreign.owner" => "self.borrowernumber" },
1519   { cascade_copy => 0, cascade_delete => 0 },
1520 );
1521
1522 =head2 basketnoes
1523
1524 Type: many_to_many
1525
1526 Composing rels: L</aqbasketusers> -> basketno
1527
1528 =cut
1529
1530 __PACKAGE__->many_to_many("basketnoes", "aqbasketusers", "basketno");
1531
1532 =head2 budgets
1533
1534 Type: many_to_many
1535
1536 Composing rels: L</aqbudgetborrowers> -> budget
1537
1538 =cut
1539
1540 __PACKAGE__->many_to_many("budgets", "aqbudgetborrowers", "budget");
1541
1542 =head2 courses
1543
1544 Type: many_to_many
1545
1546 Composing rels: L</course_instructors> -> course
1547
1548 =cut
1549
1550 __PACKAGE__->many_to_many("courses", "course_instructors", "course");
1551
1552 =head2 ordernumbers
1553
1554 Type: many_to_many
1555
1556 Composing rels: L</aqorder_users> -> ordernumber
1557
1558 =cut
1559
1560 __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber");
1561
1562
1563 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-05-22 04:33:29
1564 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:lbMdmIHlRt+zayG5+Rq4/w
1565
1566 __PACKAGE__->add_columns(
1567     '+anonymized' => { is_boolean => 1 },
1568     '+lost'          => { is_boolean => 1 },
1569     '+gonenoaddress' => { is_boolean => 1 }
1570 );
1571
1572 sub koha_objects_class {
1573     'Koha::Patrons';
1574 }
1575 sub koha_object_class {
1576     'Koha::Patron';
1577 }
1578
1579 1;