-
Notifications
You must be signed in to change notification settings - Fork 22.2k
Change the default null value for timestamps
#16481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
As per discussion, this changes the model generators to specify `null: false` for timestamp columns. A warning is now emitted if `timestamps` is called without a `null` option specified, so we can safely change the behavior when no option is specified in Rails 5.
|
Not sure how this can be safe unless old migrations are updated as well? They'll be implicitly |
|
That's the goal behind the deprecation warning if it is unspecified, users will need to specify |
|
The deprecation warning will come too late though, after the migration already ran on the production db. |
|
The warning would also appear any time anyone did anything related to |
Change the default `null` value for timestamps
|
This deprecation only pertains to the |
- Use unscoped when referring to Site to remove the deleted_at column in SQL queries built by ActiveRecord. - Add :null => false to all timestamps definitions. Default changed from Rails 3.2 to 4.0. See rails/rails#16481
Fix Rails 5 deprecation warning for not explicitly setting the null option for timestamps. Also moved other timestamps to use timestamps method This deprecation warning was introduced in rails/rails#16481
Fix Rails 5 deprecation warning for not explicitly setting the null option for timestamps. Also moved other timestamps to use timestamps method This deprecation warning was introduced in rails/rails#16481
As per discussion, this changes the model generators to specify
null: falsefor timestamp columns. A warning is now emitted iftimestampsis called without anulloption specified, so we cansafely change the behavior when no option is specified in Rails 5.