From c32ebd2c071ee3c63cf94a4e99610bcf4f202636 Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Fri, 1 Dec 2023 16:29:46 +0000 Subject: [PATCH] Bug 35471: Add column parent_frameworkcode to table biblio_framework Sponsored-by: Hypernova Oy --- .../add_framework_parent_field.pl | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/add_framework_parent_field.pl diff --git a/installer/data/mysql/atomicupdate/add_framework_parent_field.pl b/installer/data/mysql/atomicupdate/add_framework_parent_field.pl new file mode 100755 index 0000000000..768d521875 --- /dev/null +++ b/installer/data/mysql/atomicupdate/add_framework_parent_field.pl @@ -0,0 +1,23 @@ +use Modern::Perl; + +return { + bug_number => "35471", + description => "Add column parent_frameworkcode to table biblio_framework", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + # Do you stuffs here + $dbh->do( + q{ + ALTER TABLE biblio_framework + ADD COLUMN parent_frameworkcode VARCHAR(4) DEFAULT NULL AFTER frameworkcode, + ADD CONSTRAINT biblio_framework_fk_1 FOREIGN KEY (parent_frameworkcode) REFERENCES biblio_framework (frameworkcode) ON DELETE SET NULL ON UPDATE CASCADE + } + ); + + # Print useful stuff here + # tables + say $out "Added column 'parent_frameworkcode' to table 'biblio_framework'"; + }, +}; -- 2.34.1