← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19374: Stop creating unique constraints for uid in code, taken care of by hibernate

 

------------------------------------------------------------
revno: 19374
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-06-12 22:55:08 +0200
message:
  Stop creating unique constraints for uid in code, taken care of by hibernate
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/IdentityPopulator.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/IdentityPopulator.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/IdentityPopulator.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/IdentityPopulator.java	2015-06-12 20:55:08 +0000
@@ -145,10 +145,6 @@
 
         log.debug( "Identifiable properties updated" );
 
-        createUidConstraints();
-
-        log.debug( "Identifiable constraints updated" );
-
         createOrgUnitUuids();
 
         log.debug( "Organisation unit uuids updated" );
@@ -183,23 +179,6 @@
         return TABLE_ID_MAP.containsKey( table ) ? TABLE_ID_MAP.get( table ) : (table + "id");
     }
 
-    private void createUidConstraints()
-    {
-        for ( String table : tables )
-        {
-            try
-            {
-                final String sql = "ALTER TABLE " + table + " ADD CONSTRAINT " + table + "_uid_key UNIQUE(uid)";
-                jdbcTemplate.execute( sql );
-            }
-            catch ( Exception ex ) // Log and continue, will fail after first run
-            {
-                log.debug( "Could not create uid constraint on table " + table +
-                    ", might already be created or column contains duplicates", ex );
-            }
-        }
-    }
-
     private void createOrgUnitUuids()
     {
         try