db.go 316 B

123456789101112131415
  1. package boot
  2. import (
  3. "shopperthree_manage_v2/app/models"
  4. "shopperthree_manage_v2/client/mysql"
  5. )
  6. func InitModel() error {
  7. var err = mysql.Client.Master().Set("gorm:table_options", "ENGINE=InnoDB CHARSET=utf8mb4 auto_increment=1").
  8. AutoMigrate(
  9. &models.TAdmin{},
  10. &models.File{},
  11. ).Error
  12. return err
  13. }