From a65efe9a5678b6b2d522c939bdcca2a28a096955 Mon Sep 17 00:00:00 2001 From: Samuel Zedec Date: Sun, 9 Nov 2025 01:33:09 -0400 Subject: [PATCH] =?UTF-8?q?refactor:=20renomear=20=C3=ADndice=20de=20embed?= =?UTF-8?q?dings=20para=20consist=C3=AAncia?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Atualiza `ix_product_embeddings_vector` para `ix_embeddings_vector` em migrações e configurações de entidades - Garante consistência no nome do índice em toda a base de código --- CHANGELOG.md | 6 ++++-- .../Extensions/EntityConfigurationExtension.cs | 2 +- .../Migrations/20251104000902_AddProductEmbeddingsTable.cs | 2 +- .../Persistence/Migrations/AppDbContextModelSnapshot.cs | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1afa10a..e396ad7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,10 @@ # Riber - Changelog +--- + ## v4.3.1 - 09/12/2025 -**REFATOÇÃO**: Remove o método de busca por id da entidade nos IAiModelService -Adiciona relationacimento entre entidade `ProductEmbeddings` e `Company` para uma melhor busca +**REFATORAÇÃO**: Remove o método de busca por id da entidade nos IAiModelService +Adiciona relacionamento entre entidade `ProductEmbeddings` e `Company` para uma melhor busca --- diff --git a/src/Riber.Infrastructure/Extensions/EntityConfigurationExtension.cs b/src/Riber.Infrastructure/Extensions/EntityConfigurationExtension.cs index e1c9a66..bd2f5e0 100644 --- a/src/Riber.Infrastructure/Extensions/EntityConfigurationExtension.cs +++ b/src/Riber.Infrastructure/Extensions/EntityConfigurationExtension.cs @@ -221,7 +221,7 @@ public static EntityTypeBuilder ConfigureVector(this EntityTypeBuilder builder .HasIndex(x => x.Embeddings) - .HasDatabaseName("ix_product_embeddings_vector") + .HasDatabaseName("ix_embeddings_vector") .HasMethod("hnsw") .HasOperators("vector_cosine_ops") .HasStorageParameter("m", 16) diff --git a/src/Riber.Infrastructure/Persistence/Migrations/20251104000902_AddProductEmbeddingsTable.cs b/src/Riber.Infrastructure/Persistence/Migrations/20251104000902_AddProductEmbeddingsTable.cs index 525c04d..54528f8 100644 --- a/src/Riber.Infrastructure/Persistence/Migrations/20251104000902_AddProductEmbeddingsTable.cs +++ b/src/Riber.Infrastructure/Persistence/Migrations/20251104000902_AddProductEmbeddingsTable.cs @@ -39,7 +39,7 @@ protected override void Up(MigrationBuilder migrationBuilder) column: "product_id"); migrationBuilder.CreateIndex( - name: "ix_product_embeddings_vector", + name: "ix_embeddings_vector", table: "product_embeddings", column: "embeddings_vector") .Annotation("Npgsql:IndexMethod", "hnsw") diff --git a/src/Riber.Infrastructure/Persistence/Migrations/AppDbContextModelSnapshot.cs b/src/Riber.Infrastructure/Persistence/Migrations/AppDbContextModelSnapshot.cs index 8fd293b..ea35b39 100644 --- a/src/Riber.Infrastructure/Persistence/Migrations/AppDbContextModelSnapshot.cs +++ b/src/Riber.Infrastructure/Persistence/Migrations/AppDbContextModelSnapshot.cs @@ -1520,7 +1520,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("CompanyId"); b.HasIndex("Embeddings") - .HasDatabaseName("ix_product_embeddings_vector") + .HasDatabaseName("ix_embeddings_vector") .HasAnnotation("Npgsql:StorageParameter:ef_construction", 64) .HasAnnotation("Npgsql:StorageParameter:m", 16);