Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalize table name in schema dump #148

Merged
merged 2 commits into from
Jul 26, 2024

Conversation

danielwestendorf
Copy link
Contributor

When running separate databases for different environments (i.e. development, test) on the same machine, you will likely specify a different database name in database.yml. If you then run migrations in a different ENV, you will get schema changes as the database name will be dumped to the schema comments.

This change strips the database name from the schema, leaving only the table name.

Before:

# SQL: CREATE TABLE database_name.table_name
create_table "table_name" ...

Afteer:

# SQL: CREATE TABLE table_name
create_table "table_name" ...

@danielwestendorf
Copy link
Contributor Author

Replacement for #147; the change in the schema dumper class did not impact table views, which would reference the database.

@PNixx PNixx merged commit 1582b50 into PNixx:master Jul 26, 2024
6 checks passed
syabruk pushed a commit to machinio/clickhouse-activerecord that referenced this pull request Aug 19, 2024
strip the database name from schema dump
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.

3 participants