title: Creating foreign key constraints in ActiveRecord
body: <p>How do I create foreign keys in ActiveRecord?  I have something like the following in my models:</p>
  
  <pre><code>class Student &lt; ActiveRecord::Base
    attr_accessible :name, :level_id
    belongs_to :level
  end
  
  class Level &lt; ActiveRecord::Base
    attr_accessible :number
    has_many :students
  end
  </code></pre>
  
  <p>But the schema.rb and development sqlite3 database don't have any indication foreign key constraints were setup with the level_id field.  Is this something I have to do manually apart from ActiveRecord or Rails?  Did I miss a step?</p>
  
  <p>Using Rails 3.2.8</p>