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: migrator for mysql 5.6 #141

Merged
merged 1 commit into from
Feb 6, 2024
Merged

fix: migrator for mysql 5.6 #141

merged 1 commit into from
Feb 6, 2024

Conversation

black-06
Copy link
Contributor

@black-06 black-06 commented Feb 6, 2024

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

fix migrator for mysql 5.6.

Add DontSupportDropConstraint because MySQL 5.x does not support drop constraint for any type.

And it has been tested here at go-gorm/gorm#6822 with commit go-gorm/gorm@288c065

User Case Description

@black-06 black-06 marked this pull request as ready for review February 6, 2024 08:47
@black-06 black-06 changed the title fix: migrator for mysql 5.6 and tidb fix: migrator for mysql 5.6 Feb 6, 2024
migrator.go Show resolved Hide resolved
@black-06
Copy link
Contributor Author

black-06 commented Feb 6, 2024

@a631807682 But I wonder why this test has not failed before, It has a history of 3 years

https://github.com/go-gorm/gorm/blob/9514d5f9e677e0c94d3d4e48d4f08c649f092d9a/tests/migrate_test.go#L669C1-L693C2

the error should be:

Error 1064 (42000): You have an error in your SQL syntax; 
check the manual that corresponds to your MySQL server version for the right syntax 
to use near 'CONSTRAINT `fk_users_account`' at line 1

@a631807682
Copy link
Member

@a631807682 But I wonder why this test has not failed before, It has a history of 3 years

go-gorm/gorm@9514d5f/tests/migrate_test.go#L669C1-L693C2

the error should be:

Error 1064 (42000): You have an error in your SQL syntax; 
check the manual that corresponds to your MySQL server version for the right syntax 
to use near 'CONSTRAINT `fk_users_account`' at line 1

e05761b#diff-a5ca21254ced8196f81a4c4e926af32db03cb0ea78a1f853835300f6dda3f0c6L212

@black-06
Copy link
Contributor Author

black-06 commented Feb 6, 2024

e05761b#diff-a5ca21254ced8196f81a4c4e926af32db03cb0ea78a1f853835300f6dda3f0c6L212

Stupid me....😭

@jinzhu jinzhu merged commit b87f024 into go-gorm:master Feb 6, 2024
3 checks passed
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.

3 participants