Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

Commit

Permalink
Oracle: nsm_user_preference use upref_id instead of upref_modified fo…
Browse files Browse the repository at this point in the history
…r duplicate check #3870

Refs #3870 #3868
  • Loading branch information
Tommi2Day authored and lazyfrosch committed Mar 25, 2013
1 parent 1f6681c commit 88cfa27
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions etc/schema/updates/oracle/oracle_v1-8-0_to_v1-8-3.sql
Expand Up @@ -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)
Expand Down

0 comments on commit 88cfa27

Please sign in to comment.