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

SQL Server case sensitive database #76

Closed
EvgeniaAilin opened this issue Nov 16, 2022 · 3 comments
Closed

SQL Server case sensitive database #76

EvgeniaAilin opened this issue Nov 16, 2022 · 3 comments

Comments

@EvgeniaAilin
Copy link
Contributor

Hi, I'm trying to work with SQLServer database created with collation SQL_Latin1_General_CP1_CS_AS (case sensitive).
While migration tables, I discovered that several migrator's queries fail. After some research I found that migrator for SQL Server uses names of System Views and their columns names sometimes in uppercase, sometimes in lowercase.

Example:
in function: func (m Migrator) HasColumn written:
"SELECT count(*) FROM INFORMATION_SCHEMA.columns WHERE table_catalog = ? AND table_name = ? AND column_name = ?"

After I change it to "SELECT count(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_CATALOG = ? AND TABLE_NAME = ? AND COLUMN_NAME = ?" - this query works.

Does someone did test GORM for case sensitive collation (SQL Server)?

Appreciate your fast response.

@github-actions
Copy link

The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.ioSearch Before Asking

@a631807682 a631807682 transferred this issue from go-gorm/gorm Nov 17, 2022
@a631807682
Copy link
Member

a631807682 commented Nov 17, 2022

That's exactly what it sounds like, would you be interested in creating a PR for it ?

@EvgeniaAilin
Copy link
Contributor Author

That's exactly what it sounds like, would you be interested in creating a PR for it ?

Yes, I would like to create PR to fix issue with SQL Server case sensitive database. How can I do it? I'm new in GitHub and appreciate for any help.
I did changes in the file migrator.go in package sqlserver. Now I'm resting it on my SQLServer database before requesting PR.

@jinzhu jinzhu closed this as completed Jan 13, 2023
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

No branches or pull requests

3 participants