title: PG::UndefinedTable: ERROR: table "table-name" does not exist
body: <p>I was messing with my database, creating and deleting tables. I deleted few migration files after pushing them to heroku. Previously I created a table 'moms'. Later I wanted to rename it, so I deleted 'moms' and created new table 'minutes_of_meetings'. I did $rake db:migrate and everything was done successfully and my app is running perfectly on localhost.</p>
  
  <p>After pushing it to heroku, when I did $heroku run rake db:migrate, it generated the following log: </p>
  
  <pre><code>  ActiveRecord::SchemaMigration Load (0.7ms)  SELECT "schema_migrations".* FROM "schema_migrations"
    Migrating to DropMoms (20150823142852)
    (0.6ms)  BEGIN
               == 20150823142852 DropMoms: migrating =========================================
                   -- drop_table(:moms)
               (0.9ms)  DROP TABLE "moms"
               PG::UndefinedTable: ERROR:  table "moms" does not exist
               : DROP TABLE "moms"
               (0.5ms)  ROLLBACK
               rake aborted!
               StandardError: An error has occurred, this and all later migrations canceled:
  
                                                                                       PG::UndefinedTable: ERROR:  table "moms" does not exist
               : DROP TABLE "moms"/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:155:in `async_exec'
        /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:155:in `block in execute'
  </code></pre>
  
  <p>I created a new table 'moms' in heroku so that it can be deleted when migration runs. I did this:</p>
  
  <pre><code>$ heroku run Ruby console for rails-app-name &gt;&gt; ActiveRecord::Migration.create_table :moms 
  </code></pre>
  
  <p>I also created a migration to create table 'moms'. But still the error persists. </p>
  
  <p>EDIT:</p>
  
  <p>This is my CreateMoms migration file:</p>
  
  <pre><code>class CreateMoms &lt; ActiveRecord::Migration
    def change
      create_table :moms do |t|
        t.string :name
        t.timestamp null: false
      end
    end
  end
  </code></pre>
  
  <p>When I run heroku run rake db:migrate:up</p>
  
  <pre><code>Running `rake db:migrate:up` attached to terminal... up, run.1729
  rake aborted!
  VERSION is required
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/railties/databases.rake:78:in `block (3 levels) in &lt;top (required)&gt;'
  Tasks: TOP =&gt; db:migrate:up
  (See full trace by running task with --trace)
  WARNING: Toolbelt v3.41.3 update available.
  </code></pre>
  
  <p>On heroku run rake db:migrate:down</p>
  
  <pre><code>Running `rake db:migrate:down` attached to terminal... up, run.6389
  rake aborted!
  VERSION is required - To go down one migration, run db:rollback
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/railties/databases.rake:86:in `block (3 levels) in &lt;top (required)&gt;'
  Tasks: TOP =&gt; db:migrate:down
  (See full trace by running task with --trace)
  WARNING: Toolbelt v3.41.3 update available.
  </code></pre>