Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
343 views
in Technique[技术] by (71.8m points)

Long Rails 6 migration printout

I upgraded from rails 5.2.3 to 6.1.0 and noticed that my migration log for add_reference has changed.

With Rails 5 it simply had:

-- add_reference(:categories, :user, {:foreign_key=>true})
  -> 0.0063s

With Rails 6 I get this:

-- update_table_definition(:categories, ...)
   -> 0.0001s
-- add_column("categories", "user_id", :bigint, {})
   -> 0.0027s
-- add_index("categories", ["user_id"], {})
   -> 0.0041s
-- add_foreign_key("categories", "users", {:column=>"user_id"})
   -> 0.0021s

Which is a problem because the second parameter of update_table_definition (the ... part) is an instance of my migration class and prints 4 screens of text.

Is there a way to get back the simple printout of Rails 5? I know I can turn off migration logs with VERBOSE=false, but then I lose all the migration logs.

The add_reference method and missing_parameter, say_with_time methods (that prints the logs) seemingly didn't change between the two Rails versions.

question from:https://stackoverflow.com/questions/65541057/long-rails-6-migration-printout

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...