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