Bug 23355: (RM follow-up) Remove reintroduced relationship
[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 cash_register_actions
933
934 Type: has_many
935
936 Related object: L<Koha::Schema::Result::CashRegisterAction>
937
938 =cut
939
940 __PACKAGE__->has_many(
941   "cash_register_actions",
942   "Koha::Schema::Result::CashRegisterAction",
943   { "foreign.manager_id" => "self.borrowernumber" },
944   { cascade_copy => 0, cascade_delete => 0 },
945 );
946
947 =head2 categorycode
948
949 Type: belongs_to
950
951 Related object: L<Koha::Schema::Result::Category>
952
953 =cut
954
955 __PACKAGE__->belongs_to(
956   "categorycode",
957   "Koha::Schema::Result::Category",
958   { categorycode => "categorycode" },
959   { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" },
960 );
961
962 =head2 club_enrollments
963
964 Type: has_many
965
966 Related object: L<Koha::Schema::Result::ClubEnrollment>
967
968 =cut
969
970 __PACKAGE__->has_many(
971   "club_enrollments",
972   "Koha::Schema::Result::ClubEnrollment",
973   { "foreign.borrowernumber" => "self.borrowernumber" },
974   { cascade_copy => 0, cascade_delete => 0 },
975 );
976
977 =head2 club_holds_to_patron_holds
978
979 Type: has_many
980
981 Related object: L<Koha::Schema::Result::ClubHoldsToPatronHold>
982
983 =cut
984
985 __PACKAGE__->has_many(
986   "club_holds_to_patron_holds",
987   "Koha::Schema::Result::ClubHoldsToPatronHold",
988   { "foreign.patron_id" => "self.borrowernumber" },
989   { cascade_copy => 0, cascade_delete => 0 },
990 );
991
992 =head2 course_instructors
993
994 Type: has_many
995
996 Related object: L<Koha::Schema::Result::CourseInstructor>
997
998 =cut
999
1000 __PACKAGE__->has_many(
1001   "course_instructors",
1002   "Koha::Schema::Result::CourseInstructor",
1003   { "foreign.borrowernumber" => "self.borrowernumber" },
1004   { cascade_copy => 0, cascade_delete => 0 },
1005 );
1006
1007 =head2 creator_batches
1008
1009 Type: has_many
1010
1011 Related object: L<Koha::Schema::Result::CreatorBatch>
1012
1013 =cut
1014
1015 __PACKAGE__->has_many(
1016   "creator_batches",
1017   "Koha::Schema::Result::CreatorBatch",
1018   { "foreign.borrower_number" => "self.borrowernumber" },
1019   { cascade_copy => 0, cascade_delete => 0 },
1020 );
1021
1022 =head2 discharges
1023
1024 Type: has_many
1025
1026 Related object: L<Koha::Schema::Result::Discharge>
1027
1028 =cut
1029
1030 __PACKAGE__->has_many(
1031   "discharges",
1032   "Koha::Schema::Result::Discharge",
1033   { "foreign.borrower" => "self.borrowernumber" },
1034   { cascade_copy => 0, cascade_delete => 0 },
1035 );
1036
1037 =head2 hold_fill_targets
1038
1039 Type: has_many
1040
1041 Related object: L<Koha::Schema::Result::HoldFillTarget>
1042
1043 =cut
1044
1045 __PACKAGE__->has_many(
1046   "hold_fill_targets",
1047   "Koha::Schema::Result::HoldFillTarget",
1048   { "foreign.borrowernumber" => "self.borrowernumber" },
1049   { cascade_copy => 0, cascade_delete => 0 },
1050 );
1051
1052 =head2 housebound_profile
1053
1054 Type: might_have
1055
1056 Related object: L<Koha::Schema::Result::HouseboundProfile>
1057
1058 =cut
1059
1060 __PACKAGE__->might_have(
1061   "housebound_profile",
1062   "Koha::Schema::Result::HouseboundProfile",
1063   { "foreign.borrowernumber" => "self.borrowernumber" },
1064   { cascade_copy => 0, cascade_delete => 0 },
1065 );
1066
1067 =head2 housebound_role
1068
1069 Type: might_have
1070
1071 Related object: L<Koha::Schema::Result::HouseboundRole>
1072
1073 =cut
1074
1075 __PACKAGE__->might_have(
1076   "housebound_role",
1077   "Koha::Schema::Result::HouseboundRole",
1078   { "foreign.borrowernumber_id" => "self.borrowernumber" },
1079   { cascade_copy => 0, cascade_delete => 0 },
1080 );
1081
1082 =head2 housebound_visit_chooser_brwnumbers
1083
1084 Type: has_many
1085
1086 Related object: L<Koha::Schema::Result::HouseboundVisit>
1087
1088 =cut
1089
1090 __PACKAGE__->has_many(
1091   "housebound_visit_chooser_brwnumbers",
1092   "Koha::Schema::Result::HouseboundVisit",
1093   { "foreign.chooser_brwnumber" => "self.borrowernumber" },
1094   { cascade_copy => 0, cascade_delete => 0 },
1095 );
1096
1097 =head2 housebound_visit_deliverer_brwnumbers
1098
1099 Type: has_many
1100
1101 Related object: L<Koha::Schema::Result::HouseboundVisit>
1102
1103 =cut
1104
1105 __PACKAGE__->has_many(
1106   "housebound_visit_deliverer_brwnumbers",
1107   "Koha::Schema::Result::HouseboundVisit",
1108   { "foreign.deliverer_brwnumber" => "self.borrowernumber" },
1109   { cascade_copy => 0, cascade_delete => 0 },
1110 );
1111
1112 =head2 illcomments
1113
1114 Type: has_many
1115
1116 Related object: L<Koha::Schema::Result::Illcomment>
1117
1118 =cut
1119
1120 __PACKAGE__->has_many(
1121   "illcomments",
1122   "Koha::Schema::Result::Illcomment",
1123   { "foreign.borrowernumber" => "self.borrowernumber" },
1124   { cascade_copy => 0, cascade_delete => 0 },
1125 );
1126
1127 =head2 illrequests
1128
1129 Type: has_many
1130
1131 Related object: L<Koha::Schema::Result::Illrequest>
1132
1133 =cut
1134
1135 __PACKAGE__->has_many(
1136   "illrequests",
1137   "Koha::Schema::Result::Illrequest",
1138   { "foreign.borrowernumber" => "self.borrowernumber" },
1139   { cascade_copy => 0, cascade_delete => 0 },
1140 );
1141
1142 =head2 issues
1143
1144 Type: has_many
1145
1146 Related object: L<Koha::Schema::Result::Issue>
1147
1148 =cut
1149
1150 __PACKAGE__->has_many(
1151   "issues",
1152   "Koha::Schema::Result::Issue",
1153   { "foreign.borrowernumber" => "self.borrowernumber" },
1154   { cascade_copy => 0, cascade_delete => 0 },
1155 );
1156
1157 =head2 items_last_borrowers
1158
1159 Type: has_many
1160
1161 Related object: L<Koha::Schema::Result::ItemsLastBorrower>
1162
1163 =cut
1164
1165 __PACKAGE__->has_many(
1166   "items_last_borrowers",
1167   "Koha::Schema::Result::ItemsLastBorrower",
1168   { "foreign.borrowernumber" => "self.borrowernumber" },
1169   { cascade_copy => 0, cascade_delete => 0 },
1170 );
1171
1172 =head2 message_queues
1173
1174 Type: has_many
1175
1176 Related object: L<Koha::Schema::Result::MessageQueue>
1177
1178 =cut
1179
1180 __PACKAGE__->has_many(
1181   "message_queues",
1182   "Koha::Schema::Result::MessageQueue",
1183   { "foreign.borrowernumber" => "self.borrowernumber" },
1184   { cascade_copy => 0, cascade_delete => 0 },
1185 );
1186
1187 =head2 messages
1188
1189 Type: has_many
1190
1191 Related object: L<Koha::Schema::Result::Message>
1192
1193 =cut
1194
1195 __PACKAGE__->has_many(
1196   "messages",
1197   "Koha::Schema::Result::Message",
1198   { "foreign.manager_id" => "self.borrowernumber" },
1199   { cascade_copy => 0, cascade_delete => 0 },
1200 );
1201
1202 =head2 messages_borrowernumbers
1203
1204 Type: has_many
1205
1206 Related object: L<Koha::Schema::Result::Message>
1207
1208 =cut
1209
1210 __PACKAGE__->has_many(
1211   "messages_borrowernumbers",
1212   "Koha::Schema::Result::Message",
1213   { "foreign.borrowernumber" => "self.borrowernumber" },
1214   { cascade_copy => 0, cascade_delete => 0 },
1215 );
1216
1217 =head2 old_issues
1218
1219 Type: has_many
1220
1221 Related object: L<Koha::Schema::Result::OldIssue>
1222
1223 =cut
1224
1225 __PACKAGE__->has_many(
1226   "old_issues",
1227   "Koha::Schema::Result::OldIssue",
1228   { "foreign.borrowernumber" => "self.borrowernumber" },
1229   { cascade_copy => 0, cascade_delete => 0 },
1230 );
1231
1232 =head2 old_reserves
1233
1234 Type: has_many
1235
1236 Related object: L<Koha::Schema::Result::OldReserve>
1237
1238 =cut
1239
1240 __PACKAGE__->has_many(
1241   "old_reserves",
1242   "Koha::Schema::Result::OldReserve",
1243   { "foreign.borrowernumber" => "self.borrowernumber" },
1244   { cascade_copy => 0, cascade_delete => 0 },
1245 );
1246
1247 =head2 opac_news
1248
1249 Type: has_many
1250
1251 Related object: L<Koha::Schema::Result::OpacNews>
1252
1253 =cut
1254
1255 __PACKAGE__->has_many(
1256   "opac_news",
1257   "Koha::Schema::Result::OpacNews",
1258   { "foreign.borrowernumber" => "self.borrowernumber" },
1259   { cascade_copy => 0, cascade_delete => 0 },
1260 );
1261
1262 =head2 patron_consents
1263
1264 Type: has_many
1265
1266 Related object: L<Koha::Schema::Result::PatronConsent>
1267
1268 =cut
1269
1270 __PACKAGE__->has_many(
1271   "patron_consents",
1272   "Koha::Schema::Result::PatronConsent",
1273   { "foreign.borrowernumber" => "self.borrowernumber" },
1274   { cascade_copy => 0, cascade_delete => 0 },
1275 );
1276
1277 =head2 patron_list_patrons
1278
1279 Type: has_many
1280
1281 Related object: L<Koha::Schema::Result::PatronListPatron>
1282
1283 =cut
1284
1285 __PACKAGE__->has_many(
1286   "patron_list_patrons",
1287   "Koha::Schema::Result::PatronListPatron",
1288   { "foreign.borrowernumber" => "self.borrowernumber" },
1289   { cascade_copy => 0, cascade_delete => 0 },
1290 );
1291
1292 =head2 patron_lists
1293
1294 Type: has_many
1295
1296 Related object: L<Koha::Schema::Result::PatronList>
1297
1298 =cut
1299
1300 __PACKAGE__->has_many(
1301   "patron_lists",
1302   "Koha::Schema::Result::PatronList",
1303   { "foreign.owner" => "self.borrowernumber" },
1304   { cascade_copy => 0, cascade_delete => 0 },
1305 );
1306
1307 =head2 patronimage
1308
1309 Type: might_have
1310
1311 Related object: L<Koha::Schema::Result::Patronimage>
1312
1313 =cut
1314
1315 __PACKAGE__->might_have(
1316   "patronimage",
1317   "Koha::Schema::Result::Patronimage",
1318   { "foreign.borrowernumber" => "self.borrowernumber" },
1319   { cascade_copy => 0, cascade_delete => 0 },
1320 );
1321
1322 =head2 ratings
1323
1324 Type: has_many
1325
1326 Related object: L<Koha::Schema::Result::Rating>
1327
1328 =cut
1329
1330 __PACKAGE__->has_many(
1331   "ratings",
1332   "Koha::Schema::Result::Rating",
1333   { "foreign.borrowernumber" => "self.borrowernumber" },
1334   { cascade_copy => 0, cascade_delete => 0 },
1335 );
1336
1337 =head2 reserves
1338
1339 Type: has_many
1340
1341 Related object: L<Koha::Schema::Result::Reserve>
1342
1343 =cut
1344
1345 __PACKAGE__->has_many(
1346   "reserves",
1347   "Koha::Schema::Result::Reserve",
1348   { "foreign.borrowernumber" => "self.borrowernumber" },
1349   { cascade_copy => 0, cascade_delete => 0 },
1350 );
1351
1352 =head2 return_claims_borrowernumbers
1353
1354 Type: has_many
1355
1356 Related object: L<Koha::Schema::Result::ReturnClaim>
1357
1358 =cut
1359
1360 __PACKAGE__->has_many(
1361   "return_claims_borrowernumbers",
1362   "Koha::Schema::Result::ReturnClaim",
1363   { "foreign.borrowernumber" => "self.borrowernumber" },
1364   { cascade_copy => 0, cascade_delete => 0 },
1365 );
1366
1367 =head2 return_claims_created_by
1368
1369 Type: has_many
1370
1371 Related object: L<Koha::Schema::Result::ReturnClaim>
1372
1373 =cut
1374
1375 __PACKAGE__->has_many(
1376   "return_claims_created_by",
1377   "Koha::Schema::Result::ReturnClaim",
1378   { "foreign.created_by" => "self.borrowernumber" },
1379   { cascade_copy => 0, cascade_delete => 0 },
1380 );
1381
1382 =head2 return_claims_resolved_by
1383
1384 Type: has_many
1385
1386 Related object: L<Koha::Schema::Result::ReturnClaim>
1387
1388 =cut
1389
1390 __PACKAGE__->has_many(
1391   "return_claims_resolved_by",
1392   "Koha::Schema::Result::ReturnClaim",
1393   { "foreign.resolved_by" => "self.borrowernumber" },
1394   { cascade_copy => 0, cascade_delete => 0 },
1395 );
1396
1397 =head2 return_claims_updated_by
1398
1399 Type: has_many
1400
1401 Related object: L<Koha::Schema::Result::ReturnClaim>
1402
1403 =cut
1404
1405 __PACKAGE__->has_many(
1406   "return_claims_updated_by",
1407   "Koha::Schema::Result::ReturnClaim",
1408   { "foreign.updated_by" => "self.borrowernumber" },
1409   { cascade_copy => 0, cascade_delete => 0 },
1410 );
1411
1412 =head2 reviews
1413
1414 Type: has_many
1415
1416 Related object: L<Koha::Schema::Result::Review>
1417
1418 =cut
1419
1420 __PACKAGE__->has_many(
1421   "reviews",
1422   "Koha::Schema::Result::Review",
1423   { "foreign.borrowernumber" => "self.borrowernumber" },
1424   { cascade_copy => 0, cascade_delete => 0 },
1425 );
1426
1427 =head2 sms_provider
1428
1429 Type: belongs_to
1430
1431 Related object: L<Koha::Schema::Result::SmsProvider>
1432
1433 =cut
1434
1435 __PACKAGE__->belongs_to(
1436   "sms_provider",
1437   "Koha::Schema::Result::SmsProvider",
1438   { id => "sms_provider_id" },
1439   {
1440     is_deferrable => 1,
1441     join_type     => "LEFT",
1442     on_delete     => "SET NULL",
1443     on_update     => "CASCADE",
1444   },
1445 );
1446
1447 =head2 subscriptionroutinglists
1448
1449 Type: has_many
1450
1451 Related object: L<Koha::Schema::Result::Subscriptionroutinglist>
1452
1453 =cut
1454
1455 __PACKAGE__->has_many(
1456   "subscriptionroutinglists",
1457   "Koha::Schema::Result::Subscriptionroutinglist",
1458   { "foreign.borrowernumber" => "self.borrowernumber" },
1459   { cascade_copy => 0, cascade_delete => 0 },
1460 );
1461
1462 =head2 suggestions_acceptedbies
1463
1464 Type: has_many
1465
1466 Related object: L<Koha::Schema::Result::Suggestion>
1467
1468 =cut
1469
1470 __PACKAGE__->has_many(
1471   "suggestions_acceptedbies",
1472   "Koha::Schema::Result::Suggestion",
1473   { "foreign.acceptedby" => "self.borrowernumber" },
1474   { cascade_copy => 0, cascade_delete => 0 },
1475 );
1476
1477 =head2 suggestions_managedbies
1478
1479 Type: has_many
1480
1481 Related object: L<Koha::Schema::Result::Suggestion>
1482
1483 =cut
1484
1485 __PACKAGE__->has_many(
1486   "suggestions_managedbies",
1487   "Koha::Schema::Result::Suggestion",
1488   { "foreign.managedby" => "self.borrowernumber" },
1489   { cascade_copy => 0, cascade_delete => 0 },
1490 );
1491
1492 =head2 suggestions_rejectedbies
1493
1494 Type: has_many
1495
1496 Related object: L<Koha::Schema::Result::Suggestion>
1497
1498 =cut
1499
1500 __PACKAGE__->has_many(
1501   "suggestions_rejectedbies",
1502   "Koha::Schema::Result::Suggestion",
1503   { "foreign.rejectedby" => "self.borrowernumber" },
1504   { cascade_copy => 0, cascade_delete => 0 },
1505 );
1506
1507 =head2 suggestions_suggestedbies
1508
1509 Type: has_many
1510
1511 Related object: L<Koha::Schema::Result::Suggestion>
1512
1513 =cut
1514
1515 __PACKAGE__->has_many(
1516   "suggestions_suggestedbies",
1517   "Koha::Schema::Result::Suggestion",
1518   { "foreign.suggestedby" => "self.borrowernumber" },
1519   { cascade_copy => 0, cascade_delete => 0 },
1520 );
1521
1522 =head2 tags_all
1523
1524 Type: has_many
1525
1526 Related object: L<Koha::Schema::Result::TagAll>
1527
1528 =cut
1529
1530 __PACKAGE__->has_many(
1531   "tags_all",
1532   "Koha::Schema::Result::TagAll",
1533   { "foreign.borrowernumber" => "self.borrowernumber" },
1534   { cascade_copy => 0, cascade_delete => 0 },
1535 );
1536
1537 =head2 tags_approvals
1538
1539 Type: has_many
1540
1541 Related object: L<Koha::Schema::Result::TagsApproval>
1542
1543 =cut
1544
1545 __PACKAGE__->has_many(
1546   "tags_approvals",
1547   "Koha::Schema::Result::TagsApproval",
1548   { "foreign.approved_by" => "self.borrowernumber" },
1549   { cascade_copy => 0, cascade_delete => 0 },
1550 );
1551
1552 =head2 user_permissions
1553
1554 Type: has_many
1555
1556 Related object: L<Koha::Schema::Result::UserPermission>
1557
1558 =cut
1559
1560 __PACKAGE__->has_many(
1561   "user_permissions",
1562   "Koha::Schema::Result::UserPermission",
1563   { "foreign.borrowernumber" => "self.borrowernumber" },
1564   { cascade_copy => 0, cascade_delete => 0 },
1565 );
1566
1567 =head2 virtualshelfcontents
1568
1569 Type: has_many
1570
1571 Related object: L<Koha::Schema::Result::Virtualshelfcontent>
1572
1573 =cut
1574
1575 __PACKAGE__->has_many(
1576   "virtualshelfcontents",
1577   "Koha::Schema::Result::Virtualshelfcontent",
1578   { "foreign.borrowernumber" => "self.borrowernumber" },
1579   { cascade_copy => 0, cascade_delete => 0 },
1580 );
1581
1582 =head2 virtualshelfshares
1583
1584 Type: has_many
1585
1586 Related object: L<Koha::Schema::Result::Virtualshelfshare>
1587
1588 =cut
1589
1590 __PACKAGE__->has_many(
1591   "virtualshelfshares",
1592   "Koha::Schema::Result::Virtualshelfshare",
1593   { "foreign.borrowernumber" => "self.borrowernumber" },
1594   { cascade_copy => 0, cascade_delete => 0 },
1595 );
1596
1597 =head2 virtualshelves
1598
1599 Type: has_many
1600
1601 Related object: L<Koha::Schema::Result::Virtualshelve>
1602
1603 =cut
1604
1605 __PACKAGE__->has_many(
1606   "virtualshelves",
1607   "Koha::Schema::Result::Virtualshelve",
1608   { "foreign.owner" => "self.borrowernumber" },
1609   { cascade_copy => 0, cascade_delete => 0 },
1610 );
1611
1612 =head2 basketnoes
1613
1614 Type: many_to_many
1615
1616 Composing rels: L</aqbasketusers> -> basketno
1617
1618 =cut
1619
1620 __PACKAGE__->many_to_many("basketnoes", "aqbasketusers", "basketno");
1621
1622 =head2 budgets
1623
1624 Type: many_to_many
1625
1626 Composing rels: L</aqbudgetborrowers> -> budget
1627
1628 =cut
1629
1630 __PACKAGE__->many_to_many("budgets", "aqbudgetborrowers", "budget");
1631
1632 =head2 courses
1633
1634 Type: many_to_many
1635
1636 Composing rels: L</course_instructors> -> course
1637
1638 =cut
1639
1640 __PACKAGE__->many_to_many("courses", "course_instructors", "course");
1641
1642 =head2 ordernumbers
1643
1644 Type: many_to_many
1645
1646 Composing rels: L</aqorder_users> -> ordernumber
1647
1648 =cut
1649
1650 __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber");
1651
1652
1653 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-03-03 16:19:12
1654 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+f1QrESEOMGM1coANPgWtQ
1655
1656 __PACKAGE__->add_columns(
1657     '+anonymized'    => { is_boolean => 1 },
1658     '+lost'          => { is_boolean => 1 },
1659     '+gonenoaddress' => { is_boolean => 1 },
1660     '+privacy_guarantor_fines' => { is_boolean => 1 }
1661 );
1662
1663 sub koha_objects_class {
1664     'Koha::Patrons';
1665 }
1666 sub koha_object_class {
1667     'Koha::Patron';
1668 }
1669
1670 1;