using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace JobTrackerApi.Migrations
{
///
public partial class AddAiInteractions : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AiInteractions",
columns: table => new
{
Id = table.Column(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
OwnerUserId = table.Column(type: "TEXT", nullable: false),
JobApplicationId = table.Column(type: "INTEGER", nullable: false),
Module = table.Column(type: "TEXT", nullable: false),
Mode = table.Column(type: "TEXT", nullable: true),
Title = table.Column(type: "TEXT", nullable: false),
Provider = table.Column(type: "TEXT", nullable: false),
ResultJson = table.Column(type: "TEXT", nullable: false),
CreatedAtUtc = table.Column(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AiInteractions", x => x.Id);
table.ForeignKey(
name: "FK_AiInteractions_JobApplications_JobApplicationId",
column: x => x.JobApplicationId,
principalTable: "JobApplications",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_AiInteractions_JobApplicationId",
table: "AiInteractions",
column: "JobApplicationId");
migrationBuilder.CreateIndex(
name: "IX_AiInteractions_OwnerUserId_JobApplicationId_Module_CreatedAtUtc",
table: "AiInteractions",
columns: new[] { "OwnerUserId", "JobApplicationId", "Module", "CreatedAtUtc" });
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AiInteractions");
}
}
}