This commit is contained in:
[Valentino Heman Budiarto]
2026-03-06 14:00:50 +07:00
parent 54088abf22
commit ff78042fe4
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -4,7 +4,7 @@ import (
"fmt"
"log"
"os"
"s-class-backend/models" // Import package models
"s-class-backend/models"
"github.com/joho/godotenv"
"gorm.io/driver/postgres"
@@ -14,7 +14,7 @@ import (
var DB *gorm.DB
func ConnectDatabase() {
// Load .env
err := godotenv.Load()
if err != nil {
log.Fatal("Error loading .env file")
@@ -40,9 +40,9 @@ func ConnectDatabase() {
if err != nil {
fmt.Println("Gagal migrasi:", err)
} else {
fmt.Println("✅ Database Migrated!")
fmt.Println("Database Migrated!")
}
fmt.Println("🚀 Sukses terkoneksi ke Database PostgreSQL!")
fmt.Println("Sukses terkoneksi ke Database PostgreSQL!")
DB = database
}