//
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using NpgsqlTypes;
using WebAccess.MCP.WebCache;
#nullable disable
namespace WebAccess.MCP.WebCache.Migrations
{
[DbContext(typeof(WebCacheDbContext))]
[Migration("20260820061730_AddChunkFullTextSearch")]
partial class AddChunkFullTextSearch
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.4")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("WebAccess.MCP.WebCache.CachedWebPage", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("CacheKey")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character(64)")
.IsFixedLength();
b.Property("ContentHash")
.HasMaxLength(64)
.HasColumnType("character(64)")
.IsFixedLength();
b.Property("ContentType")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property("ExpiresAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("FetchedAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("FinalUrl")
.HasColumnType("text");
b.Property("HttpStatusCode")
.HasColumnType("integer");
b.Property("IsComplete")
.HasColumnType("boolean");
b.Property("RawHtml")
.HasColumnType("text");
b.Property("RequestedUrl")
.IsRequired()
.HasColumnType("text");
b.Property("Title")
.HasColumnType("text");
b.Property("TotalTextLength")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("CacheKey")
.IsUnique();
b.HasIndex("ExpiresAtUtc");
b.ToTable("cached_web_pages", (string)null);
});
modelBuilder.Entity("WebAccess.MCP.WebCache.CachedWebPageChunk", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("CachedWebPageId")
.HasColumnType("bigint");
b.Property("ChunkNumber")
.HasColumnType("integer");
b.Property("Length")
.HasColumnType("integer");
b.Property("SearchVector")
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("tsvector")
.HasAnnotation("Npgsql:TsVectorConfig", "simple")
.HasAnnotation("Npgsql:TsVectorProperties", new[] { "Text" });
b.Property("StartOffset")
.HasColumnType("integer");
b.Property("Text")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("SearchVector");
NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex("SearchVector"), "GIN");
b.HasIndex("CachedWebPageId", "ChunkNumber")
.IsUnique();
b.ToTable("cached_web_page_chunks", (string)null);
});
modelBuilder.Entity("WebAccess.MCP.WebCache.CachedWebPageChunk", b =>
{
b.HasOne("WebAccess.MCP.WebCache.CachedWebPage", "CachedWebPage")
.WithMany("Chunks")
.HasForeignKey("CachedWebPageId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CachedWebPage");
});
modelBuilder.Entity("WebAccess.MCP.WebCache.CachedWebPage", b =>
{
b.Navigation("Chunks");
});
#pragma warning restore 612, 618
}
}
}