message: Fix another potential issue around file format upgrade
diff: @@ -888,6 +888,7 @@ void Table::migrate_indexes(util::FunctionRef<void()> commit_and_continue)
  // This is information about origin/target tables in relation to links
  // This information is now held in "opposite" arrays directly in Table structure
  // At the same time the backlink columns are destroyed
  +// If there is no subspec, this stage is done
  void Table::migrate_subspec(util::FunctionRef<void()> commit_and_continue)
  {
  if (!m_spec.has_subspec())
  @@ -943,10 +944,14 @@ void Table::migrate_subspec(util::FunctionRef<void()> commit_and_continue)
  commit_and_continue();
  }
  -
  +// When pk_col value is 1, links have been converted.
  +// pk_col value will be set back to 0 when all objects are migrated.
  void Table::convert_links_from_ndx_to_key(util::FunctionRef<void()> commit_and_continue)
  {
  - if (ref_type top_ref = m_top.get_as_ref(top_position_for_columns)) {
  + ref_type top_ref = m_top.get_as_ref(top_position_for_columns);
  + bool done = m_top.get(top_position_for_pk_col);
  +
  + if (top_ref && !done) {
  bool changes = false;
  Array col_refs(m_alloc);
  col_refs.set_parent(&m_top, top_position_for_columns);
  @@ -1006,6 +1011,8 @@ void Table::convert_links_from_ndx_to_key(util::FunctionRef<void()> commit_and_c
  for_each_public_column(convert_links);
  if (changes) {
  + m_top.set(top_position_for_pk_col, 1); // Mark that we are done with this step
  +
  commit_and_continue();
  }
  }
  @@ -1387,7 +1394,7 @@ void Table::migrate_objects(util::FunctionRef<void()> commit_and_continue)
  if (obj_key.value > max_key_value) {
  max_key_value = obj_key.value;
  }
  - Obj obj = create_object(obj_key, init_values);
  + Obj obj = m_clusters.insert(obj_key, init_values);
  // Then update possible list types
  for (auto& it : list_accessors) {
  @@ -1541,6 +1548,7 @@ void Table::finalize_migration()
  if (ref) {
  Array::destroy_deep(ref, m_alloc);
  m_top.set(top_position_for_columns, 0);
  + m_top.set(top_position_for_pk_col, 0);
  }
  if (m_spec.get_public_column_count() > 0 && m_spec.get_column_name(0) == "!OID") {
  remove_column(m_spec.get_key(0));
  