View | Details | Raw Unified | Return to bug 9303
Collapse All | Expand All

(-)a/Koha/Schema/Result/Borrower.pm (-84 / +30 lines)
Lines 1-21 Link Here
1
use utf8;
2
package Koha::Schema::Result::Borrower;
1
package Koha::Schema::Result::Borrower;
3
2
4
# Created by DBIx::Class::Schema::Loader
3
# Created by DBIx::Class::Schema::Loader
5
# DO NOT MODIFY THE FIRST PART OF THIS FILE
4
# DO NOT MODIFY THE FIRST PART OF THIS FILE
6
5
7
=head1 NAME
8
9
Koha::Schema::Result::Borrower
10
11
=cut
12
13
use strict;
6
use strict;
14
use warnings;
7
use warnings;
15
8
16
use base 'DBIx::Class::Core';
9
use base 'DBIx::Class::Core';
17
10
18
=head1 TABLE: C<borrowers>
11
12
=head1 NAME
13
14
Koha::Schema::Result::Borrower
19
15
20
=cut
16
=cut
21
17
Lines 191-197 __PACKAGE__->table("borrowers"); Link Here
191
=head2 dateofbirth
187
=head2 dateofbirth
192
188
193
  data_type: 'date'
189
  data_type: 'date'
194
  datetime_undef_if_invalid: 1
195
  is_nullable: 1
190
  is_nullable: 1
196
191
197
=head2 branchcode
192
=head2 branchcode
Lines 213-225 __PACKAGE__->table("borrowers"); Link Here
213
=head2 dateenrolled
208
=head2 dateenrolled
214
209
215
  data_type: 'date'
210
  data_type: 'date'
216
  datetime_undef_if_invalid: 1
217
  is_nullable: 1
211
  is_nullable: 1
218
212
219
=head2 dateexpiry
213
=head2 dateexpiry
220
214
221
  data_type: 'date'
215
  data_type: 'date'
222
  datetime_undef_if_invalid: 1
223
  is_nullable: 1
216
  is_nullable: 1
224
217
225
=head2 gonenoaddress
218
=head2 gonenoaddress
Lines 235-241 __PACKAGE__->table("borrowers"); Link Here
235
=head2 debarred
228
=head2 debarred
236
229
237
  data_type: 'date'
230
  data_type: 'date'
238
  datetime_undef_if_invalid: 1
239
  is_nullable: 1
231
  is_nullable: 1
240
232
241
=head2 debarredcomment
233
=head2 debarredcomment
Lines 397-402 __PACKAGE__->table("borrowers"); Link Here
397
  default_value: 1
389
  default_value: 1
398
  is_nullable: 0
390
  is_nullable: 0
399
391
392
=head2 privacy_relative_checkouts
393
394
  data_type: 'tinyint'
395
  default_value: 0
396
  is_nullable: 0
