From bb63c4f0c60b6933f4b82e2290d3e458b815f547 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 Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart --- ...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 0000000..1477763 --- /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 76a989f..0000000 --- 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.9.3