mirror of
https://github.com/ent/ent.git
synced 2026-05-22 09:31:45 +03:00
dialect/sql: support string based pk for mysql56 indexes (prevent err… (#2506)
* dialect/sql: support string based pk for mysql56 indexes (prevent error 1071) * Update entc/integration/customid/ent/schema/revision.go Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com> Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>
This commit is contained in:
@@ -736,7 +736,7 @@ func (d *MySQL) defaultSize(c *Column) int64 {
|
||||
case compareVersions(version, checked) != -1:
|
||||
// Column is non-unique, or not part of any index (reaching
|
||||
// the error 1071).
|
||||
case !c.Unique && len(c.indexes) == 0:
|
||||
case !c.Unique && len(c.indexes) == 0 && !c.PrimaryKey():
|
||||
default:
|
||||
size = 191
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user