package migrations

import (
	"fmt"
	users "server/internal/user"

	"gorm.io/gorm"
)

func AutoMigrate(db *gorm.DB) error {
	if err := db.AutoMigrate(&users.User{}, &users.UserDetails{}, &users.UserPreferences{}, &users.Session{}, &users.PasswordResetToken{}); err != nil {
		return fmt.Errorf("migrate user: %w", err)
	}
	return nil
}
