From e062b4f8547f9fe0339920d5e93eb832edff9dec Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Date: Wed, 25 Nov 2015 13:17:52 +0000
Subject: [PATCH] Bug 11431: (follow-up) Update database

This patch specifies the collate for the new audio_alerts table to the updatedb entry.
---
 installer/data/mysql/kohastructure.sql | 2 +-
 installer/data/mysql/updatedatabase.pl | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql
index 146565c..fa44ff7 100644
--- a/installer/data/mysql/kohastructure.sql
+++ b/installer/data/mysql/kohastructure.sql
@@ -3594,7 +3594,7 @@ CREATE TABLE audio_alerts (
   sound varchar(255) NOT NULL,
   PRIMARY KEY (id),
   KEY precedence (precedence)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8  COLLATE=utf8_unicode_ci;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
 
 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
 /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index 6ba8e4d..3d52d39 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -11268,11 +11268,11 @@ if ( CheckVersion($DBversion) ) {
             sound varchar(255) NOT NULL,
             PRIMARY KEY (id),
             KEY precedence (precedence)
-        ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+        ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
     });
 
     $dbh->do(q{
-        INSERT INTO audio_alerts VALUES
+        INSERT IGNORE INTO audio_alerts VALUES
         (1, 1, '.audio-alert-action', 'opening.ogg'),
         (2, 2, '.audio-alert-warning', 'critical.ogg'),
         (3, 3, '.audio-alert-success', 'beep.ogg');
-- 
2.1.0