Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: wrote "complicated" SQL

...

When upgrading a current installation of openmrs, all rows will get a uuid generated for them. If you are using mysql, then openmrs uses the uuid() method during the update to do something like:

Panel

update obs set UPDATE obs SET uuid = uuid() where  WHERE uuid is null;

If you are using a DB other than mysql, most likely it also has a function to create a uuid.  If not, then there is a java routine that runs and uses the java implementation of UUID generation. This is considerably slower.

There have been issues with mysql on windows and not getting unique uuids [1] . To find those duplicates, you can run this sql:

Panel

SELECT uuid, count(uuid) UPDATE obs SET uuid=uuid() WHERE uuid in (SELECT uuid FROM obs GROUP BY uuid HAVING (count(uuid)>1);

...

UUIDs and the OpenMRS API

...