Bug 23152: Implement koha_object[s]_class when needed
[koha-equinox.git] / Koha / Schema / Result / BiblioMetadata.pm
1 use utf8;
2 package Koha::Schema::Result::BiblioMetadata;
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::BiblioMetadata
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<biblio_metadata>
19
20 =cut
21
22 __PACKAGE__->table("biblio_metadata");
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 biblionumber
33
34   data_type: 'integer'
35   is_foreign_key: 1
36   is_nullable: 0
37
38 =head2 format
39
40   data_type: 'varchar'
41   is_nullable: 0
42   size: 16
43
44 =head2 schema
45
46   data_type: 'varchar'
47   is_nullable: 0
48   size: 16
49
50 =head2 metadata
51
52   data_type: 'longtext'
53   is_nullable: 0
54
55 =head2 timestamp
56
57   data_type: 'timestamp'
58   datetime_undef_if_invalid: 1
59   default_value: current_timestamp
60   is_nullable: 0
61
62 =cut
63
64 __PACKAGE__->add_columns(
65   "id",
66   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
67   "biblionumber",
68   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
69   "format",
70   { data_type => "varchar", is_nullable => 0, size => 16 },
71   "schema",
72   { data_type => "varchar", is_nullable => 0, size => 16 },
73   "metadata",
74   { data_type => "longtext", is_nullable => 0 },
75   "timestamp",
76   {
77     data_type => "timestamp",
78     datetime_undef_if_invalid => 1,
79     default_value => \"current_timestamp",
80     is_nullable => 0,
81   },
82 );
83
84 =head1 PRIMARY KEY
85
86 =over 4
87
88 =item * L</id>
89
90 =back
91
92 =cut
93
94 __PACKAGE__->set_primary_key("id");
95
96 =head1 UNIQUE CONSTRAINTS
97
98 =head2 C<biblio_metadata_uniq_key>
99
100 =over 4
101
102 =item * L</biblionumber>
103
104 =item * L</format>
105
106 =item * L</schema>
107
108 =back
109
110 =cut
111
112 __PACKAGE__->add_unique_constraint(
113   "biblio_metadata_uniq_key",
114   ["biblionumber", "format", "schema"],
115 );
116
117 =head1 RELATIONS
118
119 =head2 biblionumber
120
121 Type: belongs_to
122
123 Related object: L<Koha::Schema::Result::Biblio>
124
125 =cut
126
127 __PACKAGE__->belongs_to(
128   "biblionumber",
129   "Koha::Schema::Result::Biblio",
130   { biblionumber => "biblionumber" },
131   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
132 );
133
134
135 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-01-30 11:34:16
136 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FJk/YOw8Y/QRmmPPL3G5qQ
137
138 sub koha_object_class {
139     'Koha::Biblio::Metadatas';
140 }
141
142 1;