Add foreign key to schema using hook_update_N
You can add keys to tables using native SQL. It's not supported by drupal 7 core api. I answered this previously elsewhere:
Is there a way to add a foreign key to a table?

I doubt that simply adding a key will expose the relationship for you in Views though.

In order for Views to see this information you likely need to supply the info via hook_views_data() about your custom tables and relationships. A recent blog post I found about this today actually was:
https://chacadwa.com/blog/2014/08/12/adding-full-views-support-custom-entities

From this blog post you can see that for a table that needs a join to add extra fields (and to do so by default in Views) they add the following array to their hook_views_data() function.

// Define a default relationship to the staffdir extra data table.

$data['hank_hrper']['table']['default_relationship'] = array(
  'hank_hrper_extra_data' =&gt; array(
    'table' =&gt; 'hank_hrper_extra_data',
    'field' =&gt; 'hrper_id',
  ),
);

// Now define the staffdir extra data table, so views can use it.

$data['hank_hrper_extra_data'] = array(
  'table' =&gt; array(
    'group' =&gt; t('Staff directory'),
    'entity type' =&gt; 'staffdir',
    'join' =&gt; array(
      'hank_hrper' =&gt; array(
        'left_field' =&gt; 'hrper_id',
        'field' =&gt; 'hrper_id',
      ),
    ),
    'default_relationship' =&gt; array(
      'hank_hrper' =&gt; array(
        'table' =&gt; 'hank_hrper',
        'field' =&gt; 'hrper_id',
      ),
    ),
  ),
);

// Now we can define fields from the staffdir extra data table for use in the relationship.

$data['hank_hrper_extra_data']['opt_out'] = array(
  'title' =&gt; t('Opt out'),
  'help' =&gt; t('Allows for users to be excluded from the directory.'),
  'field' =&gt; array(
    'handler' =&gt; 'views_handler_field_boolean',
    'click sortable' =&gt; FALSE, // could be TRUE, but why?
  ),
  'filter' =&gt; array(
    'handler' =&gt; 'views_handler_filter_boolean_operator',
     'accept null' =&gt; TRUE,
    'help' =&gt; t('Filter results to a particular result set'),
  ),
);