title: What did I do wrong with my Rails migrations for Heroku?
body: <p>I'm trying to add my <code>Address</code> table's <code>text</code> property as the <code>address</code> property of my <code>Brewery</code> table, then delete the <code>Address</code> table.  I'm doing this on Heroku after a <code>git push heroku master</code> by running <code>heroku run rake db:migrate</code>.</p>
  
  <p>My first migration which creates the new field for the data works fine.  But my second migration fails immediately- it says it can't find the <code>Address</code> table.  My third migration never runs, but it's the one that was supposed to delete the <code>Address</code> table to tidy everything up.</p>
  
  <p>What am I doing wrong?  These migrations worked on my local box, but are failing on Heroku:</p>
  
  <h1>1:</h1>
  
  <pre><code>class AddAddressStringToBrewery &lt; ActiveRecord::Migration
    def change
      add_column :breweries, :address, :string
    end
  end
  </code></pre>
  
  <h1>2:</h1>
  
  <pre><code>class MoveAddressToString &lt; ActiveRecord::Migration
    def change
      Address.all.each do |address|
        brewery = address.brewery
        brewery.update(address: address.text)
      end
    end
  end
  </code></pre>
  
  <h1>3:</h1>
  
  <pre><code>class DropAddressTable &lt; ActiveRecord::Migration
    def change
      drop_table :addresses
    end
  end
  </code></pre>
  
  <p>My best guess is that Heroku is reading my schema and dropping the table, before running my migrations.  I could always stage these migrations in individual git commits to force it to work, but I'd really like to know where I went wrong.</p>
  
  <p>Thanks!</p>