Author: bleny Date: 2014-05-19 14:53:26 +0200 (Mon, 19 May 2014) New Revision: 1963 Url: http://forge.codelutin.com/projects/wao/repository/revisions/1963 Log: fixes #5106 change some logins and add constraint Modified: trunk/wao-persistence/src/main/resources/db/migration/V4_0__clean_database.sql Modified: trunk/wao-persistence/src/main/resources/db/migration/V4_0__clean_database.sql =================================================================== --- trunk/wao-persistence/src/main/resources/db/migration/V4_0__clean_database.sql 2014-05-19 12:39:04 UTC (rev 1962) +++ trunk/wao-persistence/src/main/resources/db/migration/V4_0__clean_database.sql 2014-05-19 12:53:26 UTC (rev 1963) @@ -13,9 +13,8 @@ -- Doublons dans la table wao user -update waouser -set login = login || '2' -where login in (select login from waoUser group by login having count(topiaId) > 1) - and company='fr.ifremer.wao.entity.Company#1264666646342#0.19971470116106205' +update waouser w +set login = login || (select count(topiaId) from waouser w2 where w.login = w2.login and w.topiaId < w2.topiaId) +where login in (select login from waoUser group by login having count(topiaId) > 1); alter table waouser add constraint login_uniqueness unique (login);
participants (1)
-
bleny@users.forge.codelutin.com