feat(cv): redesign document editing with revision-safe letters and writing tools

This commit is contained in:
cesnimda
2026-10-25 22:44:14 +01:00
parent 01e10996c5
commit 2bfaf6c14b
57 changed files with 2859 additions and 118 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("20261025090000_AddCoverLetterDocumentDesign")]
public sealed class AddCoverLetterDocumentDesign : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
var text = ActiveProvider.Contains("MySql", StringComparison.OrdinalIgnoreCase) ? "longtext" : "TEXT";
migrationBuilder.AddColumn<string>(name: "CoverLetterDocumentSettingsJson", table: "JobApplications", type: text, nullable: true);
migrationBuilder.AddColumn<string>(name: "DocumentSettingsJson", table: "CoverLetterVersions", type: text, nullable: true);
migrationBuilder.AddColumn<string>(name: "CoverLetterDocumentSettingsJson", table: "SubmittedApplicationPackages", type: text, nullable: true);
migrationBuilder.AddColumn<string>(name: "RenderedCoverLetterHtml", table: "SubmittedApplicationPackages", type: text, nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
foreach (var (table, column) in new[]
{
("JobApplications", "CoverLetterDocumentSettingsJson"), ("CoverLetterVersions", "DocumentSettingsJson"),
("SubmittedApplicationPackages", "CoverLetterDocumentSettingsJson"), ("SubmittedApplicationPackages", "RenderedCoverLetterHtml"),
})
{
if (ActiveProvider.Contains("Sqlite", StringComparison.OrdinalIgnoreCase))
migrationBuilder.Sql($"ALTER TABLE \"{table}\" DROP COLUMN \"{column}\";");
else migrationBuilder.DropColumn(name: column, table: table);
}
}
}