title: How to reflect in the database a new belongs_to and has_many relationship in Ruby on Rails
body: <p>I am new to rails (usually a python guy) and have just been trying to build a simple task manager application for fun.  I am using Devise for authentication and have a single Task object I am trying to relate to a user.  I have added the following to the Task model:</p>
  
  <pre><code>class Task &lt; ActiveRecord::Base
      belongs_to :user
  end
  </code></pre>
  
  <p>and I have added the following in my User model for Devise:</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
     has_many :tasks
  
     &lt;&lt;normal Devise stuff&gt;&gt;
  end
  </code></pre>
  
  <p>Whenever I added this information I then ran: rake db:migrate.  It then gave me an error that the database field did not exist for user_id when I tried to do anything with it. </p>
  
  <p>I am sure it is something rather simple that I am missing.  Thanks for the help.</p>