Fix boolean columns sometimes having a null value (#4162)
* Fix boolean columns sometimes having a null value * Fix wrong value being set instead of null
This commit is contained in:
parent
e48d3bfd01
commit
880a5eb25c
6 changed files with 31 additions and 13 deletions
17
db/migrate/20170711225116_fix_null_booleans.rb
Normal file
17
db/migrate/20170711225116_fix_null_booleans.rb
Normal file
|
@ -0,0 +1,17 @@
|
|||
class FixNullBooleans < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
change_column_default :domain_blocks, :reject_media, false
|
||||
change_column_null :domain_blocks, :reject_media, false, false
|
||||
|
||||
change_column_default :imports, :approved, false
|
||||
change_column_null :imports, :approved, false, false
|
||||
|
||||
change_column_null :statuses, :sensitive, false, false
|
||||
change_column_null :statuses, :reply, false, false
|
||||
|
||||
change_column_null :users, :admin, false, false
|
||||
|
||||
change_column_default :users, :otp_required_for_login, false
|
||||
change_column_null :users, :otp_required_for_login, false, false
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue