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: many2many auto migrate #5322

Merged
merged 2 commits into from May 9, 2022
Merged

Conversation

a631807682
Copy link
Member

@a631807682 a631807682 commented May 6, 2022

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

What did this pull request do?

In many2many situation, ownField and relField cannot be resolved to primary keys, but are composite primary keys in the database.

This issues cause by field size and field database size not equal when they cannot be resolved to primary keys.

I don't know how to test in other driver and does only postgres have this problem, if so, maybe we can change here to columnType.PrimaryKey()

close #5320

User Case Description

@jinzhu jinzhu merged commit 373bcf7 into go-gorm:master May 9, 2022
@a631807682 a631807682 deleted the fix_many2many_migrate branch July 1, 2022 06:43
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.

AutoMigrate with Many2Many fails when using UUID for ID
2 participants