Move RAG repository from rag-api to rag-data — consolidate data layer ownership
- Move IRagRepository, EfRagRepository, and VectorSerializer from rag-api/Data to rag-data/Repositories - Add rag-api-models ProjectReference to rag-data.csproj for model type availability - Delete rag-api/Data folder (no longer needed; all data access is now in rag-data) - This aligns RAG with email-api and other services: all data code in the data project Pattern: rag-api (API logic) → rag-data (repository, EF entities, migrations) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,8 +5,8 @@ namespace CvSearch.Data;
|
||||
|
||||
public sealed class CvSearchDbContext : DbContext
|
||||
{
|
||||
public const string SchemaName = "cvSearch";
|
||||
public const string MigrationTableName = "_Migrations";
|
||||
public const string SchemaName = MigrationConstants.SchemaName;
|
||||
public const string MigrationTableName = MigrationConstants.MigrationTableName;
|
||||
|
||||
public CvSearchDbContext(DbContextOptions<CvSearchDbContext> options) : base(options) { }
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace CvSearch.Data;
|
||||
|
||||
/// <summary>
|
||||
/// Schema constants used by CvSearchDbContext and migrations.
|
||||
/// Centralized to avoid hardcoded strings and ensure consistency.
|
||||
/// </summary>
|
||||
public static class MigrationConstants
|
||||
{
|
||||
public const string SchemaName = "cvSearch";
|
||||
public const string MigrationTableName = "_Migrations";
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using CvSearch.Data;
|
||||
|
||||
#nullable disable
|
||||
|
||||
@@ -12,11 +13,11 @@ namespace CvSearch.Data.Migrations
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.EnsureSchema(
|
||||
name: "cvSearch");
|
||||
name: MigrationConstants.SchemaName);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "JobSearchResults",
|
||||
schema: "cvSearch",
|
||||
schema: MigrationConstants.SchemaName,
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
|
||||
@@ -36,7 +37,7 @@ namespace CvSearch.Data.Migrations
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "JobSearchSessions",
|
||||
schema: "cvSearch",
|
||||
schema: MigrationConstants.SchemaName,
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
|
||||
@@ -55,7 +56,7 @@ namespace CvSearch.Data.Migrations
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "JobSearchTokens",
|
||||
schema: "cvSearch",
|
||||
schema: MigrationConstants.SchemaName,
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
|
||||
@@ -88,15 +89,15 @@ namespace CvSearch.Data.Migrations
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "JobSearchResults",
|
||||
schema: "cvSearch");
|
||||
schema: MigrationConstants.SchemaName);
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "JobSearchSessions",
|
||||
schema: "cvSearch");
|
||||
schema: MigrationConstants.SchemaName);
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "JobSearchTokens",
|
||||
schema: "cvSearch");
|
||||
schema: MigrationConstants.SchemaName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using CvSearch.Data;
|
||||
|
||||
#nullable disable
|
||||
|
||||
@@ -12,7 +13,7 @@ namespace CvSearch.Data.Migrations
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Language",
|
||||
schema: "cvSearch",
|
||||
schema: MigrationConstants.SchemaName,
|
||||
table: "JobSearchTokens",
|
||||
type: "nvarchar(8)",
|
||||
maxLength: 8,
|
||||
@@ -21,7 +22,7 @@ namespace CvSearch.Data.Migrations
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Language",
|
||||
schema: "cvSearch",
|
||||
schema: MigrationConstants.SchemaName,
|
||||
table: "JobSearchSessions",
|
||||
type: "nvarchar(8)",
|
||||
maxLength: 8,
|
||||
@@ -34,12 +35,12 @@ namespace CvSearch.Data.Migrations
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Language",
|
||||
schema: "cvSearch",
|
||||
schema: MigrationConstants.SchemaName,
|
||||
table: "JobSearchTokens");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Language",
|
||||
schema: "cvSearch",
|
||||
schema: MigrationConstants.SchemaName,
|
||||
table: "JobSearchSessions");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user