Skip to content

Conversation

@Flamefork
Copy link
Contributor

This fixes the issue of using a generated schema.sql with ClickHouse in Docker.
The ClickHouse entrypoint runs every .sql file in /docker-entrypoint-initdb.d during server startup, but it executes them against the default database.

It works if the schema dump was created from the default database, but it fails otherwise:

/entrypoint.sh: running /docker-entrypoint-initdb.d/schema.sql
Received exception from server (version 25.3.6):
Code: 60. DB::Exception: Received from 127.0.0.1:9000. DB::Exception: Table default.schema_migrations does not exist. Maybe you meant my_database_name.schema_migrations?. (UNKNOWN_TABLE)

This fix prefixes migrations_table_name with db_name. in the generated schema, making it consistent with the table creation statements and with other drivers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant