using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CvMatcher.Data.Migrations
{
///
public partial class InitialSchema : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.EnsureSchema(
name: "cvMatcher");
migrationBuilder.CreateTable(
name: "AiPrompts",
schema: "cvMatcher",
columns: table => new
{
Key = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false),
Language = table.Column(type: "nvarchar(8)", maxLength: 8, nullable: false),
Value = table.Column(type: "nvarchar(max)", nullable: false),
Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false, defaultValue: ""),
UpdatedAt = table.Column(type: "datetime2", nullable: false, defaultValueSql: "SYSUTCDATETIME()")
},
constraints: table =>
{
table.PrimaryKey("PK_AiPrompts", x => new { x.Key, x.Language });
});
migrationBuilder.CreateTable(
name: "ChatCache",
schema: "cvMatcher",
columns: table => new
{
CacheKey = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false),
Model = table.Column(type: "nvarchar(120)", maxLength: 120, nullable: false),
Temperature = table.Column(type: "decimal(4,2)", nullable: false),
ResponseText = table.Column(type: "nvarchar(max)", nullable: false),
CreatedAt = table.Column(type: "datetime2", nullable: false, defaultValueSql: "SYSUTCDATETIME()")
},
constraints: table =>
{
table.PrimaryKey("PK_ChatCache", x => x.CacheKey);
});
migrationBuilder.CreateTable(
name: "Results",
schema: "cvMatcher",
columns: table => new
{
Id = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false),
CvDocumentId = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false),
JobDocumentId = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false),
Language = table.Column(type: "nvarchar(450)", nullable: false),
ResultJson = table.Column(type: "nvarchar(max)", nullable: false),
Score = table.Column(type: "int", nullable: false),
CreatedAt = table.Column(type: "datetime2", nullable: false, defaultValueSql: "SYSUTCDATETIME()")
},
constraints: table =>
{
table.PrimaryKey("PK_Results", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_Results_CvDocumentId_JobDocumentId_Language",
schema: "cvMatcher",
table: "Results",
columns: new[] { "CvDocumentId", "JobDocumentId", "Language" },
unique: true);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AiPrompts",
schema: "cvMatcher");
migrationBuilder.DropTable(
name: "ChatCache",
schema: "cvMatcher");
migrationBuilder.DropTable(
name: "Results",
schema: "cvMatcher");
}
}
}