-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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: fix sync
creating the reference multiple time if lower_case_table_names
= 1
#17256
Conversation
Sorry this is not the right solution for the problem as it would introduce problems in systems that are case sensitive In my opinion, the solution to this would be to implement #15312, and make sure all names are generated lowercase if that flag is on |
yes, you are right to implement naming conventions and making all names lowercase if that flag is set to true but what if some one first create tables with migrations and then after some time he turn that flag to true, then the same issue will be persist what I think if there is any way to know if server does not support particular case and we then handle that accordingly. |
what if we check default COLLATE of SQL SERVER and modify condition accordingly as it occurs when COLLATE is case insensitive and these two collates are case insensitive Latin1_General_CI_AS, SQL_Latin1_General_CP1_CI_AS |
According to mysql's documentation, If we look at all possible options for
|
sync
creating the reference multiple time if lower_case_table_names = 1
sync
creating the reference multiple time if lower_case_table_names = 1sync
creating the reference multiple time if lower_case_table_names
= 1
you are referring to something else when make query to database it does not create problem in the provided example in the issue section my query from database is executing right as it search case insensitive search but when we compare it here in sequelize it generate issue. the following query give me reference table schema and referenced table name which is from database and if it is stored in lowercase and in code some one using camel case then it would not delete previous references.
we have problem in the following condition
I don't think so to allow some one to create same table or schema name with different cases and if consider it then case insensitive search here would not generate any issue. like user should not be allowed to create Users and users two different tables. |
No, I am talking about the issue of comparing the value in JavaScript, and as stated, if we generate a value that MySQL considers lowercase when
I disagree, if the database is case-sensitive, then we need to compare the values in a case-sensitive way, the alternative would not be safe and would lead Sequelize to think two different identifiers are the same even though they are not. It's impossible for us to prevent users from creating two identifiers that are equal when case-sensitive, but not when insensitive. Degrading the support for case-sensitive databases is not a solution to support case-insensitive databases |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the current state, this is not something we can merge so I'm posting a change request
Pull Request Checklist
Description of Changes
Link to issue this PR resolve
(#17255)
List of Breaking Changes