title: PG::UndefinedTable: ERROR: relation "categories_posts" does not exist
body: <p>I tried to create a 'category' in my blog.There are two models <code>post</code> and <code>category</code>.I using habtm association</p>
  
  <p><strong>post.rb</strong></p>
  
  <pre><code>class Post &lt; ActiveRecord::Base
    belongs_to :user
    has_and_belongs_to_many :categories
  end
  </code></pre>
  
  <p><strong>category.rb</strong></p>
  
  <pre><code>class Category &lt; ActiveRecord::Base
    has_and_belongs_to_many :posts
  end
  </code></pre>
  
  <p>but when I check from the irb </p>
  
  <pre><code>post.categories
  </code></pre>
  
  <p>shell show me an error</p>
  
  <pre><code>PG::UndefinedTable: ERROR:  relation "categories_posts" does not exist
  </code></pre>
  
  <p>how fix it?</p>