title: Rails console database schema checking
body: <p>I'm new to rails/ruby and I was wondering how I can double check if my database schema is correctly built in rails console</p>
  
  <p>In <code>rails c</code></p>
  
  <p><code>ActiveRecord::Base.connection.tables</code> gave me the output of </p>
  
  <pre><code>["schema_migrations", "users", "expense_pictures", "income_pictures", "income_texts", "expense_texts"] 
  </code></pre>
  
  <p>How can I check within the console that I have the following schema correctly built?</p>
  
  <p><img src="https://i.stack.imgur.com/vLtCp.png" alt="enter image description here"></p>
  
  <p>From user to IncomePictures and ExpensePictures are foreign keys. IncomePictures to ExpensePictures are also foreign keys to their appropriate texts</p>
  
  <p>Here are my models:</p>
  
  <pre><code>class ExpensePicture &lt; ActiveRecord::Base
  
    belongs_to :user
    mount_uploader :image, ImageUploader
    has_one :expense_text
  end
  
  class ExpenseText &lt; ActiveRecord::Base
    belongs_to :expense_pictures
  end
  
  class IncomePicture &lt; ActiveRecord::Base
    belongs_to :user
    mount_uploader :image, ImageUploader
    has_one :income_text
  end
  
  class IncomeText &lt; ActiveRecord::Base
    belongs_to :income_pictures
  end
  
  class User &lt; ActiveRecord::Base
    # Include default devise modules. Others available are:
    # :confirmable, :lockable, :timeoutable and :omniauthable
    devise :database_authenticatable, :registerable,
           :rememberable, :validatable
  
    has_many :expense_pictures 
    has_many :income_pictures
  
  end
  </code></pre>