diff --git a/README.md b/README.md index 06d6a1be..5f512a78 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ default: &default ssl: true # optional for using ssl connection debug: true # use for showing in to log technical information migrations_paths: db/clickhouse # optional, default: db/migrate_clickhouse + # Note: For Rails 7.2+, migrations_paths must be explicitly specified in database.yml cluster_name: 'cluster_name' # optional for creating tables in cluster replica_name: '{replica}' # replica macros name, optional for creating replicated tables read_timeout: 300 # change network timeouts, by default 60 seconds @@ -63,6 +64,15 @@ development: database: database ``` +**Important for Rails 7.2+**: In Rails 7.2 and later, you must explicitly specify `migrations_paths` in your `database.yml` configuration: + +```yml +development: + adapter: clickhouse + database: database + migrations_paths: db/migrate_clickhouse # Required for Rails 7.2+ +``` + Your model example: ```ruby diff --git a/lib/active_record/connection_adapters/clickhouse_adapter.rb b/lib/active_record/connection_adapters/clickhouse_adapter.rb index 9b1e218d..9daa646b 100644 --- a/lib/active_record/connection_adapters/clickhouse_adapter.rb +++ b/lib/active_record/connection_adapters/clickhouse_adapter.rb @@ -169,6 +169,9 @@ def exec_rollback_to_savepoint(name) def release_savepoint(name) end + # @deprecated In Rails 7.2+, migrations_paths is read from db_config, not from adapter method. + # For Rails 7.2+, you must specify migrations_paths in database.yml configuration. + # This method is kept for backward compatibility only. def migrations_paths @config[:migrations_paths] || 'db/migrate_clickhouse' end