feat(career): add factual evidence bank

This commit is contained in:
cesnimda
2026-08-31 17:03:09 +02:00
parent 5337ba3a5e
commit 78ad0c66f9
16 changed files with 362 additions and 5 deletions
@@ -0,0 +1,35 @@
using JobTrackerApi.Data;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace JobTrackerApi.Migrations;
[DbContext(typeof(JobTrackerContext))]
[Migration("20260830136000_AdoptCareerEvidenceSchema")]
public sealed class AdoptCareerEvidenceSchema : Migration
{
protected override void Up(MigrationBuilder migrationBuilder) => migrationBuilder.Sql(
ActiveProvider.Contains("MySql", StringComparison.OrdinalIgnoreCase) ? MySqlDdl : SqliteDdl);
protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.Sql(
ActiveProvider.Contains("MySql", StringComparison.OrdinalIgnoreCase) ? "DROP TABLE IF EXISTS `CareerEvidence`;" : "DROP TABLE IF EXISTS \"CareerEvidence\";");
private const string SqliteDdl = """
CREATE TABLE IF NOT EXISTS "CareerEvidence" (
"Id" INTEGER NOT NULL CONSTRAINT "PK_CareerEvidence" PRIMARY KEY AUTOINCREMENT,
"OwnerUserId" TEXT NOT NULL, "Category" TEXT NOT NULL, "Title" TEXT NOT NULL,
"Statement" TEXT NOT NULL, "TagsJson" TEXT NOT NULL, "SourceType" TEXT NOT NULL,
"SourceReference" TEXT NULL, "IsVerified" INTEGER NOT NULL,
"CreatedAtUtc" TEXT NOT NULL, "UpdatedAtUtc" TEXT NOT NULL);
CREATE INDEX IF NOT EXISTS "IX_CareerEvidence_Owner_Updated" ON "CareerEvidence" ("OwnerUserId", "UpdatedAtUtc");
""";
private const string MySqlDdl = """
CREATE TABLE IF NOT EXISTS `CareerEvidence` (
`Id` int NOT NULL AUTO_INCREMENT, `OwnerUserId` varchar(255) NOT NULL,
`Category` varchar(32) NOT NULL, `Title` varchar(255) NOT NULL,
`Statement` longtext NOT NULL, `TagsJson` longtext NOT NULL,
`SourceType` varchar(32) NOT NULL, `SourceReference` varchar(500) NULL,
`IsVerified` tinyint(1) NOT NULL, `CreatedAtUtc` datetime(6) NOT NULL,
`UpdatedAtUtc` datetime(6) NOT NULL, PRIMARY KEY (`Id`)) CHARACTER SET=utf8mb4;
CREATE INDEX IF NOT EXISTS `IX_CareerEvidence_Owner_Updated` ON `CareerEvidence` (`OwnerUserId`, `UpdatedAtUtc`);
""";
}