This project is archived and is in readonly mode.
Request for automatic invocation of 'reset_column_information' in Migrations
-
Joshua Pinter
I concur. Just ran into this myself.
Spent a few hours hunting it down and another hour making updates to my migrations.
-
Oscar Del Ben
In the rails test suite, there is a test where they specifically call reset_column_information:
def test_native_types Person.delete_all Person.connection.add_column "people", "last_name", :string Person.connection.add_column "people", "bio", :text Person.connection.add_column "people", "age", :integer Person.connection.add_column "people", "height", :float Person.connection.add_column "people", "wealth", :decimal, :precision => '30', :scale => '10' Person.connection.add_column "people", "birthday", :datetime Person.connection.add_column "people", "favorite_day", :date Person.connection.add_column "people", "moment_of_truth", :datetime Person.connection.add_column "people", "male", :boolean Person.reset_column_information assert_nothing_raised do Person.create :first_name => 'bob', :last_name => 'bobsen', :bio => "I was born ....", :age => 18, :height => 1.78, :wealth => BigDecimal.new("12345678901234567890.0123456789"), :birthday => 18.years.ago, :favorite_day => 10.days.ago, :moment_of_truth => "1782-10-10 21:40:18", :male => true end # Other stuff endI think this is just the way it's supposed to be. One reason could be that otherwise they'd have to call reset_column_information after every single operation (add_column, remove_column, etc).
-
Ivo Wever
Well, this feature request is for running the method after every Migration; not within the migration after each Model modification. But even then:
irb(main):008:0> puts Benchmark.measure {1000000.times {User.reset_column_information;}} 3.050000 0.010000 3.060000 ( 3.079835)I'm not worried about the performance impact of this, the more so since we are dealing on a relatively infrequent operation as running migrations.
-
rails
- State changed from new to open
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
rails
- State changed from open to stale
-
learn italian online
- State changed from stale to open
The resources of the Rails core team are Ray Ban 2140 limited, and so we are asking for your help. If you can still
learn italian online reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. learn a language Likewise, if you feel that this is a very important feature for Rails to include, Ray Ban 3025 ple ase reply with your explanation so we can consider it.
