You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 21, 2024. It is now read-only.
bin/rails g migration add_completed_to_projects completed:boolean
bin/rails db:migrate
This migration fills null value in existing projects. And developers have to distinguish null or false, like this:
# If there are ten projects before running the migration Project.where(completed: false).count#=> 0Project.where(completed: null).count#=> 10
This issue could lead to a bug because developers tend to believe that completed column has true or false only. So I think it is better to edit the migration file like this:
Chapter 11, page 192,
NOTE: This is a problem related to RDBMS.
This migration fills null value in existing projects. And developers have to distinguish null or false, like this:
This issue could lead to a bug because developers tend to believe that completed column has true or false only. So I think it is better to edit the migration file like this:
The text was updated successfully, but these errors were encountered: