Changes
Build and Push Docker Images / build (push) Failing after 1s

This commit is contained in:
2026-05-07 17:09:24 +03:00
parent 898f4987a5
commit fe3dbc37ad
16 changed files with 939 additions and 212 deletions
+9 -4
View File
@@ -5,6 +5,9 @@ namespace Api.Data;
public sealed class RagDbContext : DbContext
{
public const string SchemaName = "rag";
public const string MigrationTableName = "_Migrations";
public RagDbContext(DbContextOptions<RagDbContext> options) : base(options)
{
}
@@ -16,9 +19,11 @@ public sealed class RagDbContext : DbContext
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.HasDefaultSchema(SchemaName);
modelBuilder.Entity<RagDocumentEntity>(entity =>
{
entity.ToTable("RagDocuments");
entity.ToTable("Documents");
entity.HasKey(x => x.Id);
entity.Property(x => x.Id).HasMaxLength(64);
entity.Property(x => x.DocumentType).HasMaxLength(80).IsRequired();
@@ -34,7 +39,7 @@ public sealed class RagDbContext : DbContext
modelBuilder.Entity<RagChunkEntity>(entity =>
{
entity.ToTable("RagChunks");
entity.ToTable("Chunks");
entity.HasKey(x => x.Id);
entity.Property(x => x.Id).HasMaxLength(64);
entity.Property(x => x.DocumentId).HasMaxLength(64).IsRequired();
@@ -48,7 +53,7 @@ public sealed class RagDbContext : DbContext
modelBuilder.Entity<RagEmbeddingCacheEntity>(entity =>
{
entity.ToTable("RagEmbeddingCache");
entity.ToTable("EmbeddingCache");
entity.HasKey(x => x.CacheKey);
entity.Property(x => x.CacheKey).HasMaxLength(64);
entity.Property(x => x.Model).HasMaxLength(120).IsRequired();
@@ -60,7 +65,7 @@ public sealed class RagDbContext : DbContext
modelBuilder.Entity<RagChatCompletionCacheEntity>(entity =>
{
entity.ToTable("RagChatCompletionCache");
entity.ToTable("ChatCompletionCache");
entity.HasKey(x => x.CacheKey);
entity.Property(x => x.CacheKey).HasMaxLength(64);
entity.Property(x => x.Model).HasMaxLength(120).IsRequired();
+1 -1
View File
@@ -20,7 +20,7 @@ public sealed class EfRagRepository : IRagRepository
public async Task InitializeAsync(CancellationToken ct)
{
_logger.LogInformation("Ensuring RAG database schema exists using EF Core");
await _db.Database.EnsureCreatedAsync(ct);
//await _db.Database.EnsureCreatedAsync(ct);
}
public async Task<RagDocumentRecord?> GetDocumentByTextHashAsync(string textHash, string? sourceUrl, CancellationToken ct)