mirror of
https://github.com/marcominerva/SqlDatabaseVectorSearch.git
synced 2026-06-20 12:23:10 +00:00
a0a6df9cb3
- Updated `Documents.razor` to show a loading spinner when documents are being fetched, introducing an `isLoading` state variable. - Added `ConfigureDatabaseAsync` method in `Program.cs` for handling database migrations at startup. - Modified `SqlDatabaseVectorSearch.csproj` to include `Microsoft.EntityFrameworkCore.Tools` for migration management. - Enhanced documentation in `docs.md` regarding the `Dimensions` property and `VECTOR` column size requirements. - Created initial migration files to define the database schema for `Documents` and `DocumentChunks` tables. - Defined `Document` and `DocumentChunk` entities in migration files for data storage and retrieval.
91 lines
3.2 KiB
C#
91 lines
3.2 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using SqlDatabaseVectorSearch.DataAccessLayer;
|
|
|
|
#nullable disable
|
|
|
|
namespace SqlDatabaseVectorSearch.DataAccessLayer.Migrations
|
|
{
|
|
[DbContext(typeof(ApplicationDbContext))]
|
|
partial class ApplicationDbContextModelSnapshot : ModelSnapshot
|
|
{
|
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "9.0.2")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
|
|
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("SqlDatabaseVectorSearch.DataAccessLayer.Entities.Document", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset>("CreationDate")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(255)
|
|
.HasColumnType("nvarchar(255)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Documents", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("SqlDatabaseVectorSearch.DataAccessLayer.Entities.DocumentChunk", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<string>("Content")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<Guid>("DocumentId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.PrimitiveCollection<string>("Embedding")
|
|
.IsRequired()
|
|
.HasColumnType("vector(1536)");
|
|
|
|
b.Property<int>("Index")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("DocumentId");
|
|
|
|
b.ToTable("DocumentChunks", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("SqlDatabaseVectorSearch.DataAccessLayer.Entities.DocumentChunk", b =>
|
|
{
|
|
b.HasOne("SqlDatabaseVectorSearch.DataAccessLayer.Entities.Document", "Document")
|
|
.WithMany("Chunks")
|
|
.HasForeignKey("DocumentId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired()
|
|
.HasConstraintName("FK_DocumentChunks_Documents");
|
|
|
|
b.Navigation("Document");
|
|
});
|
|
|
|
modelBuilder.Entity("SqlDatabaseVectorSearch.DataAccessLayer.Entities.Document", b =>
|
|
{
|
|
b.Navigation("Chunks");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|