using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;

namespace Managing.Infrastructure.Databases.PostgreSql;

public class DesignTimeDbContextFactory : IDesignTimeDbContextFactory<ManagingDbContext>
{
    public ManagingDbContext CreateDbContext(string[] args)
    {
        var optionsBuilder = new DbContextOptionsBuilder<ManagingDbContext>();
        
        // Use a default connection string for design-time migrations
        // This should match your local PostgreSQL setup
        optionsBuilder.UseNpgsql("Host=localhost;Port=5432;Database=managing;Username=postgres;Password=postgres");

        return new ManagingDbContext(optionsBuilder.Options);
    }
} 