diff --git a/Seasoned.Backend/Data/ApplicationDbContext.cs b/Seasoned.Backend/Data/ApplicationDbContext.cs index b365067..1b7765e 100644 --- a/Seasoned.Backend/Data/ApplicationDbContext.cs +++ b/Seasoned.Backend/Data/ApplicationDbContext.cs @@ -16,11 +16,26 @@ public class ApplicationDbContext : IdentityDbContext { base.OnModelCreating(modelBuilder); - modelBuilder.HasPostgresExtension("vector"); + if (Database.IsNpgsql()) + { + modelBuilder.HasPostgresExtension("vector"); + } - modelBuilder.Entity() - .HasOne() - .WithMany() - .HasForeignKey(r => r.UserId); + modelBuilder.Entity(entity => + { + entity.HasOne() + .WithMany() + .HasForeignKey(r => r.UserId); + + if (Database.ProviderName == "Microsoft.EntityFrameworkCore.InMemory") + { + entity.Ignore(r => r.Embedding); + } + else + { + entity.Property(r => r.Embedding) + .HasColumnType("vector(1536)"); + } + }); } } \ No newline at end of file diff --git a/Seasoned.Frontend/app/pages/gallery.vue b/Seasoned.Frontend/app/pages/gallery.vue index de02520..4091fed 100644 --- a/Seasoned.Frontend/app/pages/gallery.vue +++ b/Seasoned.Frontend/app/pages/gallery.vue @@ -233,7 +233,7 @@