migrate.go 383 B

12345678910111213141516171819
  1. package database
  2. import (
  3. "bigdata_archives/app/controller"
  4. "bigdata_archives/app/model"
  5. "bigdata_archives/utils"
  6. "gorm.io/gorm"
  7. )
  8. func Migrate(db *gorm.DB) {
  9. db.Set("gorm:table_options", "ENGINE=InnoDB").AutoMigrate(
  10. model.User{},
  11. model.SystemSettings{},
  12. controller.FaceRect{},
  13. controller.AccessControllerEvent{},
  14. utils.Temperature{},
  15. controller.EventLog{},
  16. )
  17. }