13 lines
215 B
Go
13 lines
215 B
Go
|
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(&User{})
|
||
|
}
|