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

(-)a/Koha/Schema/Result/Configuration.pm (+212 lines)
Line 0 Link Here
1
use utf8;
2
package Koha::Schema::Result::Configuration;
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::Configuration
10
11
=cut
12
13
use strict;
14
use warnings;
15
16
use base 'DBIx::Class::Core';
17
18
=head1 TABLE: C<configurations>
19
20
=cut
21
22
__PACKAGE__->table("configurations");
23
24
=head1 ACCESSORS
25
26
=head2 id
27
28
  data_type: 'integer'
29
  is_auto_increment: 1
30
  is_nullable: 0
31
32
Unique ID of the configuration entry
33
34
=head2 library_id
35
36
  data_type: 'varchar'
37
  is_foreign_key: 1
38
  is_nullable: 1
39
  size: 10
40
41
Internal identifier for the library the config applies to. NULL means global
42
43
=head2 category_id
44
45
  data_type: 'varchar'
46
  is_foreign_key: 1
47
  is_nullable: 1
48
  size: 10
49
50
Internal identifier for the category the config applies to. NULL means global
51
52
=head2 item_type
53
54
  data_type: 'varchar'
55
  is_foreign_key: 1
56
  is_nullable: 1
57
  size: 10
58
59
Internal identifier for the item type the config applies to. NULL means global
60
61
=head2 name
62
63
  data_type: 'varchar'
64
  is_nullable: 0
65
  size: 32
66
67
Configuration entry name
68
69
=head2 value
70
71
  data_type: 'mediumtext'
72
  is_nullable: 1
73
74
Configuration entry value
75
76
=head2 type
77
78
  data_type: 'enum'
79
  default_value: 'text'
80
  extra: {list => ["text","boolean","integer"]}
81
  is_nullable: 0
