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

(-)a/Koha/Schema/Result/AdditionalField.pm (+134 lines)
Line 0 Link Here
1
use utf8;
2
package Koha::Schema::Result::AdditionalField;
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::AdditionalField
10
11
=cut
12
13
use strict;
14
use warnings;
15
16
use base 'DBIx::Class::Core';
17
18
=head1 TABLE: C<additional_fields>
19
20
=cut
21
22
__PACKAGE__->table("additional_fields");
23
24
=head1 ACCESSORS
25
26
=head2 id
27
28
  data_type: 'integer'
29
  is_auto_increment: 1
30
  is_nullable: 0
31
32
=head2 tablename
33
34
  data_type: 'varchar'
35
  default_value: (empty string)
36
  is_nullable: 0
37
  size: 255
38
39
=head2 name
40
41
  data_type: 'varchar'
42
  default_value: (empty string)
43
  is_nullable: 0
44
  size: 255
45
46
=head2 authorised_value_category
47
48
  data_type: 'varchar'
49
  default_value: (empty string)
50
  is_nullable: 0
51
  size: 16
52
53
=head2 marcfield
54
55
  data_type: 'varchar'
56
  default_value: (empty string)
57
  is_nullable: 0
58
  size: 16
59
60
=head2 searchable
61
62
  data_type: 'tinyint'
63
  default_value: 0
64
  is_nullable: 0
65
66
=cut
67
68
__PACKAGE__->add_columns(
69
  "id",
70
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
71
  "tablename",
72
  { data_type => "varchar", default_value => "", is_nullable => 0, size => 255 },
73
  "name",
74
  { data_type => "varchar", default_value => "", is_nullable => 0, size => 255 },
75
  "authorised_value_category",
76
  { data_type => "varchar", default_value => "", is_nullable => 0, size => 16 },
77
  "marcfield",
78
  { data_type => "varchar", default_value => "", is_nullable => 0, size => 16 },
79
  "searchable",
80
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
81
);
82
83
=head1 PRIMARY KEY
84
85
=over 4
86
87
=item * L</id>
88
89
=back
90
91
=cut
92
93
__PACKAGE__->set_primary_key("id");
94
95
=head1 UNIQUE CONSTRAINTS
96
97
=head2 C<fields_uniq>
98
99
=over 4
100
101
=item * L</tablename>
102
103
=item * L</name>
104
105
=back
106
107
=cut
108
109
__PACKAGE__->add_unique_constraint("fields_uniq", ["tablename", "name"]);
110
111
=head1 RELATIONS
112
113
=head2 additional_field_values
114
115
Type: has_many
116
117
Related object: L<Koha::Schema::Result::AdditionalFieldValue>
118
119
=cut
120
121
__PACKAGE__->has_many(
122
  "additional_field_values",
123
  "Koha::Schema::Result::AdditionalFieldValue",
124
  { "foreign.field_id" => "self.id" },
125
  { cascade_copy => 0, cascade_delete => 0 },
126
);
127
128
129
# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-10-02 15:12:02
130
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vvz9GJNkU4K7bftDNuRHVA
131
132
133
# You can replace this text with custom code or comments, and it will be preserved on regeneration
134
1;
(-)a/Koha/Schema/Result/AdditionalFieldValue.pm (-1 / +114 lines)
Line 0 Link Here
0
- 
1
use utf8;
2
package Koha::Schema::Result::AdditionalFieldValue;
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::AdditionalFieldValue
10
11
=cut
12
13
use strict;
14
use warnings;
15
16
use base 'DBIx::Class::Core';
17
18
=head1 TABLE: C<additional_field_values>
19
20
=cut
21
22
__PACKAGE__->table("additional_field_values");
23
24
=head1 ACCESSORS
25
26
=head2 id
27
28
  data_type: 'integer'
29
  is_auto_increment: 1
30
  is_nullable: 0
31
32
=head2 field_id
33
34
  data_type: 'integer'
35
  is_foreign_key: 1
36
  is_nullable: 0
37
38
=head2 record_id
39
40
  data_type: 'integer'
41
  is_nullable: 0
42
43
=head2 value
44
45
  data_type: 'varchar'
46
  default_value: (empty string)
47
  is_nullable: 0
48
  size: 255
49
50
=cut
51
52
__PACKAGE__->add_columns(
53
  "id",
54
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
55
  "field_id",
56
  { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
57
  "record_id",
58
  { data_type => "integer", is_nullable => 0 },
59
  "value",
60
  { data_type => "varchar", default_value => "", is_nullable => 0, size => 255 },
61
);
62
63
=head1 PRIMARY KEY
64
65
=over 4
66
67
=item * L</id>
68
69
=back
70
71
=cut
72
73
__PACKAGE__->set_primary_key("id");
74
75
=head1 UNIQUE CONSTRAINTS
76
77
=head2 C<field_record>
78
79
=over 4
80
81
=item * L</field_id>
82
83
=item * L</record_id>
84
85
=back
86
87
=cut
88
89
__PACKAGE__->add_unique_constraint("field_record", ["field_id", "record_id"]);
90
91
=head1 RELATIONS
92
93
=head2 field
94
95
Type: belongs_to
96
97
Related object: L<Koha::Schema::Result::AdditionalField>
98
99
=cut
100
101
__PACKAGE__->belongs_to(
102
  "field",
103
  "Koha::Schema::Result::AdditionalField",
104
  { id => "field_id" },
105
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
106
);
107
108
109
# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-10-02 15:12:02
110
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:a9G6nhDU9dBDcRRN0vzkLA
111
112
113
# You can replace this text with custom code or comments, and it will be preserved on regeneration
114
1;

Return to bug 10855