using Microsoft.EntityFrameworkCore;

namespace LC_Api;

public partial class Db : DbContext
{

    public Db() => Database.EnsureCreated();
    public virtual DbSet<Error> Errors { get; set; }
    public virtual DbSet<Cam> Cams { get; set; }

    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    {
        //optionsBuilder.UseNpgsql("Host=172.24.12.201;Port=5432;Database=Notifications;Username=postgres;Password=4NUDZhJ7");
        optionsBuilder.UseSqlite("Data Source=Error.db");
    }

    protected override void OnModelCreating(ModelBuilder modelBuilder) 
    {
        OnModelCreatingPartial(modelBuilder);
    }

    partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}