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 迁移时间很久 #3353

Closed
wleven opened this issue Sep 1, 2020 · 2 comments
Closed

AutoMigrate 迁移时间很久 #3353

wleven opened this issue Sep 1, 2020 · 2 comments
Assignees
Labels

Comments

@wleven
Copy link

wleven commented Sep 1, 2020

GORM Playground Link

go-gorm/playground#1

Description

type User struct {
 PassWord string  `json:"passWord,omitempty" gorm:"size:32"` 
}

db.AutoMigrate(&User{})

2020/09/01 16:49:21 D:/zhiming/api/main.go:65
[1.049ms] [rows:0] select * from `users`

2020/09/01 16:50:22 D:/go/pkg/mod/gorm.io/driver/mysql@v1.0.1/migrator.go:30
[60089.026ms] [rows:0] ALTER TABLE `users` MODIFY COLUMN `pass_word` varchar(32)

表里有6000行数据
不指定PassWord 长度就很快,指定长度就很慢
这是正常的吗

@github-actions github-actions bot added the type:missing reproduction steps missing reproduction steps label Sep 1, 2020
@github-actions
Copy link

github-actions bot commented Sep 1, 2020

This issue has been automatically marked as stale as it missing playground pull request link, checkout https://github.com/go-gorm/playground for details, it will be closed in 2 days if no further activity occurs.

@jinzhu
Copy link
Member

jinzhu commented Sep 1, 2020

The altering SQL slow doesn't related to GORM...

@jinzhu jinzhu closed this as completed Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants