A web blog and personal homepage engine written in Go.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

13 lines
215 B

  1. package models
  2. import "github.com/jinzhu/gorm"
  3. // DB is the database handle for all the models.
  4. var DB *gorm.DB
  5. // UseDB registers a database driver.
  6. func UseDB(db *gorm.DB) {
  7. DB = db
  8. DB.AutoMigrate(&User{})
  9. }