Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/rails71 change column #132

Merged
merged 3 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions lib/active_record/connection_adapters/clickhouse_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
Loading