Bug 23321: (QA follow-up) Booleans
[koha.git] / Koha / Schema / Result / CashRegister.pm
blob88230e60f8884408de9cc83dc65f5e9594244f57
1 use utf8;
2 package Koha::Schema::Result::CashRegister;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
7 =head1 NAME
9 Koha::Schema::Result::CashRegister
11 =cut
13 use strict;
14 use warnings;
16 use base 'DBIx::Class::Core';
18 =head1 TABLE: C<cash_registers>
20 =cut
22 __PACKAGE__->table("cash_registers");
24 =head1 ACCESSORS
26 =head2 id
28 data_type: 'integer'
29 is_auto_increment: 1
30 is_nullable: 0
32 =head2 name
34 data_type: 'varchar'
35 is_nullable: 0
36 size: 24
38 =head2 description
40 data_type: 'longtext'
41 is_nullable: 0
43 =head2 branch
45 data_type: 'varchar'
46 is_foreign_key: 1
47 is_nullable: 0
48 size: 10
50 =head2 branch_default
52 data_type: 'tinyint'
53 default_value: 0
54 is_nullable: 0
56 =head2 starting_float
58 data_type: 'decimal'
59 is_nullable: 1
60 size: [28,6]
62 =head2 archived
64 data_type: 'tinyint'
65 default_value: 0
66 is_nullable: 0
68 =cut
70 __PACKAGE__->add_columns(
71 "id",
72 { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
73 "name",
74 { data_type => "varchar", is_nullable => 0, size => 24 },
75 "description",
76 { data_type => "longtext", is_nullable => 0 },
77 "branch",
78 { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 },
79 "branch_default",
80 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
81 "starting_float",
82 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
83 "archived",
84 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
87 =head1 PRIMARY KEY
89 =over 4
91 =item * L</id>
93 =back
95 =cut
97 __PACKAGE__->set_primary_key("id");
99 =head1 UNIQUE CONSTRAINTS
101 =head2 C<name>
103 =over 4
105 =item * L</name>
107 =item * L</branch>
109 =back
111 =cut
113 __PACKAGE__->add_unique_constraint("name", ["name", "branch"]);
115 =head1 RELATIONS
117 =head2 accountlines
119 Type: has_many
121 Related object: L<Koha::Schema::Result::Accountline>
123 =cut
125 __PACKAGE__->has_many(
126 "accountlines",
127 "Koha::Schema::Result::Accountline",
128 { "foreign.register_id" => "self.id" },
129 { cascade_copy => 0, cascade_delete => 0 },
132 =head2 branch
134 Type: belongs_to
136 Related object: L<Koha::Schema::Result::Branch>
138 =cut
140 __PACKAGE__->belongs_to(
141 "branch",
142 "Koha::Schema::Result::Branch",
143 { branchcode => "branch" },
144 { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
148 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-07-23 13:14:31
149 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TfGf0U/vWS7IviRlvDdE1w
151 __PACKAGE__->add_columns(
152 '+archived' => { is_boolean => 1 },
153 '+branch_default' => { is_boolean => 1 },
156 # You can replace this text with custom code or comments, and it will be preserved on regeneration