MySql table name capitalization cause problems on linux
See original GitHub issueI have a problem where after sequelize.sync({ force: true }) created tables has original Capitalized case, but when I am trying to store record via record.save() it runs query which uses all lowercase table name.
At the very least, on linux with default configuration this causes problem, since table Clients
!= clients
. I can manually create tables, but sounds like there should be a better way. Any ideas?
Issue Analytics
- State:
- Created 8 years ago
- Reactions:3
- Comments:5 (5 by maintainers)
Top Results From Across the Web
MySQL case sensitive table names on Linux
Because lower_case_table_names is set, each database and table name will be converted to lowercase as it is recreated: mysql < db1.sql.
Read more >MySql Case Sensitive Table Names Issue on Windows/Linux
lower_case_table_names=1 > table names are stored in lowercase on disk and comparisons are not case sensitive. lower_case_table_names=2 > table ...
Read more >Are table names in MySQL case sensitive? - Stack Overflow
1 - Table names are stored in lowercase on disk and name comparisons are not case sensitive. 2 - lettercase specified in the...
Read more >MySQL 8.0 Reference Manual :: 9.2.3 Identifier Case Sensitivity
Table and database names are stored on disk using the lettercase specified in the CREATE TABLE or CREATE DATABASE statement. Name comparisons are...
Read more >Uppercase letters in table name prefix - Warnings - Akeeba Ltd
Again, this is documented by MySQL itself! If your server is running on Linux OR a case-sensitive filesystem (e.g. HFS+ Case-Sensitive on macOS)...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Cannot reproduce on latest master. It uses the same table name both on sync and save in my case.
Which version are you on?
Perhaps you can provide a PR with a failing test case?
Small update/workaround - if I use:
freezeTableName: true, tableName: ‘clients’
This forces same table names during synchronization and in normal usage.
While workaround is fine in my case, this sounds like a bug.