Skip to content

Commit 8e4ea2c

Browse files
committed
Don't throw exception when creating database
1 parent ce57892 commit 8e4ea2c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/active_record/connection_adapters/clickhouse_adapter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ def show_create_table(table)
264264

265265
# Create a new ClickHouse database.
266266
def create_database(name)
267-
sql = apply_cluster "CREATE DATABASE #{quote_table_name(name)}"
267+
sql = apply_cluster "CREATE DATABASE IF NOT EXISTS #{quote_table_name(name)}"
268268
log_with_debug(sql, adapter_name) do
269269
res = @connection.post("/?#{@connection_config.except(:database).to_param}", sql)
270270
process_response(res)

0 commit comments

Comments
 (0)