From ed94450bd6bfa509b96d0c2dcd77a3b1cf20086c Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Sun, 11 Jun 2017 19:19:38 +0000 Subject: [PATCH] Bug 10132: Database changes Signed-off-by: Hugo Agud Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart --- .../bug10132_add_marcorgcode_to_library.perl | 10 ++++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 11 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug10132_add_marcorgcode_to_library.perl diff --git a/installer/data/mysql/atomicupdate/bug10132_add_marcorgcode_to_library.perl b/installer/data/mysql/atomicupdate/bug10132_add_marcorgcode_to_library.perl new file mode 100644 index 0000000000..d781f71c1f --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug10132_add_marcorgcode_to_library.perl @@ -0,0 +1,10 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + + if( !column_exists( 'branches', 'marcorgcode' ) ) { + $dbh->do( "ALTER TABLE branches ADD COLUMN marcorgcode VARCHAR(16) default NULL AFTER geolocation" ); + } + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 10132 - MARCOrgCode on branch level)\n"; +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index e227125ff1..bb222ef90d 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -280,6 +280,7 @@ CREATE TABLE `branches` ( -- information about your libraries or branches are st `branchnotes` mediumtext, -- notes related to your library or branch opac_info text, -- HTML that displays in OPAC `geolocation` VARCHAR(255) default NULL, -- geolocation of your library + `marcorgcode` VARCHAR(16) default NULL, -- MARC Organization Code, see http://www.loc.gov/marc/organizations/orgshome.html, when empty defaults to syspref MARCOrgCode PRIMARY KEY (`branchcode`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- 2.39.5