如何使多个模型在gorm中自动迁移

i can see the documentation we do automigrate like this, db.AutoMigrate(&model.TheTodo{})

how about if we have a lot of multiples models? db.AutoMigrate(&model.TheTodo{}, &model.TheBlog{}, &model.Employee{}, and many more...... )

will gorm create that table if we put like that? and is that any way to make inside AutoMigrate to make short?

db.AutoMigrate(allmodels)

would it possible ?

You can do:

db.AutoMigrate(
    &User{}, 
    &Product{},
    &Order{},
)

If you want to make the inside "short", you could do:

var models := []interface{&User{}, &Product{}, &Order{}}

db.Automigrate(models...)