From c29dab426687654a98c085ef952bf9eae23b2ab9 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 20 Jan 2017 10:59:27 -0300 Subject: [PATCH] Bug 13757: (QA followup) Check DB structure before altering table Signed-off-by: Tomas Cohen Arazi --- ...13757-add_opac_editable_to_borrower_attribute_types.perl | 13 +++++++++++++ ..._13757-add_opac_editable_to_borrower_attribute_types.sql | 1 - 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_13757-add_opac_editable_to_borrower_attribute_types.perl delete mode 100644 installer/data/mysql/atomicupdate/bug_13757-add_opac_editable_to_borrower_attribute_types.sql diff --git a/installer/data/mysql/atomicupdate/bug_13757-add_opac_editable_to_borrower_attribute_types.perl b/installer/data/mysql/atomicupdate/bug_13757-add_opac_editable_to_borrower_attribute_types.perl new file mode 100644 index 0000000000..1477763409 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_13757-add_opac_editable_to_borrower_attribute_types.perl @@ -0,0 +1,13 @@ +$DBversion = "16.12.00.XXX"; +if ( CheckVersion($DBversion) ) { + unless ( column_exists( 'borrower_attribute_types', 'opac_editable' ) ) + { + $dbh->do(q{ + ALTER TABLE borrower_attribute_types + ADD COLUMN `opac_editable` tinyint(1) NOT NULL default 0 AFTER `opac_display` + }); + } + + print "Upgrade to $DBversion done (Bug 13757: Make patron attributes editable in the opac if set to 'editable in OPAC'\n"; + SetVersion($DBversion); +} diff --git a/installer/data/mysql/atomicupdate/bug_13757-add_opac_editable_to_borrower_attribute_types.sql b/installer/data/mysql/atomicupdate/bug_13757-add_opac_editable_to_borrower_attribute_types.sql deleted file mode 100644 index 76a989fa63..0000000000 --- a/installer/data/mysql/atomicupdate/bug_13757-add_opac_editable_to_borrower_attribute_types.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE borrower_attribute_types ADD COLUMN `opac_editable` tinyint(1) NOT NULL default 0 AFTER `opac_display`; -- 2.11.0