You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IrineSistiana
changed the title
AutoMigrate keeps receating tables if model has composite unique indexes
AutoMigrate keeps receating indexes if model has composite unique indexes
Sep 3, 2023
GORM Playground Link
go-gorm/playground#643
Description
初步 debug 了一下。如果只声明一个
uniqueIndex
,这里的 field.Unique 是 true 不会触发重建 index。但如果声明多个uniqueIndex
组成 composite unique indexes,每个 field.Unique 都是 false 。导致每次 AutoMigrate() 都会触发多次重建 index:gorm/migrator/migrator.go
Line 500 in ac07543
The text was updated successfully, but these errors were encountered: