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

Fix collation when renaming column in MySQL dialect #2666

Merged
merged 4 commits into from Feb 1, 2022

Conversation

straub
Copy link
Contributor

@straub straub commented Jun 20, 2018

Ran into an issue today where .renameColumn() was failing because the columns had a different collation after the rename and recreating the foreign keys caused an error. The collation was being lost during the alter change. This change preserves the collation through the alter.

I'm not familiar enough with the knex test suite to know how to go about adding an integration test for this. If someone can provide some pointers, I'd appreciate it. Didn't want to let that stop me raising the issue and providing this patch.

Thanks!

Copy link
Member

@elhigu elhigu left a comment

Choose a reason for hiding this comment

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

Needs integration tests, which verifies that renaming works correctly and collation is really preserved.

# Conflicts:
#	src/dialects/mysql/schema/tablecompiler.js
#	test/integration/builder/additional.js
@kibertoad kibertoad merged commit 81d6ffa into knex:master Feb 1, 2022
@kibertoad
Copy link
Collaborator

Released in 1.0.2

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

Successfully merging this pull request may close these issues.

None yet

4 participants