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

(-)a/Koha/Schema/Result/ItemEditorTemplate.pm (+124 lines)
Line 0 Link Here
1
use utf8;
2
package Koha::Schema::Result::ItemEditorTemplate;
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::ItemEditorTemplate
10
11
=cut
12
13
use strict;
14
use warnings;
15
16
use base 'DBIx::Class::Core';
17
18
=head1 TABLE: C<item_editor_templates>
19
20
=cut
21
22
__PACKAGE__->table("item_editor_templates");
23
24
=head1 ACCESSORS
25
26
=head2 id
27
28
  data_type: 'integer'
29
  is_auto_increment: 1
30
  is_nullable: 0
31
32
id for the template
33
34
=head2 borrowernumber
35
36
  data_type: 'integer'
37
  is_foreign_key: 1
38
  is_nullable: 1
39
40
creator of this template
41
42
=head2 name
43
44
  data_type: 'mediumtext'
45
  is_nullable: 0
46
47
template name
48
49
=head2 is_shared
50
51
  data_type: 'tinyint'
52
  default_value: 0
53
  is_nullable: 0
54
55
controls if template is shared
56
57
=head2 contents
58
59
  data_type: 'longtext'
60
  is_nullable: 0
61
62
json encoded template data
63
64
=cut
65
66
__PACKAGE__->add_columns(
67
  "id",
68
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
69
  "borrowernumber",
70
  { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
71
  "name",
72
  { data_type => "mediumtext", is_nullable => 0 },
73
  "is_shared",
74
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
75
  "contents",
76
  { data_type => "longtext", is_nullable => 0 },
77
);
78
79
=head1 PRIMARY KEY
80
81
=over 4
82
83
=item * L</id>
84
85
=back
86
87
=cut
88
89
__PACKAGE__->set_primary_key("id");
90
91
=head1 RELATIONS
92
93
=head2 borrowernumber
94
95
Type: belongs_to
96
97
Related object: L<Koha::Schema::Result::Borrower>
98
99
=cut
100
101
__PACKAGE__->belongs_to(
102
  "borrowernumber",
103
  "Koha::Schema::Result::Borrower",
104
  { borrowernumber => "borrowernumber" },
105
  {
106
    is_deferrable => 1,
107
    join_type     => "LEFT",
108
    on_delete     => "SET NULL",
109
    on_update     => "CASCADE",
110
  },
111
);
112
113
114
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-09-28 16:49:35
115
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7JIe4z78F9oMOAnAZdqmtA
116
117
sub koha_object_class {
118
    'Koha::Item::Template';
119
}
120
sub koha_objects_class {
121
    'Koha::Item::Templates';
122
}
123
124
1;
(-)a/installer/data/mysql/atomicupdate/bug_24606.pl (+24 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "24606",
5
    description => "Add new table item_editor_templates",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
10
        unless( TableExists( 'item_editor_templates' ) ) {
11
            $dbh->do(q{
12
                CREATE TABLE `item_editor_templates` (
13
                  `id` INT(11) NOT NULL auto_increment COMMENT "id for the template",
14
                  `borrowernumber` int(11) DEFAULT NULL COMMENT "creator of this template",
15
                  `name` MEDIUMTEXT NOT NULL COMMENT "template name",
16
                  `is_shared` TINYINT(1) NOT NULL DEFAULT 0 COMMENT "controls if template is shared",
17
                  `contents` LONGTEXT NOT NULL COMMENT "json encoded template data",
18
                  PRIMARY KEY  (`id`),
19
                  CONSTRAINT `bn` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE
20
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
21
            });
22
        }
23
    },
24
};
(-)a/installer/data/mysql/kohastructure.sql (-1 / +15 lines)
Lines 1915-1920 CREATE TABLE `item_group_items` ( Link Here
1915
  CONSTRAINT `item_group_items_gifk_1` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE CASCADE ON UPDATE CASCADE
1915
  CONSTRAINT `item_group_items_gifk_1` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE CASCADE ON UPDATE CASCADE
1916
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1916
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1917
1917
1918
--
1919
-- Table structure for table `item_editor_templates`
1920
--
1921
1922
DROP TABLE IF EXISTS `item_editor_templates`;
1923
CREATE TABLE `item_editor_templates` (
1924
  `id` INT(11) NOT NULL auto_increment COMMENT "id for the template",
1925
  `borrowernumber` int(11) DEFAULT NULL COMMENT "creator of this template",
1926
  `name` MEDIUMTEXT NOT NULL COMMENT "template name",
1927
  `is_shared` TINYINT(1) NOT NULL DEFAULT 0 COMMENT "controls if template is shared",
1928
  `contents` LONGTEXT NOT NULL COMMENT "json encoded template data",
1929
  PRIMARY KEY  (`id`),
1930
  CONSTRAINT `bn` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE
1931
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1932
1918
--
1933
--
1919
-- Table structure for table `club_holds`
1934
-- Table structure for table `club_holds`
1920
--
1935
--
1921
- 

Return to bug 24606