< Summary

Line coverage
98%
Covered lines: 244
Uncovered lines: 4
Coverable lines: 248
Total lines: 296
Line coverage: 98.3%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
File 1: Up(...)100%11100%
File 1: Down(...)100%210%
File 2: BuildTargetModel(...)100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.AI.Persistence.EFCore/Migrations/20260521002000_Initial.cs

#LineLine coverage
 1using Microsoft.EntityFrameworkCore.Migrations;
 2
 3#nullable disable
 4
 5namespace Elsa.AI.Persistence.EFCore.Migrations;
 6
 7public partial class Initial : Migration
 8{
 9    protected override void Up(MigrationBuilder migrationBuilder)
 10    {
 3211        migrationBuilder.CreateTable(
 3212            name: "AIAuditRecords",
 3213            columns: table => new
 3214            {
 3215                Id = table.Column<string>(nullable: false),
 3216                TenantId = table.Column<string>(nullable: true),
 3217                ActorId = table.Column<string>(nullable: false),
 3218                ConversationId = table.Column<string>(nullable: true),
 3219                ProposalId = table.Column<string>(nullable: true),
 3220                ToolInvocationId = table.Column<string>(nullable: true),
 3221                Type = table.Column<string>(nullable: false),
 3222                Timestamp = table.Column<DateTimeOffset>(nullable: false),
 3223                TraceId = table.Column<string>(nullable: true),
 3224                Summary = table.Column<string>(nullable: false),
 3225                Data = table.Column<string>(nullable: false)
 3226            },
 3227            constraints: table =>
 3228            {
 3229                table.PrimaryKey("PK_AIAuditRecords", x => x.Id);
 6430            });
 31
 3232        migrationBuilder.CreateTable(
 3233            name: "AIConversations",
 3234            columns: table => new
 3235            {
 3236                Id = table.Column<string>(nullable: false),
 3237                TenantId = table.Column<string>(nullable: true),
 3238                UserId = table.Column<string>(nullable: false),
 3239                Title = table.Column<string>(nullable: true),
 3240                Status = table.Column<string>(nullable: false),
 3241                CreatedAt = table.Column<DateTimeOffset>(nullable: false),
 3242                UpdatedAt = table.Column<DateTimeOffset>(nullable: false),
 3243                ProviderSessionId = table.Column<string>(nullable: true),
 3244                RetentionMode = table.Column<string>(nullable: false),
 3245                RetentionExpiresAt = table.Column<DateTimeOffset>(nullable: true),
 3246                Messages = table.Column<string>(nullable: false)
 3247            },
 3248            constraints: table =>
 3249            {
 3250                table.PrimaryKey("PK_AIConversations", x => x.Id);
 6451            });
 52
 3253        migrationBuilder.CreateTable(
 3254            name: "AIProposals",
 3255            columns: table => new
 3256            {
 3257                Id = table.Column<string>(nullable: false),
 3258                TenantId = table.Column<string>(nullable: true),
 3259                ConversationId = table.Column<string>(nullable: false),
 3260                Kind = table.Column<string>(nullable: false),
 3261                Status = table.Column<string>(nullable: false),
 3262                BaselineWorkflowDefinitionId = table.Column<string>(nullable: true),
 3263                BaselineVersionId = table.Column<string>(nullable: true),
 3264                WorkflowPayload = table.Column<string>(nullable: false),
 3265                Rationale = table.Column<string>(nullable: false),
 3266                Warnings = table.Column<string>(nullable: false),
 3267                ValidationDiagnostics = table.Column<string>(nullable: false),
 3268                GraphDiff = table.Column<string>(nullable: true),
 3269                CreatedBy = table.Column<string>(nullable: false),
 3270                CreatedAt = table.Column<DateTimeOffset>(nullable: false),
 3271                ReviewedBy = table.Column<string>(nullable: true),
 3272                ReviewedAt = table.Column<DateTimeOffset>(nullable: true),
 3273                AppliedBy = table.Column<string>(nullable: true),
 3274                AppliedAt = table.Column<DateTimeOffset>(nullable: true)
 3275            },
 3276            constraints: table =>
 3277            {
 3278                table.PrimaryKey("PK_AIProposals", x => x.Id);
 6479            });
 80
 3281        migrationBuilder.CreateIndex(
 3282            name: "IX_AIAuditRecords_ProposalId",
 3283            table: "AIAuditRecords",
 3284            column: "ProposalId");
 85
 3286        migrationBuilder.CreateIndex(
 3287            name: "IX_AIAuditRecords_ActorId",
 3288            table: "AIAuditRecords",
 3289            column: "ActorId");
 90
 3291        migrationBuilder.CreateIndex(
 3292            name: "IX_AIAuditRecords_TenantId_Timestamp",
 3293            table: "AIAuditRecords",
 3294            columns: new[] { "TenantId", "Timestamp" });
 95
 3296        migrationBuilder.CreateIndex(
 3297            name: "IX_AIAuditRecords_TenantId_ConversationId",
 3298            table: "AIAuditRecords",
 3299            columns: new[] { "TenantId", "ConversationId" });
 100
 32101        migrationBuilder.CreateIndex(
 32102            name: "IX_AIAuditRecords_ToolInvocationId",
 32103            table: "AIAuditRecords",
 32104            column: "ToolInvocationId");
 105
 32106        migrationBuilder.CreateIndex(
 32107            name: "IX_AIConversations_RetentionExpiresAt",
 32108            table: "AIConversations",
 32109            column: "RetentionExpiresAt");
 110
 32111        migrationBuilder.CreateIndex(
 32112            name: "IX_AIConversations_Status",
 32113            table: "AIConversations",
 32114            column: "Status");
 115
 32116        migrationBuilder.CreateIndex(
 32117            name: "IX_AIConversations_TenantId_UserId",
 32118            table: "AIConversations",
 32119            columns: new[] { "TenantId", "UserId" });
 120
 32121        migrationBuilder.CreateIndex(
 32122            name: "IX_AIProposals_Status",
 32123            table: "AIProposals",
 32124            column: "Status");
 125
 32126        migrationBuilder.CreateIndex(
 32127            name: "IX_AIProposals_TenantId_ConversationId",
 32128            table: "AIProposals",
 32129            columns: new[] { "TenantId", "ConversationId" });
 32130    }
 131
 132    protected override void Down(MigrationBuilder migrationBuilder)
 133    {
 0134        migrationBuilder.DropTable(name: "AIAuditRecords");
 0135        migrationBuilder.DropTable(name: "AIConversations");
 0136        migrationBuilder.DropTable(name: "AIProposals");
 0137    }
 138}

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.AI.Persistence.EFCore/Migrations/20260521002000_Initial.Designer.cs

