Added vector search

This commit is contained in:
2026-03-18 20:17:45 +00:00
parent ac1a910bff
commit 8f6e7e2214
8 changed files with 65 additions and 4 deletions

View File

@@ -6,6 +6,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Pgvector;
using Seasoned.Backend.Data;
#nullable disable
@@ -13,8 +14,8 @@ using Seasoned.Backend.Data;
namespace Seasoned.Backend.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20260318044626_ChangeIconToImageUrl")]
partial class ChangeIconToImageUrl
[Migration("20260318201722_InitialCreateWith768Vector")]
partial class InitialCreateWith768Vector
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -234,6 +235,9 @@ namespace Seasoned.Backend.Migrations
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Vector>("Embedding")
.HasColumnType("vector(768)");
b.Property<string>("ImageUrl")
.HasColumnType("text");

View File

@@ -2,13 +2,14 @@
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Pgvector;
#nullable disable
namespace Seasoned.Backend.Migrations
{
/// <inheritdoc />
public partial class ChangeIconToImageUrl : Migration
public partial class InitialCreateWith768Vector : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
@@ -172,7 +173,8 @@ namespace Seasoned.Backend.Migrations
Ingredients = table.Column<List<string>>(type: "text[]", nullable: false),
Instructions = table.Column<List<string>>(type: "text[]", nullable: false),
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UserId = table.Column<string>(type: "text", nullable: true)
UserId = table.Column<string>(type: "text", nullable: true),
Embedding = table.Column<Vector>(type: "vector(768)", nullable: true)
},
constraints: table =>
{

View File

@@ -5,6 +5,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Pgvector;
using Seasoned.Backend.Data;
#nullable disable
@@ -231,6 +232,9 @@ namespace Seasoned.Backend.Migrations
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Vector>("Embedding")
.HasColumnType("vector(768)");
b.Property<string>("ImageUrl")
.HasColumnType("text");