title: rails changes schema.rb for no reason
body: <p>Everytime I run a <code>rake db:migrate</code> rails decides to change my schema.rb file. In some cases this is completely reasonable, however in some other cases it seems that it's doing it for no reason. The case I'm confused about is when I pull a new migration and a new version of schema.rb from git, and then run <code>rake db:migrate</code>. Since the new version of the schema.rb file came with this migration, I shouldn't be updating schema.rb. However, rails still changes it, every time. When this occurs I find incredibly silly changes such as:</p>
  
  <pre><code>add_index "my_table", ["column1", "column2"], :name =&gt; "index_on_some_columns"
  </code></pre>
  
  <p>to</p>
  
  <pre><code>add_index "my_table", ["column2", "column1"], :name =&gt; "index_on_some_columns"
  </code></pre>
  
  <p>When this happens I simply run <code>git checkout db/schema.rb</code> and go on with my life, but it irkes me to no end. Is there a reason why it does this, and how can I stop it from doing this?</p>
  
  <p>EDIT: Here's an excerpt from a diff</p>
  
  <pre><code>@@ -165,12 +165,11 @@ ActiveRecord::Schema.define(:version =&gt; 20130206001907) do
       t.column "updated_at", :datetime
  -    t.column "coordinates", :point, :srid =&gt; 4326
  @@ -200,15 +199,16 @@ ActiveRecord::Schema.define(:version =&gt; 20130206001907) do
       t.column "something", :boolean
  +    t.column "coordinates", :point, :srid =&gt; 4326
  +    t.column "random_string", :string
       t.column "remote", :string
  -    t.column "random_string", :string
     end
  
  -  add_index "my_table", ["id", "foreign_id"], :name =&gt; "index_active_my_table_on_foreign_and_id"
  -  add_index "my_table", ["id", "active"], :name =&gt; "index_my_table_on_active_and_id"
  -  add_index "my_table", ["id", "content_modified_at"], :name =&gt; "index_my_table_on_content_modified_at_and_id"
  +  add_index "my_table", ["foreign_id", "id"], :name =&gt; "index_active_my_table_on_foreign_and_id"
  +  add_index "my_table", ["active", "id"], :name =&gt; "index_my_table_on_active_and_id"
  +  add_index "my_table", ["content_modified_at", "id"], :name =&gt; "index_my_table_on_content_modified_at_and_id"
  </code></pre>