title: PGError: ERROR: relation "table_name" does not exist
body: <p>I am trying to push a simple app up to heroku and run:</p>
  
  <pre><code>heroku rake db:migrate
  </code></pre>
  
  <p>But I get the following error:</p>
  
  <pre><code>rake aborted!
  PGError: ERROR:  relation "posts" does not exist
  :             SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
                FROM pg_attribute a LEFT JOIN pg_attrdef d
                  ON a.attrelid = d.adrelid AND a.attnum = d.adnum
               WHERE a.attrelid = '"posts"'::regclass
                 AND a.attnum &gt; 0 AND NOT a.attisdropped
               ORDER BY a.attnum
  
  Tasks: TOP =&gt; db:migrate =&gt; environment
  (See full trace by running task with --trace)
  </code></pre>
  
  <p>My migration looks like this:</p>
  
  <pre><code>class CreatePosts &lt; ActiveRecord::Migration
    def change
      create_table :posts do |t|
        t.string :source
        t.string :tweetid
        t.string :pure
        t.string :media
        t.string :destination
        t.datetime :time
        t.timestamps
      end
    end
  end
  </code></pre>
  
  <p>And, after referring to another SO answer, I have included the following in my Gemfile:</p>
  
  <pre><code># Gems used only for assets and not required
  # in production environments by default.
  group :assets do
    gem 'sass-rails',   '~&gt; 3.1.4'
    gem 'coffee-rails', '~&gt; 3.1.1'
    gem 'uglifier', '&gt;= 1.0.3'
    gem 'pg'
  end
  </code></pre>
  
  <p>Thank you in advance for any help!</p>
  
  <p>--- UPDATE ---</p>
  
  <p>The main reason I am confused is that this all works locally, just not when I run the migration on heroku.</p>
  
  <p>Here is the error I get now:</p>
  
  <pre><code>rake aborted!
  Please install the postgresql adapter: `gem install activerecord-postgresql-adapter` (pg is not part of the bundle. Add it to Gemfile.)
  </code></pre>
  
  <p>I have been looking at this question:</p>
  
  <p><a href="https://stackoverflow.com/questions/6410623/heroku-error-when-launch-rails3-1-app-missing-postgres-gem">Heroku error when launch rails3.1 app missing postgres gem</a></p>
  
  <p>I am almost-certain my database.yml should not look like this (seeing as I need to be running postgresql!!!):</p>
  
  <pre><code># SQLite version 3.x
  #   gem install sqlite3
  #
  #   Ensure the SQLite 3 gem is defined in your Gemfile
  #   gem 'sqlite3'
  development:
    adapter: sqlite3
    database: db/development.sqlite3
    pool: 5
    timeout: 5000
  
  # Warning: The database defined as "test" will be erased and
  # re-generated from your development database when you run "rake".
  # Do not set this db to the same as development or production.
  test:
    adapter: sqlite3
    database: db/test.sqlite3
    pool: 5
    timeout: 5000
  
  production:
    adapter: sqlite3
    database: db/production.sqlite3
    pool: 5
    timeout: 5000
  </code></pre>
  
  <p>Serious apologies for the nubishness here. Thank you for your help in advance!</p>
  
  <p>Also tried this link: <a href="https://stackoverflow.com/questions/7492636/uploading-to-heroku-db-rakemigrate-problem">Uploading to Heroku DB rake:migrate problem</a></p>