SchemaDumper generating different output on Mac & Linux

问题内容:

We’re using activerecord 5.1.4 in our project.
When running migrations the SchemaDumper generates different output on different colleagues machines. Some are using Linux others using Mac.

We’re all running the same postgres version 9.6

For example Macs generate:


create_table "appliances", force: cascade do |t|
t.string "brand"
t.integer "property_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

Linux creates:


create_table "appliances", id: :serial, force: cascade do |t|
t.string "brand"
t.integer "property_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

Linux output seems to have id: :serial and it doesn’t pad columns to align.

It means we’re constantly bouncing changes to schema.rb in version control
Why would the output be different?

问题评论:

    
I tried replicating , but didn’t got anything . Can you post the command you are using to generate the migration ?
    
Did u use this command – rake db:schema:dump ?
    
I’m using rake db:migrate when running migrations which regenerates the schema. I’ve just tried rake db:schema:dump and it produces the same thing.
– Rob
1 hour ago

原文地址:

https://stackoverflow.com/questions/47753621/schemadumper-generating-different-output-on-mac-linux

添加评论

友情链接:蝴蝶教程