Project

General

Profile

Refactor #24838

set "Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true" and migrate everything

Added by Anonymous about 2 years ago. Updated 11 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Database
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

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
setting up a rake task which runs

    ExampleModel.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

Related issues

Related to Foreman - Tracker #21834: Rails 5.2 upgrade tasksClosed

Blocks Foreman - Tracker #24837: Rails 6.0 TrackerClosed

Associated revisions

Revision f3350559 (diff)
Added by Tomer Brisker 11 months ago

Fixes #24838 - Use integer representation for boolean on sqlite

We don't really need to migrate boolean fields as sqlite isn't supported
production database and is only used for running build tasks.

History

#1 Updated by Anonymous about 2 years ago

#2 Updated by Anonymous about 2 years ago

#3 Updated by Anonymous over 1 year ago

  • Tracker changed from Bug to Refactor

#4 Updated by The Foreman Bot 11 months ago

  • Assignee set to Tomer Brisker
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/7171 added

#5 Updated by The Foreman Bot 11 months ago

  • Fixed in Releases 2.0.0 added

#6 Updated by Tomer Brisker 11 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF