diff --git a/lib/active_record/connection_adapters/clickhouse/schema_creation.rb b/lib/active_record/connection_adapters/clickhouse/schema_creation.rb index aa20d7c9..64aeb556 100644 --- a/lib/active_record/connection_adapters/clickhouse/schema_creation.rb +++ b/lib/active_record/connection_adapters/clickhouse/schema_creation.rb @@ -108,7 +108,7 @@ def table_modifier_in_create(o) def visit_ChangeColumnDefinition(o) column = o.column - column.sql_type = type_to_sql(column.type, column.options) + column.sql_type = type_to_sql(column.type, **column.options) options = column_options(column) quoted_column_name = quote_column_name(o.name) diff --git a/lib/active_record/connection_adapters/clickhouse_adapter.rb b/lib/active_record/connection_adapters/clickhouse_adapter.rb index d89cd2ca..2eaa6e74 100644 --- a/lib/active_record/connection_adapters/clickhouse_adapter.rb +++ b/lib/active_record/connection_adapters/clickhouse_adapter.rb @@ -371,8 +371,8 @@ def remove_column(table_name, column_name, type = nil, **options) execute("ALTER TABLE #{quote_table_name(table_name)} #{remove_column_for_alter(table_name, column_name, type, **options)}", nil, settings: {wait_end_of_query: 1, send_progress_in_http_headers: 1}) end - def change_column(table_name, column_name, type, options = {}) - result = do_execute("ALTER TABLE #{quote_table_name(table_name)} #{change_column_for_alter(table_name, column_name, type, options)}", nil, settings: {wait_end_of_query: 1, send_progress_in_http_headers: 1}) + def change_column(table_name, column_name, type, **options) + result = do_execute("ALTER TABLE #{quote_table_name(table_name)} #{change_column_for_alter(table_name, column_name, type, **options)}", nil, settings: {wait_end_of_query: 1, send_progress_in_http_headers: 1}) raise "Error parse json response: #{result}" if result.presence && !result.is_a?(Hash) end @@ -441,9 +441,9 @@ def last_inserted_id(result) result end - def change_column_for_alter(table_name, column_name, type, options = {}) + def change_column_for_alter(table_name, column_name, type, **options) td = create_table_definition(table_name) - cd = td.new_column_definition(column_name, type, options) + cd = td.new_column_definition(column_name, type, **options) schema_creation.accept(ChangeColumnDefinition.new(cd, column_name)) end