title: How change column type works in rails migration
body: <p>We know, rails ActiveRecord::Migration now have a new method </p>
  
  <pre><code>def change
    add_column :accounts, :name, :string
    add_index :accounts, :name
    change_column :my_table, :some_id, :string
  end
  </code></pre>
  
  <p>But my question  is for </p>
  
  <pre><code>change_column :my_table, :some_id, :string
  </code></pre>
  
  <p>rails do not need to know :some_id's previous type is integer or not.
  For example  assume :some_id was an integer, after this migration it is converted to string.</p>
  
  <p>when I revert this migration  :some_id type should be integer again. Am i right ??  but how can rails understand :some_id previous type was integer. </p>
  
  <p>in previous mehtod self.up and self.down it is written in migration file. so it was not problem. rails can easily find that. but  in change method how it is recollected?? Does it check the migration for this table in previous migration files where last data type was definded for :some_id  or anything else ??</p>