Skip to content

Commit

Permalink
Fix 'rails db:migrate' error when run against an app with mysql2 adap…
Browse files Browse the repository at this point in the history
…ter (#1298)
  • Loading branch information
gurgelrenan committed Mar 26, 2021
1 parent 00fb2c0 commit 212b145
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ recommendations of [keepachangelog.com](http://keepachangelog.com/).
### Fixed

- Expand kwargs passed to `save_with_version` using double splat operator - Rails 6.1 compatibility
- [#1287](https://github.com/paper-trail-gem/paper_trail/issues/1287) - Fix 'rails db:migrate' error when run against an app with mysql2 adapter

### Dependencies

Expand Down
2 changes: 1 addition & 1 deletion lib/generators/paper_trail/install/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def mysql?
#
def versions_table_options
if mysql?
', { options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci" }'
', options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci"'
else
""
end
Expand Down
2 changes: 1 addition & 1 deletion spec/generators/paper_trail/install_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}.call
expected_create_table_options = lambda {
if described_class::MYSQL_ADAPTERS.include?(ActiveRecord::Base.connection.class.name)
', { options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci" }'
', options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci"'
else
""
end
Expand Down

0 comments on commit 212b145

Please sign in to comment.