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: mysql hasColumn Error.(hasColumn a_id but hasColumn('a_Id') is false) #5148

Merged
merged 2 commits into from Apr 29, 2022
Merged

Conversation

KlausBai
Copy link
Contributor

I find this problem when i use strapi who will try to create column a_id although i already have a column a_Id on mysql.
This is my first pull request, if there are any error, please give me a change to correct it.

@coveralls
Copy link

coveralls commented Apr 28, 2022

Coverage Status

Coverage increased (+0.0006%) to 92.271% when pulling b2241e6 on KlausBai:master into cb23001 on knex:master.

@OlivierCavadenti
Copy link
Collaborator

We are sure we want a case insensitive check ? Why it's bug ?

@KlausBai
Copy link
Contributor Author

just like this issue about sqlite
#3434

@KlausBai
Copy link
Contributor Author

Sorry, i had not get your point, knex's hasColumn of mysql is case sensitive now

@KlausBai
Copy link
Contributor Author

And sqlite has checked 'hasColumn' by this.client.wrapIdentifier(col.name.toLowerCase()) === this.client.wrapIdentifier(column.toLowerCase()) why mysql not

Copy link
Collaborator

@OlivierCavadenti OlivierCavadenti left a comment

Choose a reason for hiding this comment

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

Ok ! By the way, can you do an integration test for this case ?

add a test to check mysql's 'hasColumn' with being case insensitive
@KlausBai
Copy link
Contributor Author

Sure.I have finished it now.

@OlivierCavadenti OlivierCavadenti merged commit 1525f0f into knex:master Apr 29, 2022
@kibertoad
Copy link
Collaborator

Released in 2.1.0

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.

None yet

4 participants