From 54dff5c944ea01b1240e85da292c07b7cd3a6ade Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 23 Jan 2019 13:55:13 +0000 Subject: [PATCH] Bug 17047: DBRev 18.12.00.008 Signed-off-by: Nick Clemens --- Koha.pm | 2 +- .../atomicupdate/mana_01-add_mana_id.perl | 13 ---------- .../atomicupdate/mana_02-add_Mana_syspref.sql | 2 -- .../mana_03-add_mana_autoshare.sql | 2 -- .../atomicupdate/mana_04-add_mana_token.sql | 2 -- .../data/mysql/atomicupdate/skeleton.perl | 2 +- installer/data/mysql/updatedatabase.pl | 25 +++++++++++++++++++ 7 files changed, 27 insertions(+), 21 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/mana_01-add_mana_id.perl delete mode 100644 installer/data/mysql/atomicupdate/mana_02-add_Mana_syspref.sql delete mode 100644 installer/data/mysql/atomicupdate/mana_03-add_mana_autoshare.sql delete mode 100644 installer/data/mysql/atomicupdate/mana_04-add_mana_token.sql diff --git a/Koha.pm b/Koha.pm index f0c4c775ce..78d50bf41c 100644 --- a/Koha.pm +++ b/Koha.pm @@ -29,7 +29,7 @@ use vars qw{ $VERSION }; # - #4 : the developer version. The 4th number is the database subversion. # used by developers when the database changes. updatedatabase take care of the changes itself # and is automatically called by Auth.pm when needed. -$VERSION = "18.12.00.007"; +$VERSION = "18.12.00.008"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/mana_01-add_mana_id.perl b/installer/data/mysql/atomicupdate/mana_01-add_mana_id.perl deleted file mode 100644 index 1e5fdbd2b3..0000000000 --- a/installer/data/mysql/atomicupdate/mana_01-add_mana_id.perl +++ /dev/null @@ -1,13 +0,0 @@ -$DBversion = 'XXX'; -if( CheckVersion( $DBversion ) ) { - if( !column_exists( 'subscription', 'mana_id' ) ) { - $dbh->do( "ALTER TABLE subscription ADD mana_id int(11) NULL DEFAULT NULL" ); - } - - if( !column_exists( 'saved_sql', 'mana_id' ) ) { - $dbh->do( "ALTER TABLE saved_sql ADD mana_id int(11) NULL DEFAULT NULL" ); - } - - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug 17047 - Add column mana_id in subscription and saved_sql tables)\n"; -} diff --git a/installer/data/mysql/atomicupdate/mana_02-add_Mana_syspref.sql b/installer/data/mysql/atomicupdate/mana_02-add_Mana_syspref.sql deleted file mode 100644 index 9373076fb1..0000000000 --- a/installer/data/mysql/atomicupdate/mana_02-add_Mana_syspref.sql +++ /dev/null @@ -1,2 +0,0 @@ -INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES -('Mana','2',NULL,'request to Mana Webservice. Mana centralize common information between other Koha to facilitate the creation of new subscriptions, vendors, report queries etc... You can search, share, import and comment the content of Mana.','YesNo'); diff --git a/installer/data/mysql/atomicupdate/mana_03-add_mana_autoshare.sql b/installer/data/mysql/atomicupdate/mana_03-add_mana_autoshare.sql deleted file mode 100644 index a8b3519bcc..0000000000 --- a/installer/data/mysql/atomicupdate/mana_03-add_mana_autoshare.sql +++ /dev/null @@ -1,2 +0,0 @@ -INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES -('AutoShareWithMana','','','defines datas automatically shared with mana','multiple'); diff --git a/installer/data/mysql/atomicupdate/mana_04-add_mana_token.sql b/installer/data/mysql/atomicupdate/mana_04-add_mana_token.sql deleted file mode 100644 index 3c94ccddd7..0000000000 --- a/installer/data/mysql/atomicupdate/mana_04-add_mana_token.sql +++ /dev/null @@ -1,2 +0,0 @@ -INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES -('ManaToken','',NULL,'Security token used for authentication on Mana KB service (anti spam)','Textarea'); diff --git a/installer/data/mysql/atomicupdate/skeleton.perl b/installer/data/mysql/atomicupdate/skeleton.perl index c63e6ebca7..a10fa63ab3 100644 --- a/installer/data/mysql/atomicupdate/skeleton.perl +++ b/installer/data/mysql/atomicupdate/skeleton.perl @@ -1,4 +1,4 @@ -$DBversion = 'XXX'; +$DBversion = 'XXX'; # will be replaced by the RM if( CheckVersion( $DBversion ) ) { # you can use $dbh here like: # $dbh->do( "ALTER TABLE biblio ADD COLUMN badtaste int" ); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index b4d246ab85..ffbfba57fa 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -17244,6 +17244,31 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 21753: Drop chargename from issuingrules )\n"; } +$DBversion = '18.12.00.008'; +if( CheckVersion( $DBversion ) ) { + if( !column_exists( 'subscription', 'mana_id' ) ) { + $dbh->do( "ALTER TABLE subscription ADD mana_id int(11) NULL DEFAULT NULL" ); + } + + if( !column_exists( 'saved_sql', 'mana_id' ) ) { + $dbh->do( "ALTER TABLE saved_sql ADD mana_id int(11) NULL DEFAULT NULL" ); + } + $dbh->do(q{ + INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES + ('Mana','2',NULL,'request to Mana Webservice. Mana centralize common information between other Koha to facilitate the creation of new subscriptions, vendors, report queries etc... You can search, share, import and comment the content of Mana.','YesNo'); + }); + $dbh->do(q{ + INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES + ('AutoShareWithMana','','','defines datas automatically shared with mana','multiple'); + }); + $dbh->do(q{ + INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES + ('ManaToken','',NULL,'Security token used for authentication on Mana KB service (anti spam)','Textarea'); + }); + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 17047 - Mana knowledge base)\n"; +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 2.39.5