Permalink
Browse files

Merge pull request #29770 from y-yagi/fix_boolean_column_migration_sc…

…ript

Fix boolean column migration script
  • Loading branch information...
kaspth committed Jul 15, 2017
2 parents 89182d6 + 90bb874 commit 9930b97e7d9afc8fd7ec10efe649d5e10b4f9556
@@ -82,7 +82,7 @@ class SQLite3Adapter < AbstractAdapter
# Conversion can be accomplished by setting up a rake task which runs
#
# ExampleModel.where("boolean_column = 't'").update_all(boolean_column: 1)
# ExampleModel.where("boolean_column = 't'").update_all(boolean_column: 0)
# ExampleModel.where("boolean_column = 'f'").update_all(boolean_column: 0)
# for all models and all boolean columns, after which the flag must be set
# to true by adding the following to your application.rb file:
#
@@ -187,7 +187,7 @@ class Railtie < Rails::Railtie # :nodoc:
by setting up a rake task which runs
ExampleModel.where("boolean_column = 't'").update_all(boolean_column: 1)
ExampleModel.where("boolean_column = 't'").update_all(boolean_column: 0)
ExampleModel.where("boolean_column = 'f'").update_all(boolean_column: 0)
for all models and all boolean columns, after which the flag must be set to
true by adding the following to your application.rb file:
@@ -387,7 +387,7 @@ by setting up a rake task which runs
```ruby
ExampleModel.where("boolean_column = 't'").update_all(boolean_column: 1)
ExampleModel.where("boolean_column = 't'").update_all(boolean_column: 0)
ExampleModel.where("boolean_column = 'f'").update_all(boolean_column: 0)
```
for all models and all boolean columns, after which the flag must be set to true

0 comments on commit 9930b97

Please sign in to comment.