Bug 8976: DBIC schema changes
[koha.git] / Koha / Schema / Result / Desk.pm
1 use utf8;
2 package Koha::Schema::Result::Desk;
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::Desk
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<desks>
19
20 =cut
21
22 __PACKAGE__->table("desks");
23
24 =head1 ACCESSORS
25
26 =head2 desk_id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 unique identifier
33
34 =head2 desk_name
35
36   data_type: 'varchar'
37   default_value: (empty string)
38   is_nullable: 0
39   size: 100
40
41 name of the desk
42
43 =head2 branchcode
44
45   data_type: 'varchar'
46   is_foreign_key: 1
47   is_nullable: 0
48   size: 10
49
50 library the desk is located at
51
52 =cut
53
54 __PACKAGE__->add_columns(
55   "desk_id",
56   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
57   "desk_name",
58   { data_type => "varchar", default_value => "", is_nullable => 0, size => 100 },
59   "branchcode",
60   { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 },
61 );
62
63 =head1 PRIMARY KEY
64
65 =over 4
66
67 =item * L</desk_id>
68
69 =back
70
71 =cut
72
73 __PACKAGE__->set_primary_key("desk_id");
74
75 =head1 RELATIONS
76
77 =head2 branchcode
78
79 Type: belongs_to
80
81 Related object: L<Koha::Schema::Result::Branch>
82
83 =cut
84
85 __PACKAGE__->belongs_to(
86   "branchcode",
87   "Koha::Schema::Result::Branch",
88   { branchcode => "branchcode" },
89   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
90 );
91
92 =head2 reserves
93
94 Type: has_many
95
96 Related object: L<Koha::Schema::Result::Reserve>
97
98 =cut
99
100 __PACKAGE__->has_many(
101   "reserves",
102   "Koha::Schema::Result::Reserve",
103   { "foreign.desk_id" => "self.desk_id" },
104   { cascade_copy => 0, cascade_delete => 0 },
105 );
106
107
108 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
109 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7qeCP25arGQpM4xxnTmWbw
110
111
112 # You can replace this text with custom code or comments, and it will be preserved on regeneration
113 1;