Bug 19482: DBIC schema changes
[koha.git] / Koha / Schema / Result / AccountCreditType.pm
1 use utf8;
2 package Koha::Schema::Result::AccountCreditType;
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::AccountCreditType
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<account_credit_types>
19
20 =cut
21
22 __PACKAGE__->table("account_credit_types");
23
24 =head1 ACCESSORS
25
26 =head2 code
27
28   data_type: 'varchar'
29   is_nullable: 0
30   size: 80
31
32 =head2 description
33
34   data_type: 'varchar'
35   is_nullable: 1
36   size: 200
37
38 =head2 can_be_added_manually
39
40   data_type: 'tinyint'
41   default_value: 1
42   is_nullable: 0
43
44 =head2 credit_number_enabled
45
46   data_type: 'tinyint'
47   default_value: 0
48   is_nullable: 0
49
50 Is autogeneration of credit number enabled for this credit type
51
52 =head2 is_system
53
54   data_type: 'tinyint'
55   default_value: 0
56   is_nullable: 0
57
58 =head2 archived
59
60   data_type: 'tinyint'
61   default_value: 0
62   is_nullable: 0
63
64 =cut
65
66 __PACKAGE__->add_columns(
67   "code",
68   { data_type => "varchar", is_nullable => 0, size => 80 },
69   "description",
70   { data_type => "varchar", is_nullable => 1, size => 200 },
71   "can_be_added_manually",
72   { data_type => "tinyint", default_value => 1, is_nullable => 0 },
73   "credit_number_enabled",
74   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
75   "is_system",
76   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
77   "archived",
78   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
79 );
80
81 =head1 PRIMARY KEY
82
83 =over 4
84
85 =item * L</code>
86
87 =back
88
89 =cut
90
91 __PACKAGE__->set_primary_key("code");
92
93 =head1 RELATIONS
94
95 =head2 account_credit_types_branches
96
97 Type: has_many
98
99 Related object: L<Koha::Schema::Result::AccountCreditTypesBranch>
100
101 =cut
102
103 __PACKAGE__->has_many(
104   "account_credit_types_branches",
105   "Koha::Schema::Result::AccountCreditTypesBranch",
106   { "foreign.credit_type_code" => "self.code" },
107   { cascade_copy => 0, cascade_delete => 0 },
108 );
109
110 =head2 accountlines
111
112 Type: has_many
113
114 Related object: L<Koha::Schema::Result::Accountline>
115
116 =cut
117
118 __PACKAGE__->has_many(
119   "accountlines",
120   "Koha::Schema::Result::Accountline",
121   { "foreign.credit_type_code" => "self.code" },
122   { cascade_copy => 0, cascade_delete => 0 },
123 );
124
125
126 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-06-25 09:19:20
127 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GESL9hjEPlrQBiuHO4haAw
128
129 __PACKAGE__->add_columns(
130     '+is_system'             => { is_boolean => 1 },
131     '+credit_number_enabled' => { is_boolean => 1 },
132     '+archived'              => { is_boolean => 1 }
133 );
134
135 sub koha_objects_class {
136     'Koha::Account::CreditTypes';
137 }
138 sub koha_object_class {
139     'Koha::Account::CreditType';
140 }
141
142 1;