diff --git a/src/object-store/object_store.cpp b/src/object-store/object_store.cpp index 1f99c400..bb713e4c 100644 --- a/src/object-store/object_store.cpp +++ b/src/object-store/object_store.cpp @@ -387,9 +387,9 @@ bool ObjectStore::update_realm_with_schema(Group *group, // apply the migration block if provided and there's any old data if (get_schema_version(group) != ObjectStore::NotVersioned) { migration(group, schema); - } - validate_primary_column_uniqueness(group, schema); + validate_primary_column_uniqueness(group, schema); + } set_schema_version(group, version); return true;