get_onetoone_views = async (table, viewname) => {
  const rels = await Field.find(
    {
      reftable_name: table.name,
      is_unique: true,
    },
    { cached: true }
  );
  let child_views = [];
  for (const relation of rels) {
    const related_table = Table.findOne({ id: relation.table_id });
    const views = await View.find_table_views_where(
      related_table.id,
      ({ state_fields, viewrow }) =>
        viewrow.name !== viewname && state_fields.some((sf) => sf.name === "id")
    );
    child_views.push({ relation, related_table, views });
  }
  return child_views;
}
Get One-to-one views
@function
@param {Table} table
@param {string} viewname
@returns {Promise<object[]>}