From 1582b50c630f8b48490367e18e10201ce1845a26 Mon Sep 17 00:00:00 2001 From: Daniel Westendorf Date: Fri, 26 Jul 2024 06:26:18 -0600 Subject: [PATCH] Normalize table name in schema dump (#148) strip the database name from schema dump --- lib/active_record/connection_adapters/clickhouse_adapter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/active_record/connection_adapters/clickhouse_adapter.rb b/lib/active_record/connection_adapters/clickhouse_adapter.rb index 9d6ee4d8..47c3d832 100644 --- a/lib/active_record/connection_adapters/clickhouse_adapter.rb +++ b/lib/active_record/connection_adapters/clickhouse_adapter.rb @@ -264,7 +264,7 @@ def create_schema_dumper(options) # :nodoc: # @param [String] table # @return [String] def show_create_table(table) - do_system_execute("SHOW CREATE TABLE `#{table}`")['data'].try(:first).try(:first).gsub(/[\n\s]+/m, ' ') + do_system_execute("SHOW CREATE TABLE `#{table}`")['data'].try(:first).try(:first).gsub(/[\n\s]+/m, ' ').gsub("#{@config[:database]}.", "") end # Create a new ClickHouse database.