04ad9e17d42629425382cb377f4806dc3272bc49
[koha-ffzg.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 =head2 autorenew_checkouts
462
463   data_type: 'tinyint'
464   default_value: 1
465   is_nullable: 0
466
467 =cut
468
469 __PACKAGE__->add_columns(
470   "borrowernumber",
471   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
472   "cardnumber",
473   { data_type => "varchar", is_nullable => 1, size => 32 },
474   "surname",
475   { data_type => "longtext", is_nullable => 1 },
476   "firstname",
477   { data_type => "mediumtext", is_nullable => 1 },
478   "title",
479   { data_type => "longtext", is_nullable => 1 },
480   "othernames",
481   { data_type => "longtext", is_nullable => 1 },
482   "initials",
483   { data_type => "mediumtext", is_nullable => 1 },
484   "streetnumber",
485   { data_type => "varchar", is_nullable => 1, size => 10 },
486   "streettype",
487   { data_type => "varchar", is_nullable => 1, size => 50 },
488   "address",
489   { data_type => "longtext", is_nullable => 1 },
490   "address2",
491   { data_type => "mediumtext", is_nullable => 1 },
492   "city",
493   { data_type => "longtext", is_nullable => 1 },
494   "state",
495   { data_type => "mediumtext", is_nullable => 1 },
496   "zipcode",
497   { data_type => "varchar", is_nullable => 1, size => 25 },
498   "country",
499   { data_type => "mediumtext", is_nullable => 1 },
500   "email",
501   { data_type => "longtext", is_nullable => 1 },
502   "phone",
503   { data_type => "mediumtext", is_nullable => 1 },
504   "mobile",
505   { data_type => "varchar", is_nullable => 1, size => 50 },
506   "fax",
507   { data_type => "longtext", is_nullable => 1 },
508   "emailpro",
509   { data_type => "mediumtext", is_nullable => 1 },
510   "phonepro",
511   { data_type => "mediumtext", is_nullable => 1 },
512   "B_streetnumber",
513   {
514     accessor => "b_streetnumber",
515     data_type => "varchar",
516     is_nullable => 1,
517     size => 10,
518   },
519   "B_streettype",
520   {
521     accessor => "b_streettype",
522     data_type => "varchar",
523     is_nullable => 1,
524     size => 50,
525   },
526   "B_address",
527   {
528     accessor => "b_address",
529     data_type => "varchar",
530     is_nullable => 1,
531     size => 100,
532   },
533   "B_address2",
534   { accessor => "b_address2", data_type => "mediumtext", is_nullable => 1 },
535   "B_city",
536   { accessor => "b_city", data_type => "longtext", is_nullable => 1 },
537   "B_state",
538   { accessor => "b_state", data_type => "mediumtext", is_nullable => 1 },
539   "B_zipcode",
540   {
541     accessor => "b_zipcode",
542     data_type => "varchar",
543     is_nullable => 1,
544     size => 25,
545   },
546   "B_country",
547   { accessor => "b_country", data_type => "mediumtext", is_nullable => 1 },
548   "B_email",
549   { accessor => "b_email", data_type => "mediumtext", is_nullable => 1 },
550   "B_phone",
551   { accessor => "b_phone", data_type => "longtext", is_nullable => 1 },
552   "dateofbirth",
553   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
554   "branchcode",
555   {
556     data_type => "varchar",
557     default_value => "",
558     is_foreign_key => 1,
559     is_nullable => 0,
560     size => 10,
561   },
562   "categorycode",
563   {
564     data_type => "varchar",
565     default_value => "",
566     is_foreign_key => 1,
567     is_nullable => 0,
568     size => 10,
569   },
570   "dateenrolled",
571   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
572   "dateexpiry",
573   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
574   "date_renewed",
575   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
576   "gonenoaddress",
577   { data_type => "tinyint", is_nullable => 1 },
578   "lost",
579   { data_type => "tinyint", is_nullable => 1 },
580   "debarred",
581   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
582   "debarredcomment",
583   { data_type => "varchar", is_nullable => 1, size => 255 },
584   "contactname",
585   { data_type => "longtext", is_nullable => 1 },
586   "contactfirstname",
587   { data_type => "mediumtext", is_nullable => 1 },
588   "contacttitle",
589   { data_type => "mediumtext", is_nullable => 1 },
590   "borrowernotes",
591   { data_type => "longtext", is_nullable => 1 },
592   "relationship",
593   { data_type => "varchar", is_nullable => 1, size => 100 },
594   "sex",
595   { data_type => "varchar", is_nullable => 1, size => 1 },
596   "password",
597   { data_type => "varchar", is_nullable => 1, size => 60 },
598   "flags",
599   { data_type => "integer", is_nullable => 1 },
600   "userid",
601   { data_type => "varchar", is_nullable => 1, size => 75 },
602   "opacnote",
603   { data_type => "longtext", is_nullable => 1 },
604   "contactnote",
605   { data_type => "varchar", is_nullable => 1, size => 255 },
606   "sort1",
607   { data_type => "varchar", is_nullable => 1, size => 80 },
608   "sort2",
609   { data_type => "varchar", is_nullable => 1, size => 80 },
610   "altcontactfirstname",
611   { data_type => "varchar", is_nullable => 1, size => 255 },
612   "altcontactsurname",
613   { data_type => "varchar", is_nullable => 1, size => 255 },
614   "altcontactaddress1",
615   { data_type => "varchar", is_nullable => 1, size => 255 },
616   "altcontactaddress2",
617   { data_type => "varchar", is_nullable => 1, size => 255 },
618   "altcontactaddress3",
619   { data_type => "varchar", is_nullable => 1, size => 255 },
620   "altcontactstate",
621   { data_type => "mediumtext", is_nullable => 1 },
622   "altcontactzipcode",
623   { data_type => "varchar", is_nullable => 1, size => 50 },
624   "altcontactcountry",
625   { data_type => "mediumtext", is_nullable => 1 },
626   "altcontactphone",
627   { data_type => "varchar", is_nullable => 1, size => 50 },
628   "smsalertnumber",
629   { data_type => "varchar", is_nullable => 1, size => 50 },
630   "sms_provider_id",
631   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
632   "privacy",
633   { data_type => "integer", default_value => 1, is_nullable => 0 },
634   "privacy_guarantor_fines",
635   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
636   "privacy_guarantor_checkouts",
637   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
638   "checkprevcheckout",
639   {
640     data_type => "varchar",
641     default_value => "inherit",
642     is_nullable => 0,
643     size => 7,
644   },
645   "updated_on",
646   {
647     data_type => "timestamp",
648     datetime_undef_if_invalid => 1,
649     default_value => "current_timestamp()",
650     is_nullable => 0,
651   },
652   "lastseen",
653   {
654     data_type => "datetime",
655     datetime_undef_if_invalid => 1,
656     is_nullable => 1,
657   },
658   "lang",
659   {
660     data_type => "varchar",
661     default_value => "default",
662     is_nullable => 0,
663     size => 25,
664   },
665   "login_attempts",
666   { data_type => "integer", default_value => 0, is_nullable => 1 },
667   "overdrive_auth_token",
668   { data_type => "mediumtext", is_nullable => 1 },
669   "anonymized",
670   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
671   "autorenew_checkouts",
672   { data_type => "tinyint", default_value => 1, is_nullable => 0 },
673 );
674
675 =head1 PRIMARY KEY
676
677 =over 4
678
679 =item * L</borrowernumber>
680
681 =back
682
683 =cut
684
685 __PACKAGE__->set_primary_key("borrowernumber");
686
687 =head1 UNIQUE CONSTRAINTS
688
689 =head2 C<cardnumber>
690
691 =over 4
692
693 =item * L</cardnumber>
694
695 =back
696
697 =cut
698
699 __PACKAGE__->add_unique_constraint("cardnumber", ["cardnumber"]);
700
701 =head2 C<userid>
702
703 =over 4
704
705 =item * L</userid>
706
707 =back
708
709 =cut
710
711 __PACKAGE__->add_unique_constraint("userid", ["userid"]);
712
713 =head1 RELATIONS
714
715 =head2 accountlines
716
717 Type: has_many
718
719 Related object: L<Koha::Schema::Result::Accountline>
720
721 =cut
722
723 __PACKAGE__->has_many(
724   "accountlines",
725   "Koha::Schema::Result::Accountline",
726   { "foreign.borrowernumber" => "self.borrowernumber" },
727   { cascade_copy => 0, cascade_delete => 0 },
728 );
729
730 =head2 accountlines_managers
731
732 Type: has_many
733
734 Related object: L<Koha::Schema::Result::Accountline>
735
736 =cut
737
738 __PACKAGE__->has_many(
739   "accountlines_managers",
740   "Koha::Schema::Result::Accountline",
741   { "foreign.manager_id" => "self.borrowernumber" },
742   { cascade_copy => 0, cascade_delete => 0 },
743 );
744
745 =head2 api_keys
746
747 Type: has_many
748
749 Related object: L<Koha::Schema::Result::ApiKey>
750
751 =cut
752
753 __PACKAGE__->has_many(
754   "api_keys",
755   "Koha::Schema::Result::ApiKey",
756   { "foreign.patron_id" => "self.borrowernumber" },
757   { cascade_copy => 0, cascade_delete => 0 },
758 );
759
760 =head2 aqbasketusers
761
762 Type: has_many
763
764 Related object: L<Koha::Schema::Result::Aqbasketuser>
765
766 =cut
767
768 __PACKAGE__->has_many(
769   "aqbasketusers",
770   "Koha::Schema::Result::Aqbasketuser",
771   { "foreign.borrowernumber" => "self.borrowernumber" },
772   { cascade_copy => 0, cascade_delete => 0 },
773 );
774
775 =head2 aqbudgetborrowers
776
777 Type: has_many
778
779 Related object: L<Koha::Schema::Result::Aqbudgetborrower>
780
781 =cut
782
783 __PACKAGE__->has_many(
784   "aqbudgetborrowers",
785   "Koha::Schema::Result::Aqbudgetborrower",
786   { "foreign.borrowernumber" => "self.borrowernumber" },
787   { cascade_copy => 0, cascade_delete => 0 },
788 );
789
790 =head2 aqorder_users
791
792 Type: has_many
793
794 Related object: L<Koha::Schema::Result::AqorderUser>
795
796 =cut
797
798 __PACKAGE__->has_many(
799   "aqorder_users",
800   "Koha::Schema::Result::AqorderUser",
801   { "foreign.borrowernumber" => "self.borrowernumber" },
802   { cascade_copy => 0, cascade_delete => 0 },
803 );
804
805 =head2 aqorders
806
807 Type: has_many
808
809 Related object: L<Koha::Schema::Result::Aqorder>
810
811 =cut
812
813 __PACKAGE__->has_many(
814   "aqorders",
815   "Koha::Schema::Result::Aqorder",
816   { "foreign.created_by" => "self.borrowernumber" },
817   { cascade_copy => 0, cascade_delete => 0 },
818 );
819
820 =head2 article_requests
821
822 Type: has_many
823
824 Related object: L<Koha::Schema::Result::ArticleRequest>
825
826 =cut
827
828 __PACKAGE__->has_many(
829   "article_requests",
830   "Koha::Schema::Result::ArticleRequest",
831   { "foreign.borrowernumber" => "self.borrowernumber" },
832   { cascade_copy => 0, cascade_delete => 0 },
833 );
834
835 =head2 borrower_attributes
836
837 Type: has_many
838
839 Related object: L<Koha::Schema::Result::BorrowerAttribute>
840
841 =cut
842
843 __PACKAGE__->has_many(
844   "borrower_attributes",
845   "Koha::Schema::Result::BorrowerAttribute",
846   { "foreign.borrowernumber" => "self.borrowernumber" },
847   { cascade_copy => 0, cascade_delete => 0 },
848 );
849
850 =head2 borrower_debarments
851
852 Type: has_many
853
854 Related object: L<Koha::Schema::Result::BorrowerDebarment>
855
856 =cut
857
858 __PACKAGE__->has_many(
859   "borrower_debarments",
860   "Koha::Schema::Result::BorrowerDebarment",
861   { "foreign.borrowernumber" => "self.borrowernumber" },
862   { cascade_copy => 0, cascade_delete => 0 },
863 );
864
865 =head2 borrower_files
866
867 Type: has_many
868
869 Related object: L<Koha::Schema::Result::BorrowerFile>
870
871 =cut
872
873 __PACKAGE__->has_many(
874   "borrower_files",
875   "Koha::Schema::Result::BorrowerFile",
876   { "foreign.borrowernumber" => "self.borrowernumber" },
877   { cascade_copy => 0, cascade_delete => 0 },
878 );
879
880 =head2 borrower_message_preferences
881
882 Type: has_many
883
884 Related object: L<Koha::Schema::Result::BorrowerMessagePreference>
885
886 =cut
887
888 __PACKAGE__->has_many(
889   "borrower_message_preferences",
890   "Koha::Schema::Result::BorrowerMessagePreference",
891   { "foreign.borrowernumber" => "self.borrowernumber" },
892   { cascade_copy => 0, cascade_delete => 0 },
893 );
894
895 =head2 borrower_relationships_guarantees
896
897 Type: has_many
898
899 Related object: L<Koha::Schema::Result::BorrowerRelationship>
900
901 =cut
902
903 __PACKAGE__->has_many(
904   "borrower_relationships_guarantees",
905   "Koha::Schema::Result::BorrowerRelationship",
906   { "foreign.guarantee_id" => "self.borrowernumber" },
907   { cascade_copy => 0, cascade_delete => 0 },
908 );
909
910 =head2 borrower_relationships_guarantors
911
912 Type: has_many
913
914 Related object: L<Koha::Schema::Result::BorrowerRelationship>
915
916 =cut
917
918 __PACKAGE__->has_many(
919   "borrower_relationships_guarantors",
920   "Koha::Schema::Result::BorrowerRelationship",
921   { "foreign.guarantor_id" => "self.borrowernumber" },
922   { cascade_copy => 0, cascade_delete => 0 },
923 );
924
925 =head2 branchcode
926
927 Type: belongs_to
928
929 Related object: L<Koha::Schema::Result::Branch>
930
931 =cut
932
933 __PACKAGE__->belongs_to(
934   "branchcode",
935   "Koha::Schema::Result::Branch",
936   { branchcode => "branchcode" },
937   { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" },
938 );
939
940 =head2 cash_register_actions
941
942 Type: has_many
943
944 Related object: L<Koha::Schema::Result::CashRegisterAction>
945
946 =cut
947
948 __PACKAGE__->has_many(
949   "cash_register_actions",
950   "Koha::Schema::Result::CashRegisterAction",
951   { "foreign.manager_id" => "self.borrowernumber" },
952   { cascade_copy => 0, cascade_delete => 0 },
953 );
954
955 =head2 categorycode
956
957 Type: belongs_to
958
959 Related object: L<Koha::Schema::Result::Category>
960
961 =cut
962
963 __PACKAGE__->belongs_to(
964   "categorycode",
965   "Koha::Schema::Result::Category",
966   { categorycode => "categorycode" },
967   { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" },
968 );
969
970 =head2 club_enrollments
971
972 Type: has_many
973
974 Related object: L<Koha::Schema::Result::ClubEnrollment>
975
976 =cut
977
978 __PACKAGE__->has_many(
979   "club_enrollments",
980   "Koha::Schema::Result::ClubEnrollment",
981   { "foreign.borrowernumber" => "self.borrowernumber" },
982   { cascade_copy => 0, cascade_delete => 0 },
983 );
984
985 =head2 club_holds_to_patron_holds
986
987 Type: has_many
988
989 Related object: L<Koha::Schema::Result::ClubHoldsToPatronHold>
990
991 =cut
992
993 __PACKAGE__->has_many(
994   "club_holds_to_patron_holds",
995   "Koha::Schema::Result::ClubHoldsToPatronHold",
996   { "foreign.patron_id" => "self.borrowernumber" },
997   { cascade_copy => 0, cascade_delete => 0 },
998 );
999
1000 =head2 course_instructors
1001
1002 Type: has_many
1003
1004 Related object: L<Koha::Schema::Result::CourseInstructor>
1005
1006 =cut
1007
1008 __PACKAGE__->has_many(
1009   "course_instructors",
1010   "Koha::Schema::Result::CourseInstructor",
1011   { "foreign.borrowernumber" => "self.borrowernumber" },
1012   { cascade_copy => 0, cascade_delete => 0 },
1013 );
1014
1015 =head2 creator_batches
1016
1017 Type: has_many
1018
1019 Related object: L<Koha::Schema::Result::CreatorBatch>
1020
1021 =cut
1022
1023 __PACKAGE__->has_many(
1024   "creator_batches",
1025   "Koha::Schema::Result::CreatorBatch",
1026   { "foreign.borrower_number" => "self.borrowernumber" },
1027   { cascade_copy => 0, cascade_delete => 0 },
1028 );
1029
1030 =head2 discharges
1031
1032 Type: has_many
1033
1034 Related object: L<Koha::Schema::Result::Discharge>
1035
1036 =cut
1037
1038 __PACKAGE__->has_many(
1039   "discharges",
1040   "Koha::Schema::Result::Discharge",
1041   { "foreign.borrower" => "self.borrowernumber" },
1042   { cascade_copy => 0, cascade_delete => 0 },
1043 );
1044
1045 =head2 hold_fill_targets
1046
1047 Type: has_many
1048
1049 Related object: L<Koha::Schema::Result::HoldFillTarget>
1050
1051 =cut
1052
1053 __PACKAGE__->has_many(
1054   "hold_fill_targets",
1055   "Koha::Schema::Result::HoldFillTarget",
1056   { "foreign.borrowernumber" => "self.borrowernumber" },
1057   { cascade_copy => 0, cascade_delete => 0 },
1058 );
1059
1060 =head2 housebound_profile
1061
1062 Type: might_have
1063
1064 Related object: L<Koha::Schema::Result::HouseboundProfile>
1065
1066 =cut
1067
1068 __PACKAGE__->might_have(
1069   "housebound_profile",
1070   "Koha::Schema::Result::HouseboundProfile",
1071   { "foreign.borrowernumber" => "self.borrowernumber" },
1072   { cascade_copy => 0, cascade_delete => 0 },
1073 );
1074
1075 =head2 housebound_role
1076
1077 Type: might_have
1078
1079 Related object: L<Koha::Schema::Result::HouseboundRole>
1080
1081 =cut
1082
1083 __PACKAGE__->might_have(
1084   "housebound_role",
1085   "Koha::Schema::Result::HouseboundRole",
1086   { "foreign.borrowernumber_id" => "self.borrowernumber" },
1087   { cascade_copy => 0, cascade_delete => 0 },
1088 );
1089
1090 =head2 housebound_visit_chooser_brwnumbers
1091
1092 Type: has_many
1093
1094 Related object: L<Koha::Schema::Result::HouseboundVisit>
1095
1096 =cut
1097
1098 __PACKAGE__->has_many(
1099   "housebound_visit_chooser_brwnumbers",
1100   "Koha::Schema::Result::HouseboundVisit",
1101   { "foreign.chooser_brwnumber" => "self.borrowernumber" },
1102   { cascade_copy => 0, cascade_delete => 0 },
1103 );
1104
1105 =head2 housebound_visit_deliverer_brwnumbers
1106
1107 Type: has_many
1108
1109 Related object: L<Koha::Schema::Result::HouseboundVisit>
1110
1111 =cut
1112
1113 __PACKAGE__->has_many(
1114   "housebound_visit_deliverer_brwnumbers",
1115   "Koha::Schema::Result::HouseboundVisit",
1116   { "foreign.deliverer_brwnumber" => "self.borrowernumber" },
1117   { cascade_copy => 0, cascade_delete => 0 },
1118 );
1119
1120 =head2 illcomments
1121
1122 Type: has_many
1123
1124 Related object: L<Koha::Schema::Result::Illcomment>
1125
1126 =cut
1127
1128 __PACKAGE__->has_many(
1129   "illcomments",
1130   "Koha::Schema::Result::Illcomment",
1131   { "foreign.borrowernumber" => "self.borrowernumber" },
1132   { cascade_copy => 0, cascade_delete => 0 },
1133 );
1134
1135 =head2 illrequests
1136
1137 Type: has_many
1138
1139 Related object: L<Koha::Schema::Result::Illrequest>
1140
1141 =cut
1142
1143 __PACKAGE__->has_many(
1144   "illrequests",
1145   "Koha::Schema::Result::Illrequest",
1146   { "foreign.borrowernumber" => "self.borrowernumber" },
1147   { cascade_copy => 0, cascade_delete => 0 },
1148 );
1149
1150 =head2 issues
1151
1152 Type: has_many
1153
1154 Related object: L<Koha::Schema::Result::Issue>
1155
1156 =cut
1157
1158 __PACKAGE__->has_many(
1159   "issues",
1160   "Koha::Schema::Result::Issue",
1161   { "foreign.borrowernumber" => "self.borrowernumber" },
1162   { cascade_copy => 0, cascade_delete => 0 },
1163 );
1164
1165 =head2 items_last_borrowers
1166
1167 Type: has_many
1168
1169 Related object: L<Koha::Schema::Result::ItemsLastBorrower>
1170
1171 =cut
1172
1173 __PACKAGE__->has_many(
1174   "items_last_borrowers",
1175   "Koha::Schema::Result::ItemsLastBorrower",
1176   { "foreign.borrowernumber" => "self.borrowernumber" },
1177   { cascade_copy => 0, cascade_delete => 0 },
1178 );
1179
1180 =head2 message_queues
1181
1182 Type: has_many
1183
1184 Related object: L<Koha::Schema::Result::MessageQueue>
1185
1186 =cut
1187
1188 __PACKAGE__->has_many(
1189   "message_queues",
1190   "Koha::Schema::Result::MessageQueue",
1191   { "foreign.borrowernumber" => "self.borrowernumber" },
1192   { cascade_copy => 0, cascade_delete => 0 },
1193 );
1194
1195 =head2 messages
1196
1197 Type: has_many
1198
1199 Related object: L<Koha::Schema::Result::Message>
1200
1201 =cut
1202
1203 __PACKAGE__->has_many(
1204   "messages",
1205   "Koha::Schema::Result::Message",
1206   { "foreign.manager_id" => "self.borrowernumber" },
1207   { cascade_copy => 0, cascade_delete => 0 },
1208 );
1209
1210 =head2 messages_borrowernumbers
1211
1212 Type: has_many
1213
1214 Related object: L<Koha::Schema::Result::Message>
1215
1216 =cut
1217
1218 __PACKAGE__->has_many(
1219   "messages_borrowernumbers",
1220   "Koha::Schema::Result::Message",
1221   { "foreign.borrowernumber" => "self.borrowernumber" },
1222   { cascade_copy => 0, cascade_delete => 0 },
1223 );
1224
1225 =head2 old_issues
1226
1227 Type: has_many
1228
1229 Related object: L<Koha::Schema::Result::OldIssue>
1230
1231 =cut
1232
1233 __PACKAGE__->has_many(
1234   "old_issues",
1235   "Koha::Schema::Result::OldIssue",
1236   { "foreign.borrowernumber" => "self.borrowernumber" },
1237   { cascade_copy => 0, cascade_delete => 0 },
1238 );
1239
1240 =head2 old_reserves
1241
1242 Type: has_many
1243
1244 Related object: L<Koha::Schema::Result::OldReserve>
1245
1246 =cut
1247
1248 __PACKAGE__->has_many(
1249   "old_reserves",
1250   "Koha::Schema::Result::OldReserve",
1251   { "foreign.borrowernumber" => "self.borrowernumber" },
1252   { cascade_copy => 0, cascade_delete => 0 },
1253 );
1254
1255 =head2 opac_news
1256
1257 Type: has_many
1258
1259 Related object: L<Koha::Schema::Result::OpacNews>
1260
1261 =cut
1262
1263 __PACKAGE__->has_many(
1264   "opac_news",
1265   "Koha::Schema::Result::OpacNews",
1266   { "foreign.borrowernumber" => "self.borrowernumber" },
1267   { cascade_copy => 0, cascade_delete => 0 },
1268 );
1269
1270 =head2 patron_consents
1271
1272 Type: has_many
1273
1274 Related object: L<Koha::Schema::Result::PatronConsent>
1275
1276 =cut
1277
1278 __PACKAGE__->has_many(
1279   "patron_consents",
1280   "Koha::Schema::Result::PatronConsent",
1281   { "foreign.borrowernumber" => "self.borrowernumber" },
1282   { cascade_copy => 0, cascade_delete => 0 },
1283 );
1284
1285 =head2 patron_list_patrons
1286
1287 Type: has_many
1288
1289 Related object: L<Koha::Schema::Result::PatronListPatron>
1290
1291 =cut
1292
1293 __PACKAGE__->has_many(
1294   "patron_list_patrons",
1295   "Koha::Schema::Result::PatronListPatron",
1296   { "foreign.borrowernumber" => "self.borrowernumber" },
1297   { cascade_copy => 0, cascade_delete => 0 },
1298 );
1299
1300 =head2 patron_lists
1301
1302 Type: has_many
1303
1304 Related object: L<Koha::Schema::Result::PatronList>
1305
1306 =cut
1307
1308 __PACKAGE__->has_many(
1309   "patron_lists",
1310   "Koha::Schema::Result::PatronList",
1311   { "foreign.owner" => "self.borrowernumber" },
1312   { cascade_copy => 0, cascade_delete => 0 },
1313 );
1314
1315 =head2 patronimage
1316
1317 Type: might_have
1318
1319 Related object: L<Koha::Schema::Result::Patronimage>
1320
1321 =cut
1322
1323 __PACKAGE__->might_have(
1324   "patronimage",
1325   "Koha::Schema::Result::Patronimage",
1326   { "foreign.borrowernumber" => "self.borrowernumber" },
1327   { cascade_copy => 0, cascade_delete => 0 },
1328 );
1329
1330 =head2 ratings
1331
1332 Type: has_many
1333
1334 Related object: L<Koha::Schema::Result::Rating>
1335
1336 =cut
1337
1338 __PACKAGE__->has_many(
1339   "ratings",
1340   "Koha::Schema::Result::Rating",
1341   { "foreign.borrowernumber" => "self.borrowernumber" },
1342   { cascade_copy => 0, cascade_delete => 0 },
1343 );
1344
1345 =head2 reserves
1346
1347 Type: has_many
1348
1349 Related object: L<Koha::Schema::Result::Reserve>
1350
1351 =cut
1352
1353 __PACKAGE__->has_many(
1354   "reserves",
1355   "Koha::Schema::Result::Reserve",
1356   { "foreign.borrowernumber" => "self.borrowernumber" },
1357   { cascade_copy => 0, cascade_delete => 0 },
1358 );
1359
1360 =head2 return_claims_borrowernumbers
1361
1362 Type: has_many
1363
1364 Related object: L<Koha::Schema::Result::ReturnClaim>
1365
1366 =cut
1367
1368 __PACKAGE__->has_many(
1369   "return_claims_borrowernumbers",
1370   "Koha::Schema::Result::ReturnClaim",
1371   { "foreign.borrowernumber" => "self.borrowernumber" },
1372   { cascade_copy => 0, cascade_delete => 0 },
1373 );
1374
1375 =head2 return_claims_created_by
1376
1377 Type: has_many
1378
1379 Related object: L<Koha::Schema::Result::ReturnClaim>
1380
1381 =cut
1382
1383 __PACKAGE__->has_many(
1384   "return_claims_created_by",
1385   "Koha::Schema::Result::ReturnClaim",
1386   { "foreign.created_by" => "self.borrowernumber" },
1387   { cascade_copy => 0, cascade_delete => 0 },
1388 );
1389
1390 =head2 return_claims_resolved_by
1391
1392 Type: has_many
1393
1394 Related object: L<Koha::Schema::Result::ReturnClaim>
1395
1396 =cut
1397
1398 __PACKAGE__->has_many(
1399   "return_claims_resolved_by",
1400   "Koha::Schema::Result::ReturnClaim",
1401   { "foreign.resolved_by" => "self.borrowernumber" },
1402   { cascade_copy => 0, cascade_delete => 0 },
1403 );
1404
1405 =head2 return_claims_updated_by
1406
1407 Type: has_many
1408
1409 Related object: L<Koha::Schema::Result::ReturnClaim>
1410
1411 =cut
1412
1413 __PACKAGE__->has_many(
1414   "return_claims_updated_by",
1415   "Koha::Schema::Result::ReturnClaim",
1416   { "foreign.updated_by" => "self.borrowernumber" },
1417   { cascade_copy => 0, cascade_delete => 0 },
1418 );
1419
1420 =head2 reviews
1421
1422 Type: has_many
1423
1424 Related object: L<Koha::Schema::Result::Review>
1425
1426 =cut
1427
1428 __PACKAGE__->has_many(
1429   "reviews",
1430   "Koha::Schema::Result::Review",
1431   { "foreign.borrowernumber" => "self.borrowernumber" },
1432   { cascade_copy => 0, cascade_delete => 0 },
1433 );
1434
1435 =head2 sms_provider
1436
1437 Type: belongs_to
1438
1439 Related object: L<Koha::Schema::Result::SmsProvider>
1440
1441 =cut
1442
1443 __PACKAGE__->belongs_to(
1444   "sms_provider",
1445   "Koha::Schema::Result::SmsProvider",
1446   { id => "sms_provider_id" },
1447   {
1448     is_deferrable => 1,
1449     join_type     => "LEFT",
1450     on_delete     => "SET NULL",
1451     on_update     => "CASCADE",
1452   },
1453 );
1454
1455 =head2 subscriptionroutinglists
1456
1457 Type: has_many
1458
1459 Related object: L<Koha::Schema::Result::Subscriptionroutinglist>
1460
1461 =cut
1462
1463 __PACKAGE__->has_many(
1464   "subscriptionroutinglists",
1465   "Koha::Schema::Result::Subscriptionroutinglist",
1466   { "foreign.borrowernumber" => "self.borrowernumber" },
1467   { cascade_copy => 0, cascade_delete => 0 },
1468 );
1469
1470 =head2 suggestions_acceptedbies
1471
1472 Type: has_many
1473
1474 Related object: L<Koha::Schema::Result::Suggestion>
1475
1476 =cut
1477
1478 __PACKAGE__->has_many(
1479   "suggestions_acceptedbies",
1480   "Koha::Schema::Result::Suggestion",
1481   { "foreign.acceptedby" => "self.borrowernumber" },
1482   { cascade_copy => 0, cascade_delete => 0 },
1483 );
1484
1485 =head2 suggestions_managedbies
1486
1487 Type: has_many
1488
1489 Related object: L<Koha::Schema::Result::Suggestion>
1490
1491 =cut
1492
1493 __PACKAGE__->has_many(
1494   "suggestions_managedbies",
1495   "Koha::Schema::Result::Suggestion",
1496   { "foreign.managedby" => "self.borrowernumber" },
1497   { cascade_copy => 0, cascade_delete => 0 },
1498 );
1499
1500 =head2 suggestions_rejectedbies
1501
1502 Type: has_many
1503
1504 Related object: L<Koha::Schema::Result::Suggestion>
1505
1506 =cut
1507
1508 __PACKAGE__->has_many(
1509   "suggestions_rejectedbies",
1510   "Koha::Schema::Result::Suggestion",
1511   { "foreign.rejectedby" => "self.borrowernumber" },
1512   { cascade_copy => 0, cascade_delete => 0 },
1513 );
1514
1515 =head2 suggestions_suggestedbies
1516
1517 Type: has_many
1518
1519 Related object: L<Koha::Schema::Result::Suggestion>
1520
1521 =cut
1522
1523 __PACKAGE__->has_many(
1524   "suggestions_suggestedbies",
1525   "Koha::Schema::Result::Suggestion",
1526   { "foreign.suggestedby" => "self.borrowernumber" },
1527   { cascade_copy => 0, cascade_delete => 0 },
1528 );
1529
1530 =head2 tags_all
1531
1532 Type: has_many
1533
1534 Related object: L<Koha::Schema::Result::TagAll>
1535
1536 =cut
1537
1538 __PACKAGE__->has_many(
1539   "tags_all",
1540   "Koha::Schema::Result::TagAll",
1541   { "foreign.borrowernumber" => "self.borrowernumber" },
1542   { cascade_copy => 0, cascade_delete => 0 },
1543 );
1544
1545 =head2 tags_approvals
1546
1547 Type: has_many
1548
1549 Related object: L<Koha::Schema::Result::TagsApproval>
1550
1551 =cut
1552
1553 __PACKAGE__->has_many(
1554   "tags_approvals",
1555   "Koha::Schema::Result::TagsApproval",
1556   { "foreign.approved_by" => "self.borrowernumber" },
1557   { cascade_copy => 0, cascade_delete => 0 },
1558 );
1559
1560 =head2 user_permissions
1561
1562 Type: has_many
1563
1564 Related object: L<Koha::Schema::Result::UserPermission>
1565
1566 =cut
1567
1568 __PACKAGE__->has_many(
1569   "user_permissions",
1570   "Koha::Schema::Result::UserPermission",
1571   { "foreign.borrowernumber" => "self.borrowernumber" },
1572   { cascade_copy => 0, cascade_delete => 0 },
1573 );
1574
1575 =head2 virtualshelfcontents
1576
1577 Type: has_many
1578
1579 Related object: L<Koha::Schema::Result::Virtualshelfcontent>
1580
1581 =cut
1582
1583 __PACKAGE__->has_many(
1584   "virtualshelfcontents",
1585   "Koha::Schema::Result::Virtualshelfcontent",
1586   { "foreign.borrowernumber" => "self.borrowernumber" },
1587   { cascade_copy => 0, cascade_delete => 0 },
1588 );
1589
1590 =head2 virtualshelfshares
1591
1592 Type: has_many
1593
1594 Related object: L<Koha::Schema::Result::Virtualshelfshare>
1595
1596 =cut
1597
1598 __PACKAGE__->has_many(
1599   "virtualshelfshares",
1600   "Koha::Schema::Result::Virtualshelfshare",
1601   { "foreign.borrowernumber" => "self.borrowernumber" },
1602   { cascade_copy => 0, cascade_delete => 0 },
1603 );
1604
1605 =head2 virtualshelves
1606
1607 Type: has_many
1608
1609 Related object: L<Koha::Schema::Result::Virtualshelve>
1610
1611 =cut
1612
1613 __PACKAGE__->has_many(
1614   "virtualshelves",
1615   "Koha::Schema::Result::Virtualshelve",
1616   { "foreign.owner" => "self.borrowernumber" },
1617   { cascade_copy => 0, cascade_delete => 0 },
1618 );
1619
1620 =head2 basketnoes
1621
1622 Type: many_to_many
1623
1624 Composing rels: L</aqbasketusers> -> basketno
1625
1626 =cut
1627
1628 __PACKAGE__->many_to_many("basketnoes", "aqbasketusers", "basketno");
1629
1630 =head2 budgets
1631
1632 Type: many_to_many
1633
1634 Composing rels: L</aqbudgetborrowers> -> budget
1635
1636 =cut
1637
1638 __PACKAGE__->many_to_many("budgets", "aqbudgetborrowers", "budget");
1639
1640 =head2 courses
1641
1642 Type: many_to_many
1643
1644 Composing rels: L</course_instructors> -> course
1645
1646 =cut
1647
1648 __PACKAGE__->many_to_many("courses", "course_instructors", "course");
1649
1650 =head2 ordernumbers
1651
1652 Type: many_to_many
1653
1654 Composing rels: L</aqorder_users> -> ordernumber
1655
1656 =cut
1657
1658 __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber");
1659
1660
1661 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-03-23 11:45:25
1662 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SkCqcE0Wpja6r/hZ0yZLNA
1663
1664 __PACKAGE__->add_columns(
1665     '+anonymized'    => { is_boolean => 1 },
1666     '+lost'          => { is_boolean => 1 },
1667     '+gonenoaddress' => { is_boolean => 1 },
1668     '+privacy_guarantor_fines' => { is_boolean => 1 }
1669 );
1670
1671 sub koha_objects_class {
1672     'Koha::Patrons';
1673 }
1674 sub koha_object_class {
1675     'Koha::Patron';
1676 }
1677
1678 1;