PNixx / clickhouse-activerecord

A Ruby database ActiveRecord driver for ClickHouse

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NameError: uninitialized constant ClickhouseActiverecord::Migrator when running `db:schema:load`

grk opened this issue · comments

Running clickhouse-activerecord 1.0.1 on Rails 7.1.2. When I want to load the schema in test mode (or CI), I encounter the following error:

** Execute db:schema:load
bin/rails aborted!
NameError: uninitialized constant ClickhouseActiverecord::Migrator (NameError)

        connection.assume_migrated_upto_version(info[:version], ClickhouseActiverecord::Migrator.migrations_paths)
                                                                                      ^^^^^^^^^^
/Users/grk/.asdf/installs/ruby/3.3.0/lib/ruby/gems/3.3.0/gems/clickhouse-activerecord-1.0.1/lib/clickhouse-activerecord/schema.rb:12:in `define'
/Users/grk/.asdf/installs/ruby/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.2/lib/active_record/schema.rb:50:in `define'
/Users/grk/code/mh-platform/db/clickhouse_measurements_schema.rb:13:in `<main>'

Which makes sense since there's no class for ClickhouseActiverecord::Migrator defined.

rake clickhouse:schema:load working?

Can you show row in clickhouse_measurements_schema.rb:13?

schema:

ClickhouseActiverecord::Schema.define(version: 2024_01_10_123010) do

clickhouse:schema:load:

rake clickhouse:schema:load
rake aborted!
Don't know how to build task 'load_config' (See the list of available tasks with `rake --tasks`)
Did you mean?  db:load_config

Tasks: TOP => clickhouse:schema:load
(See full trace by running task with --trace)

Fixed in v1.0.2