colossus/models/init.go

17 lines
236 B
Go
Raw Normal View History

2022-11-25 15:13:32 -05:00
package models
import (
"gorm.io/gorm"
"gorm.io/driver/sqlite"
)
var (
DB *gorm.DB
)
func InitDB() {
DB, _ = gorm.Open(sqlite.Open("data/colossus.db"), &gorm.Config{})
// Migrate the schema
DB.AutoMigrate(&Component{})
}