Open PoroshkinaVV opened 8 months ago
@PNixx, what do you think?
I will check
% rake db:create:clickhouse
Database 'clickhouse_test' already exists
Correct behavior when creating a database. Write your version of Ruby, Rails and ClickHouse.
Ruby: 3.2.0 Rails: 7.1.3 Clickhouse: 23.8.3.48
gem version?
latest: 1.0.4
I also made this change based on method drop database
. Not only because I have this error above.
It contains directive 'IF EXISTS', but create database
for some reason doesn't have 'IF NOT EXISTS': https://github.com/PNixx/clickhouse-activerecord/blob/8e4ea2ca1fd8609d118e9cc2a4ff30bf441345aa/lib/active_record/connection_adapters/clickhouse_adapter.rb#L312
Sorry, I mistake. You set in database.yml
cluster information?
cluster_name: 'cluster_name' # optional for creating tables in cluster
replica_name: '{replica}' # replica macros name, optional for creating replicated tables
@PNixx yes
This PR aims to fix exception when creating database.
Clickhouse docs: