From f4a0acfe5d8cdd08e16523e8aae68cce71854596 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 --- .../atomicupdate/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 0000000..d781f71 --- /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 e9c60aa..d3e5158 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.1.4