title: Ruby on Rails: Postgres Relation 'lists' does not exist
body: <p>I'm getting a weird error. I had sqlite3 working and now switching over to postgres, i'm getting this error.</p>
  
  <p>I have migrations, and I had to add a new column.</p>
  
  <p><strong>create_ideas</strong> migration</p>
  
  <pre><code>class CreateIdeas &lt; ActiveRecord::Migration
    def change
      create_table :ideas do |t|
        t.string :name
        t.text :description
        t.string :picture
  
        t.timestamps
      end
      add_foreign_key :ideas, :lists
    end
  end
  </code></pre>
  
  <p><strong>add_list_id_column_to_ideas</strong> migration</p>
  
  <pre><code>class AddListIdColumnToIdeas &lt; ActiveRecord::Migration
    def change
      add_column :ideas, :list_id, :integer
  
    end
  end
  </code></pre>
  
  <p>What is wrong with my foreign key? I get the error when I do <code>rake db:migrate</code></p>
  
  <p>I have another migration with foreign key, and no errors yet? Maybe its catching the first error first before seeing the other one, but I have this one too:</p>
  
  <p><strong>create_comments</strong> migration</p>
  
  <pre><code>class CreateComments &lt; ActiveRecord::Migration
    def change
      create_table :comments do |t|
        t.string :user_name
        t.text :body
        t.integer :idea_id
  
        t.timestamps
      end
      add_foreign_key :comments, :ideas
    end
  end
  </code></pre>
  
  <p>last migration I have <strong>create_lists</strong></p>
  
  <pre><code>class CreateLists &lt; ActiveRecord::Migration
    def change
      create_table :lists do |t|
        t.string :name
        t.text :description
        t.string :picture
  
        t.timestamps
      end
    end
  end
  </code></pre>
  
  <p>Any clue why I'm getting errors?</p>
  
  <p>Thanks</p>
  
  <p>edit</p>
  
  <p>my relationships</p>
  
  <p>comments model </p>
  
  <pre><code>belongs_to :idea
  </code></pre>
  
  <p>idea model </p>
  
  <pre><code>belongs_to :list
  has_many :comments
  </code></pre>
  
  <p>list model</p>
  
  <pre><code>has_many :ideas
  </code></pre>