You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a rails app with config.active_record.schema_format = :sql. When I run the db:schema:dump command the schema_migrations table is being ignored and does not end up in the db/clickhouse_structure.sql file.
The migrations versions are considered part of the schema dump. And I do end up with statements appended to the end of the file that look like:
-- create some tables etc-- at the end of the db/clickhouse_structure.sql file, are the AR schema migration inserts:INSERT INTO schema_migrations (version) VALUES
('20240603201007');
However, because the schema_migrations table is not preset in the structure file, when I do something like RAILS_ENV=test ./bin/rails db:create db:prepare these insert statements produce an error, because the schema_migrations table is not present.
Compared to the PostgreSQL adapter (for example), there is a schema_migrations table in the structure dump that looks like:
--
-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.schema_migrations (
version character varying NOT NULL
);
The text was updated successfully, but these errors were encountered:
@PNixx I think I understand the rationale behind not locking the implementation of schema_migrations and ar_internal_metadata into a SQL dump. But since that change was made, would it make sense instead to make sure db:create creates those tables? We did this on our main branch. I can make a separate PR for this if this is a solution you like.
Version: clickhouse-activerecord (1.0.9)
Rails: 7.1
I have a rails app with
config.active_record.schema_format = :sql
. When I run thedb:schema:dump
command the schema_migrations table is being ignored and does not end up in thedb/clickhouse_structure.sql
file.The migrations versions are considered part of the schema dump. And I do end up with statements appended to the end of the file that look like:
However, because the
schema_migrations
table is not preset in the structure file, when I do something likeRAILS_ENV=test ./bin/rails db:create db:prepare
these insert statements produce an error, because the schema_migrations table is not present.Compared to the PostgreSQL adapter (for example), there is a schema_migrations table in the structure dump that looks like:
The text was updated successfully, but these errors were encountered: