title: How can I associate columns in Rails? (postgresql)
body: <p>I have 2 models:</p>
  
  <pre><code>class Address &lt; ApplicationRecord
    belongs_to :shop
  end
  </code></pre>
  
  <p>and </p>
  
  <pre><code>class Shop &lt; ActiveRecord::Base
   include ShopifyApp::SessionStorage
   has_many :addresses
  end
  </code></pre>
  
  <p>with: </p>
  
  <pre><code>class CreateAddresses &lt; ActiveRecord::Migration[5.1]
    def change
    create_table    :addresses do |t|
     t.string      :address_1
     t.string      :address_2
     t.string      :postal
     t.string      :phone
     t.string      :city
     t.timestamps
    end
  end
  end
  </code></pre>
  
  <p>and</p>
  
  <pre><code>class CreateShops &lt; ActiveRecord::Migration[5.1]
   def self.up
     create_table :shops  do |t|
        t.integer :shopify_id, :limit =&gt; 8, null: false
        t.string :shopify_domain, null: false
        t.string :shopify_token, null: false
        t.jsonb :shop_json, null: false
        t.timestamps
     end
  
    add_index :shops, :shopify_domain, unique: true
   end
  
   def self.down
     drop_table :shops
   end
  end
  </code></pre>
  
  <p>I would like to reference the 'shopify_id' column in the Shop table with a column called 'shopify_id' (that contains the same value) in Address table. </p>
  
  <p>How could I do that?</p>