提交 9930b97e 编写于 作者: K Kasper Timm Hansen 提交者: GitHub

Merge pull request #29770 from y-yagi/fix_boolean_column_migration_script

Fix boolean column migration script
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册