Skip to content

Commit

Permalink
Fixed CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Feb 19, 2023
1 parent c7a6bad commit dde9cc1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/strong_migrations/adapters/mysql_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ def change_type_safe?(table, column, type, options, existing_column, existing_ty
# account for charset
# https://dev.mysql.com/doc/refman/8.0/en/charset-mysql.html
# https://mariadb.com/kb/en/supported-character-sets-and-collations/
# TODO fix for Active Record < 6.1
charset = @checker.instance_variable_get(:@migration).table_options(table)[:charset]
maxlen = connection.select_all("SELECT MAXLEN FROM INFORMATION_SCHEMA.CHARACTER_SETS WHERE CHARACTER_SET_NAME = #{connection.quote(charset)}").first["MAXLEN"]
maxlen = connection.select_all("SELECT MAXLEN FROM INFORMATION_SCHEMA.CHARACTER_SETS WHERE CHARACTER_SET_NAME = #{connection.quote(charset)}").first&.[]("MAXLEN")
unless maxlen
warn "[strong_migrations] Unknown charset: #{charset}"
maxlen = 4
Expand Down

0 comments on commit dde9cc1

Please sign in to comment.