r1940 - trunk/wao-persistence/src/main/resources/db/migration
Author: bleny Date: 2014-05-14 17:25:19 +0200 (Wed, 14 May 2014) New Revision: 1940 Url: http://forge.codelutin.com/projects/wao/repository/revisions/1940 Log: refs #4481 do not remove tms_version in 4.0 migration, wait for 4.1 Added: trunk/wao-persistence/src/main/resources/db/migration/V4_0__clean_database.sql trunk/wao-persistence/src/main/resources/db/migration/V4_1__clean_database.sql Removed: trunk/wao-persistence/src/main/resources/db/migration/V4_0__clean-database.sql Deleted: 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-14 13:28:09 UTC (rev 1939) +++ trunk/wao-persistence/src/main/resources/db/migration/V4_0__clean-database.sql 2014-05-14 15:25:19 UTC (rev 1940) @@ -1,18 +0,0 @@ - --- we no longer user topia migration service -drop table tms_version; - --- Il y a des doublons dans la table qui stocke les informations sur le lien entre ligne du plan et navires éligibles. --- Un même navire peut être associé en tant qu'éligible plusieurs fois. --- On rectifie le tir en supprimant les doublons et en ajoutant une contrainte d'unicité - -delete from elligibleboat -where topiaId in ( select eb.topiaId - from elligibleboat eb - where eb.sampleRow in (select eb2.samplerow from elligibleboat eb2 group by samplerow, boat having count(topiaId) > 1) - and eb.boat in (select eb2.boat from elligibleboat eb2 group by samplerow, boat having count(topiaId) > 1) - and eb.topiaId not in (select eb2.topiaId from elligibleboat eb2 where eb2.boat = eb.boat and eb2.sampleRow = eb.sampleRow order by topiacreatedate desc limit 1)); - -alter table elligibleboat add constraint samplerow_boat_uniqueness unique (boat, samplerow); - - Copied: trunk/wao-persistence/src/main/resources/db/migration/V4_0__clean_database.sql (from rev 1927, 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 (rev 0) +++ trunk/wao-persistence/src/main/resources/db/migration/V4_0__clean_database.sql 2014-05-14 15:25:19 UTC (rev 1940) @@ -0,0 +1,12 @@ +-- Il y a des doublons dans la table qui stocke les informations sur le lien entre ligne du plan et navires éligibles. +-- Un même navire peut être associé en tant qu'éligible plusieurs fois. +-- On rectifie le tir en supprimant les doublons et en ajoutant une contrainte d'unicité + +delete from elligibleboat +where topiaId in ( select eb.topiaId + from elligibleboat eb + where eb.sampleRow in (select eb2.samplerow from elligibleboat eb2 group by samplerow, boat having count(topiaId) > 1) + and eb.boat in (select eb2.boat from elligibleboat eb2 group by samplerow, boat having count(topiaId) > 1) + and eb.topiaId not in (select eb2.topiaId from elligibleboat eb2 where eb2.boat = eb.boat and eb2.sampleRow = eb.sampleRow order by topiacreatedate desc limit 1)); + +alter table elligibleboat add constraint samplerow_boat_uniqueness unique (boat, samplerow); Added: trunk/wao-persistence/src/main/resources/db/migration/V4_1__clean_database.sql =================================================================== --- trunk/wao-persistence/src/main/resources/db/migration/V4_1__clean_database.sql (rev 0) +++ trunk/wao-persistence/src/main/resources/db/migration/V4_1__clean_database.sql 2014-05-14 15:25:19 UTC (rev 1940) @@ -0,0 +1,3 @@ + +-- we no longer user topia migration service +drop table tms_version;
participants (1)
-
bleny@users.forge.codelutin.com