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

AutoMigrate Error 1091 (42000): Can't DROP 'uni_sys_users_user_name'; check that column/key exists #7291

Open
aixj1984 opened this issue Nov 24, 2024 · 0 comments
Assignees
Labels
type:question general questions

Comments

@aixj1984
Copy link

GORM Playground Link

go-gorm/playground#1

Description

version:1.25.10
question: It can only be executed when the table is created for the first time. If it is executed again, as long as there is a unique index in the table, it will prompt that an undefined index cannot be deleted.
-- 只有第一次创建表的时候可以执行,再次执行,只要表有唯一索引,就会提示无法删除一个未定义的索引
error:Error 1091 (42000): Can't DROP 'uni_sys_users_user_name'; check that column/key exists

UserName string gorm:"size:50;column:user_name;comment:登录名称;uniqueIndex:idx_user_name;" json:"userName" // 登录名称

@github-actions github-actions bot added the type:question general questions label Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question general questions
Projects
None yet
Development

No branches or pull requests

2 participants