db.go 288 B

123456789101112131415
  1. package boot
  2. import (
  3. "passport/app/models"
  4. "passport/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. }