package models import "github.com/jinzhu/gorm" // DB is the database handle for all the models. var DB *gorm.DB // UseDB registers a database driver. func UseDB(db *gorm.DB) { DB = db DB.AutoMigrate(&AppSetting{}) DB.AutoMigrate(&User{}) }