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.
Bowl_in/Sources/API/Gin Gonic/model/database.go

19 lines
358 B

package model
import (
"github.com/jinzhu/gorm"
"log"
)
var Db *gorm.DB
var Err error
func InitializeDatabase() {
Db, Err = gorm.Open("postgres", "host=localhost port=5432 user=bowlin_team dbname=bowlin password=bowlin")
if Err != nil {
log.Fatal(Err)
}
// Automatically create the "users" table based on the User model
Db.AutoMigrate(&User{})
}