package main

import (
	"fmt"
	"log"
	"nearle/db"
	"nearle/models"

	"github.com/joho/godotenv"
)

func main() {
	if err := godotenv.Load(); err != nil {
		log.Println("No .env file found, relying on environment variables")
	}

	db.Connect()

	fmt.Println("Migrating RiderSubstitution table...")
	err := db.DB.AutoMigrate(&models.RiderSubstitution{})
	if err != nil {
		log.Fatalf("Failed to auto migrate: %v", err)
	}

	fmt.Println("Successfully created rider_substitutions table in the database!")
}
