Skip to content
Open
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
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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+
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably sit in default, not development, right?

```

Your model example:

```ruby
Expand Down
3 changes: 3 additions & 0 deletions lib/active_record/connection_adapters/clickhouse_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down