using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Seasoned.Backend.Models; namespace Seasoned.Backend.Data; // Inherit from IdentityDbContext to enable User management public class ApplicationDbContext : IdentityDbContext { public ApplicationDbContext(DbContextOptions options) : base(options) { } public DbSet Recipes { get; set; } protected override void OnModelCreating(ModelBuilder modelBuilder) { // Crucial: Call the base method so Identity tables are configured base.OnModelCreating(modelBuilder); modelBuilder.HasPostgresExtension("vector"); // Optional: Ensure the Recipe table links to the Identity User modelBuilder.Entity() .HasOne() .WithMany() .HasForeignKey(r => r.UserId); } }