Open scherztc opened 2 years ago
The fix for this issue is in 2 separate PR's. The first, PR #1123, creates a rake task for the developers to run locally to prepare their local sqlite databases for the update. The second, PR #1124, modifies the application.rb file to prevent future saving of data in the deprecated format. All developers need to run the rake tasks from #1123 before they attempt to run the app with the configuration change in #1124.
/Users/scherztc/.rvm/gems/ruby-2.7.5@ucrate/gems/activerecord-5.2.4.6/lib/active_record/connection_adapters/sqlite3_adapter.rb:32: warning: rb_check_safe_obj will be removed in Ruby 3.0
How to replicate : bundle exec rake db:migrate
Done looks like : There are no warnings when running db:migrate.
DEPRECATION WARNING: Leaving
ActiveRecord::ConnectionAdapters::SQLite3Adapter.represent_boolean_as_integer
set to false is deprecated. SQLite databases have used 't' and 'f' to serialize boolean values and must have old data converted to 1 and 0 (its native boolean serialization) before setting this flag to true. Conversion can be accomplished by setting up a rake task which runsExampleModel.where("boolean_column = 't'").update_all(boolean_column: 1) 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:
Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true (called from <top (required)> at /Users/scherztc/Workspaces/ucrate/config/environment.rb:7)