package dao

import (
	"fmt"
	"gorm.io/gorm"
)

var Db *gorm.DB

func InitDB(db *gorm.DB) {
	Db = db
	err := Db.AutoMigrate(
		&GarbageData{},
		&EnvironmentData{},
		&EnvironmentDataSummary{},
	)
	if err != nil {
		panic(fmt.Sprintf("AutoMigrate err : %v", err))
	}
}