397
400
=cut
398
=cut
401
399
402
__PACKAGE__->add_columns(
400
__PACKAGE__->add_columns(
Lines 463-469 __PACKAGE__->add_columns( Link Here
463
  "b_phone",
461
  "b_phone",
464
  { data_type => "mediumtext", is_nullable => 1 },
462
  { data_type => "mediumtext", is_nullable => 1 },
465
  "dateofbirth",
463
  "dateofbirth",
466
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
464
  { data_type => "date", is_nullable => 1 },
467
  "branchcode",
465
  "branchcode",
468
  {
466
  {
469
    data_type => "varchar",
467
    data_type => "varchar",
Lines 481-495 __PACKAGE__->add_columns( Link Here
481
    size => 10,
479
    size => 10,
482
  },
480
  },
483
  "dateenrolled",
481
  "dateenrolled",
484
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
482
  { data_type => "date", is_nullable => 1 },
485
  "dateexpiry",
483
  "dateexpiry",
486
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
484
  { data_type => "date", is_nullable => 1 },
487
  "gonenoaddress",
485
  "gonenoaddress",
488
  { data_type => "tinyint", is_nullable => 1 },
486
  { data_type => "tinyint", is_nullable => 1 },
489
  "lost",
487
  "lost",
490
  { data_type => "tinyint", is_nullable => 1 },
488
  { data_type => "tinyint", is_nullable => 1 },
491
  "debarred",
489
  "debarred",
492
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
490
  { data_type => "date", is_nullable => 1 },
493
  "debarredcomment",
491
  "debarredcomment",
494
  { data_type => "varchar", is_nullable => 1, size => 255 },
492
  { data_type => "varchar", is_nullable => 1, size => 255 },
495
  "contactname",
493
  "contactname",
Lines 546-577 __PACKAGE__->add_columns( Link Here
546
  { data_type => "varchar", is_nullable => 1, size => 50 },
544
  { data_type => "varchar", is_nullable => 1, size => 50 },
547
  "privacy",
545
  "privacy",
548
  { data_type => "integer", default_value => 1, is_nullable => 0 },
546
  { data_type => "integer", default_value => 1, is_nullable => 0 },
547
  "privacy_relative_checkouts",
548
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
549
);
549
);
550
551
=head1 PRIMARY KEY
552
553
=over 4
554
555
=item * L</borrowernumber>
556
557
=back
558
559
=cut
560
561
__PACKAGE__->set_primary_key("borrowernumber");
550
__PACKAGE__->set_primary_key("borrowernumber");
562
563
=head1 UNIQUE CONSTRAINTS
564
565
=head2 C<cardnumber>
566
567
=over 4
568
569
=item * L</cardnumber>
570
571
=back
572
573
=cut
574
575
__PACKAGE__->add_unique_constraint("cardnumber", ["cardnumber"]);
551
__PACKAGE__->add_unique_constraint("cardnumber", ["cardnumber"]);
576
552
577
=head1 RELATIONS
553
=head1 RELATIONS
Lines 696-729 __PACKAGE__->has_many( Link Here
696
  { cascade_copy => 0, cascade_delete => 0 },
672
  { cascade_copy => 0, cascade_delete => 0 },
697
);
673
);
698
674
699
=head2 branchcode
675
=head2 categorycode
700
676
701
Type: belongs_to
677
Type: belongs_to
702
678
703
Related object: L<Koha::Schema::Result::Branch>
679
Related object: L<Koha::Schema::Result::Category>
704
680
705
=cut
681
=cut
706
682
707
__PACKAGE__->belongs_to(
683
__PACKAGE__->belongs_to(
708
  "branchcode",
684
  "categorycode",
709
  "Koha::Schema::Result::Branch",
685
  "Koha::Schema::Result::Category",
710
  { branchcode => "branchcode" },
686
  { categorycode => "categorycode" },
711
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
687
  { on_delete => "CASCADE", on_update => "CASCADE" },
712
);
688
);
713
689
714
=head2 categorycode
690
=head2 branchcode
715
691
716
Type: belongs_to
692
Type: belongs_to
717
693
718
Related object: L<Koha::Schema::Result::Category>
694
Related object: L<Koha::Schema::Result::Branch>
719
695
720
=cut
696
=cut
721
697
722
__PACKAGE__->belongs_to(
698
__PACKAGE__->belongs_to(
723
  "categorycode",
699
  "branchcode",
724
  "Koha::Schema::Result::Category",
700
  "Koha::Schema::Result::Branch",
725
  { categorycode => "categorycode" },
701
  { branchcode => "branchcode" },
726
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
702
  { on_delete => "CASCADE", on_update => "CASCADE" },
727
);
703
);
728
704
729
=head2 course_instructors
705
=head2 course_instructors
Lines 1041-1079 __PACKAGE__->has_many( Link Here
1041
  { cascade_copy => 0, cascade_delete => 0 },
1017
  { cascade_copy => 0, cascade_delete => 0 },
1042
);
1018
);
1043
1019
1044
=head2 basketnoes
1045
1046
Type: many_to_many
1047
1048
Composing rels: L</aqbasketusers> -> basketno
1049
1050
=cut
1051
1052
__PACKAGE__->many_to_many("basketnoes", "aqbasketusers", "basketno");
1053
1054
=head2 budgets
1055
1056
Type: many_to_many
1057
1058
Composing rels: L</aqbudgetborrowers> -> budget
1059
1060
=cut
1061
1062
__PACKAGE__->many_to_many("budgets", "aqbudgetborrowers", "budget");
1063
1064
=head2 courses
1065
1066
Type: many_to_many
1067
1068
Composing rels: L</course_instructors> -> course
1069
1070
=cut
1071
1072
__PACKAGE__->many_to_many("courses", "course_instructors", "course");
1073
1074
1020
1075
# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-31 16:31:19
1021
# Created by DBIx::Class::Schema::Loader v0.07000 @ 2013-11-07 08:15:21
1076
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:z4kW3xYX1CyrwvGdZu32nA
1022
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TQTGI0fDt+xCFs+8nOarfA
1077
1023
1078
1024
1079
# You can replace this text with custom content, and it will be preserved on regeneration
1025
# You can replace this text with custom content, and it will be preserved on regeneration
(-)a/Koha/Schema/Result/Issue.pm (-50 / +30 lines)
Lines 1-21 Link Here
1
use utf8;
2
package Koha::Schema::Result::Issue;
1
package Koha::Schema::Result::Issue;
3
2
4
# Created by DBIx::Class::Schema::Loader
3
# Created by DBIx::Class::Schema::Loader
5
# DO NOT MODIFY THE FIRST PART OF THIS FILE
4
# DO NOT MODIFY THE FIRST PART OF THIS FILE
6
5
7
=head1 NAME
8
9
Koha::Schema::Result::Issue
10
11
=cut
12
13
use strict;
6
use strict;
14
use warnings;
7
use warnings;
15
8
16
use base 'DBIx::Class::Core';
9
use base 'DBIx::Class::Core';
17
10
18
=head1 TABLE: C<issues>
11
12
=head1 NAME
13
14
Koha::Schema::Result::Issue
19
15
20
=cut
16
=cut
21
17
Lines 23-28 __PACKAGE__->table("issues"); Link Here
23
19
24
=head1 ACCESSORS
20
=head1 ACCESSORS
25
21
22
=head2 issue_id
23
24
  data_type: 'integer'
25
  is_auto_increment: 1
26
  is_nullable: 0
27
26
=head2 borrowernumber
28
=head2 borrowernumber
27
29
28
  data_type: 'integer'
30
  data_type: 'integer'
Lines 38-44 __PACKAGE__->table("issues"); Link Here
38
=head2 date_due
40
=head2 date_due
39
41
40
  data_type: 'datetime'
42
  data_type: 'datetime'
41
  datetime_undef_if_invalid: 1
42
  is_nullable: 1
43
  is_nullable: 1
43
44
44
=head2 branchcode
45
=head2 branchcode
Lines 56-68 __PACKAGE__->table("issues"); Link Here
56
=head2 returndate
57
=head2 returndate
57
58
58
  data_type: 'datetime'
59
  data_type: 'datetime'
59
  datetime_undef_if_invalid: 1
60
  is_nullable: 1
60
  is_nullable: 1
61
61
62
=head2 lastreneweddate
62
=head2 lastreneweddate
63
63
64
  data_type: 'datetime'
64
  data_type: 'datetime'
65
  datetime_undef_if_invalid: 1
66
  is_nullable: 1
65
  is_nullable: 1
67
66
68
=head2 return
67
=head2 return
Lines 79-141 __PACKAGE__->table("issues"); Link Here
79
=head2 timestamp
78
=head2 timestamp
80
79
81
  data_type: 'timestamp'
80
  data_type: 'timestamp'
82
  datetime_undef_if_invalid: 1
83
  default_value: current_timestamp
81
  default_value: current_timestamp
84
  is_nullable: 0
82
  is_nullable: 0
85
83
86
=head2 issuedate
84
=head2 issuedate
87
85
88
  data_type: 'datetime'
86
  data_type: 'datetime'
89
  datetime_undef_if_invalid: 1
90
  is_nullable: 1
87
  is_nullable: 1
91
88
92
=cut
89
=cut
93
90
94
__PACKAGE__->add_columns(
91
__PACKAGE__->add_columns(
92
  "issue_id",
93
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
95
  "borrowernumber",
94
  "borrowernumber",
96
  { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
95
  { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
97
  "itemnumber",
96
  "itemnumber",
98
  { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
97
  { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
99
  "date_due",
98
  "date_due",
100
  {
99
  { data_type => "datetime", is_nullable => 1 },
101
    data_type => "datetime",
102
    datetime_undef_if_invalid => 1,
103
    is_nullable => 1,
104
  },
105
  "branchcode",
100
  "branchcode",
106
  { data_type => "varchar", is_nullable => 1, size => 10 },
101
  { data_type => "varchar", is_nullable => 1, size => 10 },
107
  "issuingbranch",
102
  "issuingbranch",
108
  { data_type => "varchar", is_nullable => 1, size => 18 },
103
  { data_type => "varchar", is_nullable => 1, size => 18 },
109
  "returndate",
104
  "returndate",
110
  {
105
  { data_type => "datetime", is_nullable => 1 },
111
    data_type => "datetime",
112
    datetime_undef_if_invalid => 1,
113
    is_nullable => 1,
114
  },
115
  "lastreneweddate",
106
  "lastreneweddate",
116
  {
107
  { data_type => "datetime", is_nullable => 1 },
117
    data_type => "datetime",
118
    datetime_undef_if_invalid => 1,
119
    is_nullable => 1,
120
  },
121
  "return",
108
  "return",
122
  { data_type => "varchar", is_nullable => 1, size => 4 },
109
  { data_type => "varchar", is_nullable => 1, size => 4 },
123
  "renewals",
110
  "renewals",
124
  { data_type => "tinyint", is_nullable => 1 },
111
  { data_type => "tinyint", is_nullable => 1 },
125
  "timestamp",
112
  "timestamp",
126
  {
113
  {
127
    data_type => "timestamp",
114
    data_type     => "timestamp",
128
    datetime_undef_if_invalid => 1,
129
    default_value => \"current_timestamp",
115
    default_value => \"current_timestamp",
130
    is_nullable => 0,
116
    is_nullable   => 0,
131
  },
117
  },
132
  "issuedate",
118
  "issuedate",
133
  {
119
  { data_type => "datetime", is_nullable => 1 },
134
    data_type => "datetime",
135
    datetime_undef_if_invalid => 1,
136
    is_nullable => 1,
137
  },
138
);
120
);
121
__PACKAGE__->set_primary_key("issue_id");
139
122
140
=head1 RELATIONS
123
=head1 RELATIONS
141
124
Lines 151-162 __PACKAGE__->belongs_to( Link Here
151
  "borrowernumber",
134
  "borrowernumber",
152
  "Koha::Schema::Result::Borrower",
135
  "Koha::Schema::Result::Borrower",
153
  { borrowernumber => "borrowernumber" },
136
  { borrowernumber => "borrowernumber" },
154
  {
137
  { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" },
155
    is_deferrable => 1,
156
    join_type     => "LEFT",
157
    on_delete     => "CASCADE",
158
    on_update     => "CASCADE",
159
  },
160
);
138
);
161
139
162
=head2 itemnumber
140
=head2 itemnumber
Lines 171-187 __PACKAGE__->belongs_to( Link Here
171
  "itemnumber",
149
  "itemnumber",
172
  "Koha::Schema::Result::Item",
150
  "Koha::Schema::Result::Item",
173
  { itemnumber => "itemnumber" },
151
  { itemnumber => "itemnumber" },
174
  {
152
  { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" },
175
    is_deferrable => 1,
176
    join_type     => "LEFT",
177
    on_delete     => "CASCADE",
178
    on_update     => "CASCADE",
179
  },
180
);
153
);
181
154
182
155
183
# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21
156
# Created by DBIx::Class::Schema::Loader v0.07000 @ 2013-11-06 14:03:30
184
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZEh31EKBmURMKxDxI+H3EA
157
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:x90AnyA32VcLbXMb7hfA9g
185
158
186
__PACKAGE__->belongs_to(
159
__PACKAGE__->belongs_to(
187
  "borrower",
160
  "borrower",
Lines 190-193 __PACKAGE__->belongs_to( Link Here
190
  { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" },
163
  { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" },
191
);
164
);
192
165
166
__PACKAGE__->belongs_to(
167
  "item",
168
  "Koha::Schema::Result::Item",
169
  { itemnumber => "itemnumber" },
170
  { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" },
171
);
172
193
1;
173
1;
(-)a/Koha/Schema/Result/OldIssue.pm (-50 / +23 lines)
Lines 1-21 Link Here
1
use utf8;
2
package Koha::Schema::Result::OldIssue;
1
package Koha::Schema::Result::OldIssue;
3
2
4
# Created by DBIx::Class::Schema::Loader
3
# Created by DBIx::Class::Schema::Loader
5
# DO NOT MODIFY THE FIRST PART OF THIS FILE
4
# DO NOT MODIFY THE FIRST PART OF THIS FILE
6
5
7
=head1 NAME
8
9
Koha::Schema::Result::OldIssue
10
11
=cut
12
13
use strict;
6
use strict;
14
use warnings;
7
use warnings;
15
8
16
use base 'DBIx::Class::Core';
9
use base 'DBIx::Class::Core';
17
10
18
=head1 TABLE: C<old_issues>
11
12
=head1 NAME
13
14
Koha::Schema::Result::OldIssue
19
15
20
=cut
16
=cut
21
17
Lines 23-28 __PACKAGE__->table("old_issues"); Link Here
23
19
24
=head1 ACCESSORS
20
=head1 ACCESSORS
25
21
22
=head2 issue_id
23
24
  data_type: 'integer'
25
  is_auto_increment: 1
26
  is_nullable: 0
27
26
=head2 borrowernumber
28
=head2 borrowernumber
27
29
28
  data_type: 'integer'
30
  data_type: 'integer'
Lines 38-44 __PACKAGE__->table("old_issues"); Link Here
38
=head2 date_due
40
=head2 date_due
39
41
40
  data_type: 'datetime'
42
  data_type: 'datetime'
41
  datetime_undef_if_invalid: 1
42
  is_nullable: 1
43
  is_nullable: 1
43
44
44
=head2 branchcode
45
=head2 branchcode
Lines 56-68 __PACKAGE__->table("old_issues"); Link Here
56
=head2 returndate
57
=head2 returndate
57
58
58
  data_type: 'datetime'
59
  data_type: 'datetime'
59
  datetime_undef_if_invalid: 1
60
  is_nullable: 1
60
  is_nullable: 1
61
61
62
=head2 lastreneweddate
62
=head2 lastreneweddate
63
63
64
  data_type: 'datetime'
64
  data_type: 'datetime'
65
  datetime_undef_if_invalid: 1
66
  is_nullable: 1
65
  is_nullable: 1
67
66
68
=head2 return
67
=head2 return
Lines 79-141 __PACKAGE__->table("old_issues"); Link Here
79
=head2 timestamp
78
=head2 timestamp
80
79
81
  data_type: 'timestamp'
80
  data_type: 'timestamp'
82
  datetime_undef_if_invalid: 1
83
  default_value: current_timestamp
81
  default_value: current_timestamp
84
  is_nullable: 0
82
  is_nullable: 0
85
83
86
=head2 issuedate
84
=head2 issuedate
87
85
88
  data_type: 'datetime'
86
  data_type: 'datetime'
89
  datetime_undef_if_invalid: 1
90
  is_nullable: 1
87
  is_nullable: 1
91
88
92
=cut
89
=cut
93
90
94
__PACKAGE__->add_columns(
91
__PACKAGE__->add_columns(
92
  "issue_id",
93
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
95
  "borrowernumber",
94
  "borrowernumber",
96
  { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
95
  { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
97
  "itemnumber",
96
  "itemnumber",
98
  { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
97
  { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
99
  "date_due",
98
  "date_due",
100
  {
99
  { data_type => "datetime", is_nullable => 1 },
101
    data_type => "datetime",
102
    datetime_undef_if_invalid => 1,
103
    is_nullable => 1,
104
  },
105
  "branchcode",
100
  "branchcode",
106
  { data_type => "varchar", is_nullable => 1, size => 10 },
101
  { data_type => "varchar", is_nullable => 1, size => 10 },
107
  "issuingbranch",
102
  "issuingbranch",
108
  { data_type => "varchar", is_nullable => 1, size => 18 },
103
  { data_type => "varchar", is_nullable => 1, size => 18 },
109
  "returndate",
104
  "returndate",
110
  {
105
  { data_type => "datetime", is_nullable => 1 },
111
    data_type => "datetime",
112
    datetime_undef_if_invalid => 1,
113
    is_nullable => 1,
114
  },
115
  "lastreneweddate",
106
  "lastreneweddate",
116
  {
107
  { data_type => "datetime", is_nullable => 1 },
117
    data_type => "datetime",
118
    datetime_undef_if_invalid => 1,
119
    is_nullable => 1,
120
  },
121
  "return",
108
  "return",
122
  { data_type => "varchar", is_nullable => 1, size => 4 },
109
  { data_type => "varchar", is_nullable => 1, size => 4 },
123
  "renewals",
110
  "renewals",
124
  { data_type => "tinyint", is_nullable => 1 },
111
  { data_type => "tinyint", is_nullable => 1 },
125
  "timestamp",
112
  "timestamp",
126
  {
113
  {
127
    data_type => "timestamp",
114
    data_type     => "timestamp",
128
    datetime_undef_if_invalid => 1,
129
    default_value => \"current_timestamp",
115
    default_value => \"current_timestamp",
130
    is_nullable => 0,
116
    is_nullable   => 0,
131
  },
117
  },
132
  "issuedate",
118
  "issuedate",
133
  {
119
  { data_type => "datetime", is_nullable => 1 },
134
    data_type => "datetime",
135
    datetime_undef_if_invalid => 1,
136
    is_nullable => 1,
137
  },
138
);
120
);
121
__PACKAGE__->set_primary_key("issue_id");
139
122
140
=head1 RELATIONS
123
=head1 RELATIONS
141
124
Lines 151-162 __PACKAGE__->belongs_to( Link Here
151
  "borrowernumber",
134
  "borrowernumber",
152
  "Koha::Schema::Result::Borrower",
135
  "Koha::Schema::Result::Borrower",
153
  { borrowernumber => "borrowernumber" },
136
  { borrowernumber => "borrowernumber" },
154
  {
137
  { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" },
155
    is_deferrable => 1,
156
    join_type     => "LEFT",
157
    on_delete     => "CASCADE",
158
    on_update     => "CASCADE",
159
  },
160
);
138
);
161
139
162
=head2 itemnumber
140
=head2 itemnumber
Lines 171-187 __PACKAGE__->belongs_to( Link Here
171
  "itemnumber",
149
  "itemnumber",
172
  "Koha::Schema::Result::Item",
150
  "Koha::Schema::Result::Item",
173
  { itemnumber => "itemnumber" },
151
  { itemnumber => "itemnumber" },
174
  {
152
  { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" },
175
    is_deferrable => 1,
176
    join_type     => "LEFT",
177
    on_delete     => "CASCADE",
178
    on_update     => "CASCADE",
179
  },
180
);
153
);
181
154
182
155
183
# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21
156
# Created by DBIx::Class::Schema::Loader v0.07000 @ 2013-11-07 08:15:21
184
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uPOxNROoMMRZ0qZsXsxEjA
157
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:np3nmo0XYIYp92QbCY6/cw
185
158
186
159
187
# You can replace this text with custom content, and it will be preserved on regeneration
160
# You can replace this text with custom content, and it will be preserved on regeneration
(-)a/installer/data/mysql/kohastructure.sql (+6 lines)
Lines 265-270 CREATE TABLE `borrowers` ( -- this table includes information about your patrons Link Here
265
  `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
265
  `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
266
  `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on)
266
  `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on)
267
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history
267
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history
268
  `privacy_relative_checkouts` tinyint(1) NOT NULL DEFAULT '0', -- controls if relatives can see this patron's checkouts
268
  UNIQUE KEY `cardnumber` (`cardnumber`),
269
  UNIQUE KEY `cardnumber` (`cardnumber`),
269
  PRIMARY KEY `borrowernumber` (`borrowernumber`),
270
  PRIMARY KEY `borrowernumber` (`borrowernumber`),
270
  KEY `categorycode` (`categorycode`),
271
  KEY `categorycode` (`categorycode`),
Lines 865-870 CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower Link Here
865
  `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
866
  `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
866
  `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on)
867
  `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on)
867
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history  KEY `borrowernumber` (`borrowernumber`),
868
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history  KEY `borrowernumber` (`borrowernumber`),
869
  `privacy_relative_checkouts` tinyint(1) NOT NULL DEFAULT '0', -- controls if relatives can see this patron's checkouts
868
  KEY borrowernumber (borrowernumber),
870
  KEY borrowernumber (borrowernumber),
869
  KEY `cardnumber` (`cardnumber`)
871
  KEY `cardnumber` (`cardnumber`)
870
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
872
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Lines 1111-1116 CREATE TABLE `import_items` ( Link Here
1111
1113
1112
DROP TABLE IF EXISTS `issues`;
1114
DROP TABLE IF EXISTS `issues`;
1113
CREATE TABLE `issues` ( -- information related to check outs or issues
1115
CREATE TABLE `issues` ( -- information related to check outs or issues
1116
  `issue_id` int(11) NOT NULL AUTO_INCREMENT, -- primary key for issues table
1114
  `borrowernumber` int(11), -- foreign key, linking this to the borrowers table for the patron this item was checked out to
1117
  `borrowernumber` int(11), -- foreign key, linking this to the borrowers table for the patron this item was checked out to
1115
  `itemnumber` int(11), -- foreign key, linking this to the items table for the item that was checked out
1118
  `itemnumber` int(11), -- foreign key, linking this to the items table for the item that was checked out
1116
  `date_due` datetime default NULL, -- datetime the item is due (yyyy-mm-dd hh:mm::ss)
1119
  `date_due` datetime default NULL, -- datetime the item is due (yyyy-mm-dd hh:mm::ss)
Lines 1122-1127 CREATE TABLE `issues` ( -- information related to check outs or issues Link Here
1122
  `renewals` tinyint(4) default NULL, -- lists the number of times the item was renewed
1125
  `renewals` tinyint(4) default NULL, -- lists the number of times the item was renewed
1123
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
1126
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
1124
  `issuedate` datetime default NULL, -- date the item was checked out or issued
1127
  `issuedate` datetime default NULL, -- date the item was checked out or issued
1128
  PRIMARY KEY (`issue_id`),
1125
  KEY `issuesborridx` (`borrowernumber`),
1129
  KEY `issuesborridx` (`borrowernumber`),
1126
  KEY `itemnumber_idx` (`itemnumber`),
1130
  KEY `itemnumber_idx` (`itemnumber`),
1127
  KEY `branchcode_idx` (`branchcode`),
1131
  KEY `branchcode_idx` (`branchcode`),
Lines 1576-1581 CREATE TABLE `oai_sets_biblios` ( Link Here
1576
1580
1577
DROP TABLE IF EXISTS `old_issues`;
1581
DROP TABLE IF EXISTS `old_issues`;
1578
CREATE TABLE `old_issues` ( -- lists items that were checked out and have been returned
1582
CREATE TABLE `old_issues` ( -- lists items that were checked out and have been returned
1583
  `issue_id` int(11) NOT NULL AUTO_INCREMENT, -- primary key for issues table
1579
  `borrowernumber` int(11) default NULL, -- foreign key, linking this to the borrowers table for the patron this item was checked out to
1584
  `borrowernumber` int(11) default NULL, -- foreign key, linking this to the borrowers table for the patron this item was checked out to
1580
  `itemnumber` int(11) default NULL, -- foreign key, linking this to the items table for the item that was checked out
1585
  `itemnumber` int(11) default NULL, -- foreign key, linking this to the items table for the item that was checked out
1581
  `date_due` datetime default NULL, -- date the item is due (yyyy-mm-dd)
1586
  `date_due` datetime default NULL, -- date the item is due (yyyy-mm-dd)
Lines 1587-1592 CREATE TABLE `old_issues` ( -- lists items that were checked out and have been r Link Here
1587
  `renewals` tinyint(4) default NULL, -- lists the number of times the item was renewed
1592
  `renewals` tinyint(4) default NULL, -- lists the number of times the item was renewed
1588
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
1593
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
1589
  `issuedate` datetime default NULL, -- date the item was checked out or issued
1594
  `issuedate` datetime default NULL, -- date the item was checked out or issued
1595
  PRIMARY KEY (`issue_id`),
1590
  KEY `old_issuesborridx` (`borrowernumber`),
1596
  KEY `old_issuesborridx` (`borrowernumber`),
1591
  KEY `old_issuesitemidx` (`itemnumber`),
1597
  KEY `old_issuesitemidx` (`itemnumber`),
1592
  KEY `branchcode_idx` (`branchcode`),
1598
  KEY `branchcode_idx` (`branchcode`),
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +21 lines)
Lines 7912-7917 if ( CheckVersion($DBversion) ) { Link Here
7912
    SetVersion($DBversion);
7912
    SetVersion($DBversion);
7913
}
7913
}
7914
7914
7915
$DBversion = "3.15.00.XXX";
7916
if(CheckVersion($DBversion)) {
7917
    $dbh->do(q{
7918
        ALTER TABLE borrowers ADD privacy_relative_checkouts BOOLEAN NOT NULL DEFAULT '0'
7919
    });
7920
    $dbh->do(q{
7921
        ALTER TABLE deletedborrowers ADD privacy_relative_checkouts BOOLEAN NOT NULL DEFAULT '0'
7922
    });
7923
    $dbh->do(q{
7924
        ALTER TABLE old_issues ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST
7925
    });
7926
    $dbh->do(q{
7927
        ALTER TABLE issues ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
7928
    });
7929
    $dbh->do(qq{
7930
        UPDATE issues SET issue_id = issue_id + ( SELECT COUNT(*) FROM old_issues ) ORDER BY issue_id DESC
7931
    });
7932
    print "Upgrade to $DBversion done (Bug 9303 - relative's checkouts in the opac)\n";
7933
    SetVersion($DBversion);
7934
}
7935
7915
=head1 FUNCTIONS
7936
=head1 FUNCTIONS
7916
7937
7917
=head2 TableExists($table)
7938
=head2 TableExists($table)
7918
- 

Return to bug 9303