#LineLine coverage
 1// <auto-generated />
 2using System;
 3using Microsoft.EntityFrameworkCore;
 4using Microsoft.EntityFrameworkCore.Infrastructure;
 5using Microsoft.EntityFrameworkCore.Migrations;
 6
 7#nullable disable
 8
 9namespace Elsa.AI.Persistence.EFCore.Migrations;
 10
 11[DbContext(typeof(AIDbContext))]
 12[Migration("20260521002000_Initial")]
 13partial class Initial
 14{
 15    protected override void BuildTargetModel(ModelBuilder modelBuilder)
 16    {
 17#pragma warning disable 612, 618
 3218        modelBuilder.HasAnnotation("ProductVersion", "9.0.16");
 19
 3220        modelBuilder.Entity("Elsa.AI.Persistence.EFCore.Entities.AIAuditRecord", b =>
 3221        {
 3222            b.Property<string>("Id");
 3223
 3224            b.Property<string>("ActorId")
 3225                .IsRequired();
 3226
 3227            b.Property<string>("ConversationId");
 3228
 3229            b.Property<string>("Data")
 3230                .IsRequired();
 3231
 3232            b.Property<string>("ProposalId");
 3233
 3234            b.Property<string>("Summary")
 3235                .IsRequired();
 3236
 3237            b.Property<string>("TenantId");
 3238
 3239            b.Property<DateTimeOffset>("Timestamp");
 3240
 3241            b.Property<string>("ToolInvocationId");
 3242
 3243            b.Property<string>("TraceId");
 3244
 3245            b.Property<string>("Type")
 3246                .IsRequired();
 3247
 3248            b.HasKey("Id");
 3249
 3250            b.HasIndex("ActorId");
 3251
 3252            b.HasIndex("ProposalId");
 3253
 3254            b.HasIndex("ToolInvocationId");
 3255
 3256            b.HasIndex("TenantId", "ConversationId");
 3257
 3258            b.HasIndex("TenantId", "Timestamp");
 3259
 3260            b.ToTable("AIAuditRecords");
 6461        });
 62
 3263        modelBuilder.Entity("Elsa.AI.Persistence.EFCore.Entities.AIConversationRecord", b =>
 3264        {
 3265            b.Property<string>("Id");
 3266
 3267            b.Property<DateTimeOffset>("CreatedAt");
 3268
 3269            b.Property<string>("Messages")
 3270                .IsRequired();
 3271
 3272            b.Property<string>("ProviderSessionId");
 3273
 3274            b.Property<DateTimeOffset?>("RetentionExpiresAt");
 3275
 3276            b.Property<string>("RetentionMode")
 3277                .IsRequired();
 3278
 3279            b.Property<string>("Status")
 3280                .IsRequired();
 3281
 3282            b.Property<string>("TenantId");
 3283
 3284            b.Property<string>("Title");
 3285
 3286            b.Property<DateTimeOffset>("UpdatedAt");
 3287
 3288            b.Property<string>("UserId")
 3289                .IsRequired();
 3290
 3291            b.HasKey("Id");
 3292
 3293            b.HasIndex("RetentionExpiresAt");
 3294
 3295            b.HasIndex("Status");
 3296
 3297            b.HasIndex("TenantId", "UserId");
 3298
 3299            b.ToTable("AIConversations");
 64100        });
 101
 32102        modelBuilder.Entity("Elsa.AI.Persistence.EFCore.Entities.AIProposalRecord", b =>
 32103        {
 32104            b.Property<string>("Id");
 32105
 32106            b.Property<string>("AppliedBy");
 32107
 32108            b.Property<DateTimeOffset?>("AppliedAt");
 32109
 32110            b.Property<string>("BaselineVersionId");
 32111
 32112            b.Property<string>("BaselineWorkflowDefinitionId");
 32113
 32114            b.Property<string>("ConversationId")
 32115                .IsRequired();
 32116
 32117            b.Property<DateTimeOffset>("CreatedAt");
 32118
 32119            b.Property<string>("CreatedBy")
 32120                .IsRequired();
 32121
 32122            b.Property<string>("GraphDiff");
 32123
 32124            b.Property<string>("Kind")
 32125                .IsRequired();
 32126
 32127            b.Property<string>("Rationale")
 32128                .IsRequired();
 32129
 32130            b.Property<string>("ReviewedBy");
 32131
 32132            b.Property<DateTimeOffset?>("ReviewedAt");
 32133
 32134            b.Property<string>("Status")
 32135                .IsRequired();
 32136
 32137            b.Property<string>("TenantId");
 32138
 32139            b.Property<string>("ValidationDiagnostics")
 32140                .IsRequired();
 32141
 32142            b.Property<string>("Warnings")
 32143                .IsRequired();
 32144
 32145            b.Property<string>("WorkflowPayload")
 32146                .IsRequired();
 32147
 32148            b.HasKey("Id");
 32149
 32150            b.HasIndex("Status");
 32151
 32152            b.HasIndex("TenantId", "ConversationId");
 32153
 32154            b.ToTable("AIProposals");
 64155        });
 156#pragma warning restore 612, 618
 32157    }
 158}