I've noticed this for months and I just didn't have the time to deal with it until now. Whenever my CI server does an automatic git pull
and restarts the rails servers, the schema.rb
gets randomly modified. As the example shows below, the api_name
column of a certain table got dropped. I dropped this column about 3 months ago. Same with transportation_charges
. And very often, the spacing in this file changes: see created_at
and updated_at
.
It's especially annoying since on the next run, when my CI does an initial git pull
, it complains about changes to schema.rb
and stops execution until they get pushed or reverted. And it's not just the CI server. I've seen this on other developer machines as well. Did anyone run into this before?
diff --git a/db/schema.rb b/db/schema.rb
index 470d3bf..166e3ee 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -883,7 +883,6 @@ ActiveRecord::Schema.define(version: 20170720211740) do
create_table "ups_package_service_options", force: :cascade do |t|
t.string "name"
- t.string "api_name"
t.string "type"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
@@ -910,9 +909,8 @@ ActiveRecord::Schema.define(version: 20170720211740) do
t.string "code"
t.string "name"
t.string "api_name"
- t.decimal "transportation_charges"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
t.boolean "domestic"
end