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

(-)a/Koha/Schema/Result/BiblioFramework.pm (-9 / +23 lines)
Lines 1-4 Link Here
1
use utf8;
1
use utf8;
2
2
package Koha::Schema::Result::BiblioFramework;
3
package Koha::Schema::Result::BiblioFramework;
3
4
4
# Created by DBIx::Class::Schema::Loader
5
# Created by DBIx::Class::Schema::Loader
Lines 41-53 the unique code assigned to the framework Link Here
41
42
42
the description/name given to the framework
43
the description/name given to the framework
43
44
45
=head2 is_fast_add
46
47
  data_type: 'tinyint'
48
  default_value: 0
49
  is_nullable: 0
50
51
the ability to be used as a Fast Add framework
52
44
=cut
53
=cut
45
54
46
__PACKAGE__->add_columns(
55
__PACKAGE__->add_columns(
47
  "frameworkcode",
56
    "frameworkcode",
48
  { data_type => "varchar", default_value => "", is_nullable => 0, size => 4 },
57
    { data_type => "varchar", default_value => "", is_nullable => 0, size => 4 },
49
  "frameworktext",
58
    "frameworktext",
50
  { data_type => "varchar", default_value => "", is_nullable => 0, size => 255 },
59
    { data_type => "varchar", default_value => "", is_nullable => 0, size => 255 },
60
    "is_fast_add",
61
    { data_type => "tinyint", default_value => 0, is_nullable => 0 },
51
);
62
);
52
63
53
=head1 PRIMARY KEY
64
=head1 PRIMARY KEY
Lines 62-70 __PACKAGE__->add_columns( Link Here
62
73
63
__PACKAGE__->set_primary_key("frameworkcode");
74
__PACKAGE__->set_primary_key("frameworkcode");
64
75
65
76
# Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-10-30 18:56:51
66
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
77
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GTnC4ZNUn+hFvXTjubfBXg
67
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YdCNaeY5v1WcfcDuA6xE0w
68
78
69
# FIXME This should not be needed, we need to add the FK at DB level
79
# FIXME This should not be needed, we need to add the FK at DB level
70
# It cannot be done now because the default framework (frameworkcode=='')
80
# It cannot be done now because the default framework (frameworkcode=='')
Lines 72-79 __PACKAGE__->set_primary_key("frameworkcode"); Link Here
72
__PACKAGE__->has_many(
82
__PACKAGE__->has_many(
73
    "marc_tag_structure",
83
    "marc_tag_structure",
74
    "Koha::Schema::Result::MarcTagStructure",
84
    "Koha::Schema::Result::MarcTagStructure",
75
    { "foreign.frameworkcode" => "self.frameworkcode"},
85
    { "foreign.frameworkcode" => "self.frameworkcode" },
76
    { cascade_copy => 0, cascade_delete => 0 },
86
    { cascade_copy            => 0, cascade_delete => 0 },
87
);
88
89
__PACKAGE__->add_columns(
90
    '+is_fast_add' => { is_boolean => 1 },
77
);
91
);
78
92
79
# You can replace this text with custom content, and it will be preserved on regeneration
93
# You can replace this text with custom content, and it will be preserved on regeneration
(-)a/installer/data/mysql/atomicupdate/bug_32773.pl (-7 / +9 lines)
Lines 9-25 return { Link Here
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
10
11
        try {
11
        try {
12
            $dbh->do(q{
12
            $dbh->do(
13
                q{
13
                ALTER TABLE biblio_framework
14
                ALTER TABLE biblio_framework
14
                ADD COLUMN is_fast_add TINYINT(1) NOT NULL DEFAULT 0
15
                ADD COLUMN is_fast_add TINYINT(1) NOT NULL DEFAULT 0
15
                AFTER frameworktext;
16
                AFTER frameworktext;
16
            });
17
            }
18
            );
17
            say $out "Added column 'biblio_framework.is_fast_add'";
19
            say $out "Added column 'biblio_framework.is_fast_add'";
18
            $dbh->do(q{
20
            $dbh->do(
21
                q{
19
                UPDATE biblio_framework SET is_fast_add = 1 where frameworkcode = 'FA';
22
                UPDATE biblio_framework SET is_fast_add = 1 where frameworkcode = 'FA';
20
            });
23
            }
21
        }
24
            );
22
        catch {
25
        } catch {
23
            say_failure( $out, "Database modification failed with errors: $_" );
26
            say_failure( $out, "Database modification failed with errors: $_" );
24
        };
27
        };
25
    },
28
    },
26
- 

Return to bug 32773