+
Skip to content

AUTO_RANDOM dont work for tidb #7506

Open
@zasyadko

Description

@zasyadko

The example is taken from the documentation, and even when the correct tags are specified, a field is still created in the table with AUTO_INCRIMENT instead of AUTO_RANDOM

type Product struct {
  ID    uint `gorm:"primaryKey;default:auto_random()"`
  Code  string
  Price uint
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载