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.

27 lines
478 B

package models
import (
// DB is the database handle for all the models.
var DB *gorm.DB
// BaseModel is the base column set for all models.
type BaseModel struct {
ID int `gorm:"primary_key"`
CreatedAt time.Time
UpdatedAt time.Time
// UseDB registers a database driver.
func UseDB(db *gorm.DB) {
DB = db