[icinga-checkins] icinga.org: icinga-web/r1.8: Oracle: nsm_user_preference use upref_id instead of upref_modified for duplicate check #3870

git at icinga.org git at icinga.org
Mon Mar 25 14:53:36 CET 2013


Module: icinga-web
Branch: r1.8
Commit: 88cfa2730cc8e8f6178b1865b3a45a6137c7b871
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=88cfa2730cc8e8f6178b1865b3a45a6137c7b871

Author: Thomas Dressler <tdressler at tdressler.net>
Date:   Mon Mar 18 20:46:45 2013 +0100

Oracle: nsm_user_preference use upref_id instead of upref_modified for duplicate check #3870
Refs #3870 #3868

---

 .../updates/oracle/oracle_v1-8-0_to_v1-8-3.sql     |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/etc/schema/updates/oracle/oracle_v1-8-0_to_v1-8-3.sql b/etc/schema/updates/oracle/oracle_v1-8-0_to_v1-8-3.sql
index c5f829c..26f519c 100644
--- a/etc/schema/updates/oracle/oracle_v1-8-0_to_v1-8-3.sql
+++ b/etc/schema/updates/oracle/oracle_v1-8-0_to_v1-8-3.sql
@@ -17,11 +17,11 @@ alter table nsm_user_preference drop constraint nsm_user_pref_userid_key_uq drop
 whenever sqlerror exit failure
 
 
-/* delete duplicates ifirst if any and than add unique key for preference user_id and key  #3870 */
+/* delete duplicates first if any and than add unique key for preference user_id and key  #3870 */
 delete from nsm_user_preference ud
 where 
-  upref_modified <
-  (select max(upref_modified) from nsm_user_preference ur
+  upref_id <
+  (select max(upref_id) from nsm_user_preference ur
     where ud.upref_user_id=ur.upref_user_id
       and ud.upref_key=ur.upref_key);
 alter table nsm_user_preference add constraint nsm_user_pref_userid_key_uq UNIQUE (upref_user_id, upref_key)





More information about the icinga-checkins mailing list