82
83
Configuration entry type
84
85
=cut
86
87
__PACKAGE__->add_columns(
88
  "id",
89
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
90
  "library_id",
91
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
92
  "category_id",
93
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
94
  "item_type",
95
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
96
  "name",
97
  { data_type => "varchar", is_nullable => 0, size => 32 },
98
  "value",
99
  { data_type => "mediumtext", is_nullable => 1 },
100
  "type",
101
  {
102
    data_type => "enum",
103
    default_value => "text",
104
    extra => { list => ["text", "boolean", "integer"] },
105
    is_nullable => 0,
106
  },
107
);
108
109
=head1 PRIMARY KEY
110
111
=over 4
112
113
=item * L</id>
114
115
=back
116
117
=cut
118
119
__PACKAGE__->set_primary_key("id");
120
121
=head1 UNIQUE CONSTRAINTS
122
123
=head2 C<library_id>
124
125
=over 4
126
127
=item * L</library_id>
128
129
=item * L</category_id>
130
131
=item * L</item_type>
132
133
=item * L</name>
134
135
=back
136
137
=cut
138
139
__PACKAGE__->add_unique_constraint(
140
  "library_id",
141
  ["library_id", "category_id", "item_type", "name"],
142
);
143
144
=head1 RELATIONS
145
146
=head2 category
147
148
Type: belongs_to
149
150
Related object: L<Koha::Schema::Result::Category>
151
152
=cut
153
154
__PACKAGE__->belongs_to(
155
  "category",
156
  "Koha::Schema::Result::Category",
157
  { categorycode => "category_id" },
158
  {
159
    is_deferrable => 1,
160
    join_type     => "LEFT",
161
    on_delete     => "CASCADE",
162
    on_update     => "CASCADE",
163
  },
164
);
165
166
=head2 item_type
167
168
Type: belongs_to
169
170
Related object: L<Koha::Schema::Result::Itemtype>
171
172
=cut
173
174
__PACKAGE__->belongs_to(
175
  "item_type",
176
  "Koha::Schema::Result::Itemtype",
177
  { itemtype => "item_type" },
178
  {
179
    is_deferrable => 1,
180
    join_type     => "LEFT",
181
    on_delete     => "CASCADE",
182
    on_update     => "CASCADE",
183
  },
184
);
185
186
=head2 library
187
188
Type: belongs_to
189
190
Related object: L<Koha::Schema::Result::Branch>
191
192
=cut
193
194
__PACKAGE__->belongs_to(
195
  "library",
196
  "Koha::Schema::Result::Branch",
197
  { branchcode => "library_id" },
198
  {
199
    is_deferrable => 1,
200
    join_type     => "LEFT",
201
    on_delete     => "CASCADE",
202
    on_update     => "CASCADE",
203
  },
204
);
205
206
207
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-12-23 17:55:18
208
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1MY5Ng3sr+38JUx1MtKWIA
209
210
211
# You can replace this text with custom code or comments, and it will be preserved on regeneration
212
1;
(-)a/installer/data/mysql/atomicupdate/bug_26129_configurations_table.pl (+36 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "26129",
5
    description => "Add a new 'configurations' table",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ($dbh)  = @$args{qw(dbh out)};
9
10
        unless ( TableExists('configurations') ) {
11
            $dbh->do(
12
                q{
13
                CREATE TABLE `configurations` (
14
                    `id` INT(11) NOT NULL AUTO_INCREMENT COMMENT 'Unique ID of the configuration entry',
15
                    `library_id` VARCHAR(10) NULL DEFAULT NULL COMMENT 'Internal identifier for the library the config applies to. NULL means global',
16
                    `category_id` VARCHAR(10) NULL DEFAULT NULL COMMENT 'Internal identifier for the category the config applies to. NULL means global',
17
                    `item_type` VARCHAR(10) NULL DEFAULT NULL COMMENT 'Internal identifier for the item type the config applies to. NULL means global',
18
                    `name` VARCHAR(32) NOT NULL COMMENT 'Configuration entry name',
19
                    `value` MEDIUMTEXT NULL DEFAULT NULL COMMENT 'Configuration entry value',
20
                    `type` ENUM('text', 'boolean', 'integer') NOT NULL DEFAULT 'text' COMMENT 'Configuration entry type',
21
                    PRIMARY KEY (`id`),
22
                    KEY `library_id_idx` (`library_id`),
23
                    KEY `category_id_idx` (`category_id`),
24
                    KEY `item_type_idx` (`item_type`),
25
                    KEY `name_idx` (`name`),
26
                    KEY `type_idx` (`type`),
27
                    UNIQUE (`library_id`, `category_id`, `item_type`, `name`),
28
                    CONSTRAINT `library_id_fk` FOREIGN KEY (`library_id`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
29
                    CONSTRAINT `category_id_fk` FOREIGN KEY (`category_id`) REFERENCES `categories` (`categorycode`) ON DELETE CASCADE ON UPDATE CASCADE,
30
                    CONSTRAINT `item_type_fk` FOREIGN KEY (`item_type`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE
31
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
32
            }
33
            );
34
        }
35
    },
36
};
(-)a/installer/data/mysql/kohastructure.sql (-1 / +26 lines)
Lines 2028-2033 CREATE TABLE `columns_settings` ( Link Here
2028
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
2028
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
2029
/*!40101 SET character_set_client = @saved_cs_client */;
2029
/*!40101 SET character_set_client = @saved_cs_client */;
2030
2030
2031
--
2032
-- Table structure for table `configurations`
2033
--
2034
2035
DROP TABLE IF EXISTS `configurations`;
2036
CREATE TABLE `configurations` (
2037
    `id` INT(11) NOT NULL AUTO_INCREMENT COMMENT 'Unique ID of the configuration entry',
2038
    `library_id` VARCHAR(10) NULL DEFAULT NULL COMMENT 'Internal identifier for the library the config applies to. NULL means global',
2039
    `category_id` VARCHAR(10) NULL DEFAULT NULL COMMENT 'Internal identifier for the category the config applies to. NULL means global',
2040
    `item_type` VARCHAR(10) NULL DEFAULT NULL COMMENT 'Internal identifier for the item type the config applies to. NULL means global',
2041
    `name` VARCHAR(32) NOT NULL COMMENT 'Configuration entry name',
2042
    `value` MEDIUMTEXT NULL DEFAULT NULL COMMENT 'Configuration entry value',
2043
    `type` ENUM('text', 'boolean', 'integer') NOT NULL DEFAULT 'text' COMMENT 'Configuration entry type',
2044
    PRIMARY KEY (`id`),
2045
    KEY `library_id_idx` (`library_id`),
2046
    KEY `category_id_idx` (`category_id`),
2047
    KEY `item_type_idx` (`item_type`),
2048
    KEY `name_idx` (`name`),
2049
    KEY `type_idx` (`type`),
2050
    UNIQUE (`library_id`, `category_id`, `item_type`, `name`),
2051
    CONSTRAINT `library_id_fk` FOREIGN KEY (`library_id`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
2052
    CONSTRAINT `category_id_fk` FOREIGN KEY (`category_id`) REFERENCES `categories` (`categorycode`) ON DELETE CASCADE ON UPDATE CASCADE,
2053
    CONSTRAINT `item_type_fk` FOREIGN KEY (`item_type`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE
2054
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
2055
2031
--
2056
--
2032
-- Table structure for table `course_instructors`
2057
-- Table structure for table `course_instructors`
2033
--
2058
--
Lines 5360-5365 CREATE TABLE `zebraqueue` ( Link Here
5360
  PRIMARY KEY (`id`),
5385
  PRIMARY KEY (`id`),
5361
  KEY `zebraqueue_lookup` (`server`,`biblio_auth_number`,`operation`,`done`)
5386
  KEY `zebraqueue_lookup` (`server`,`biblio_auth_number`,`operation`,`done`)
5362
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
5387
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
5388
5363
/*!40101 SET character_set_client = @saved_cs_client */;
5389
/*!40101 SET character_set_client = @saved_cs_client */;
5364
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
5390
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
5365
5391
5366
- 

Return to bug 26129