< Summary

Line coverage
88%
Covered lines: 135
Uncovered lines: 17
Coverable lines: 152
Total lines: 208
Line coverage: 88.8%
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: .ctor(...)100%11100%
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.Persistence.EFCore.PostgreSql/Migrations/Alterations/20241212211604_V3_3.cs

#LineLine coverage
 1using Microsoft.EntityFrameworkCore.Migrations;
 2
 3#nullable disable
 4
 5namespace Elsa.Persistence.EFCore.PostgreSql.Migrations.Alterations
 6{
 7    /// <inheritdoc />
 8    public partial class V3_3 : Migration
 9    {
 10        private readonly Elsa.Persistence.EFCore.IElsaDbContextSchema _schema;
 11
 12        /// <inheritdoc />
 213        public V3_3(Elsa.Persistence.EFCore.IElsaDbContextSchema schema)
 14        {
 215            _schema = schema;
 216        }
 17
 18        /// <inheritdoc />
 19        protected override void Up(MigrationBuilder migrationBuilder)
 20        {
 221            migrationBuilder.AddColumn<string>(
 222                name: "TenantId",
 223                schema: _schema.Schema,
 224                table: "AlterationPlans",
 225                type: "text",
 226                nullable: true);
 27
 228            migrationBuilder.AddColumn<string>(
 229                name: "TenantId",
 230                schema: _schema.Schema,
 231                table: "AlterationJobs",
 232                type: "text",
 233                nullable: true);
 34
 235            migrationBuilder.CreateIndex(
 236                name: "IX_AlterationPlan_TenantId",
 237                schema: _schema.Schema,
 238                table: "AlterationPlans",
 239                column: "TenantId");
 40
 241            migrationBuilder.CreateIndex(
 242                name: "IX_AlterationJob_TenantId",
 243                schema: _schema.Schema,
 244                table: "AlterationJobs",
 245                column: "TenantId");
 246        }
 47
 48        /// <inheritdoc />
 49        protected override void Down(MigrationBuilder migrationBuilder)
 50        {
 051            migrationBuilder.DropIndex(
 052                name: "IX_AlterationPlan_TenantId",
 053                schema: _schema.Schema,
 054                table: "AlterationPlans");
 55
 056            migrationBuilder.DropIndex(
 057                name: "IX_AlterationJob_TenantId",
 058                schema: _schema.Schema,
 059                table: "AlterationJobs");
 60
 061            migrationBuilder.DropColumn(
 062                name: "TenantId",
 063                schema: _schema.Schema,
 064                table: "AlterationPlans");
 65
 066            migrationBuilder.DropColumn(
 067                name: "TenantId",
 068                schema: _schema.Schema,
 069                table: "AlterationJobs");
 070        }
 71    }
 72}

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Alterations/20241212211604_V3_3.Designer.cs

#LineLine coverage
 1// <auto-generated />
 2using System;
 3using Elsa.Persistence.EFCore.Modules.Alterations;
 4using Microsoft.EntityFrameworkCore;
 5using Microsoft.EntityFrameworkCore.Infrastructure;
 6using Microsoft.EntityFrameworkCore.Migrations;
 7using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
 8using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
 9
 10#nullable disable
 11
 12namespace Elsa.Persistence.EFCore.PostgreSql.Migrations.Alterations
 13{
 14    [DbContext(typeof(AlterationsElsaDbContext))]
 15    [Migration("20241212211604_V3_3")]
 16    partial class V3_3
 17    {
 18        /// <inheritdoc />
 19        protected override void BuildTargetModel(ModelBuilder modelBuilder)
 20        {
 21#pragma warning disable 612, 618
 122            modelBuilder
 123                .HasDefaultSchema("Elsa")
 124                .HasAnnotation("ProductVersion", "7.0.20")
 125                .HasAnnotation("Relational:MaxIdentifierLength", 63);
 26
 127            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
 28
 129            modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b =>
 130                {
 131                    b.Property<string>("Id")
 132                        .HasColumnType("text");
 133
 134                    b.Property<DateTimeOffset?>("CompletedAt")
 135                        .HasColumnType("timestamp with time zone");
 136
 137                    b.Property<DateTimeOffset>("CreatedAt")
 138                        .HasColumnType("timestamp with time zone");
 139
 140                    b.Property<string>("PlanId")
 141                        .IsRequired()
 142                        .HasColumnType("text");
 143
 144                    b.Property<string>("SerializedLog")
 145                        .HasColumnType("text");
 146
 147                    b.Property<DateTimeOffset?>("StartedAt")
 148                        .HasColumnType("timestamp with time zone");
 149
 150                    b.Property<string>("Status")
 151                        .IsRequired()
 152                        .HasColumnType("text");
 153
 154                    b.Property<string>("TenantId")
 155                        .HasColumnType("text");
 156
 157                    b.Property<string>("WorkflowInstanceId")
 158                        .IsRequired()
 159                        .HasColumnType("text");
 160
 161                    b.HasKey("Id");
 162
 163                    b.HasIndex("CompletedAt")
 164                        .HasDatabaseName("IX_AlterationJob_CompletedAt");
 165
 166                    b.HasIndex("CreatedAt")
 167                        .HasDatabaseName("IX_AlterationJob_CreatedAt");
 168
 169                    b.HasIndex("PlanId")
 170                        .HasDatabaseName("IX_AlterationJob_PlanId");
 171
 172                    b.HasIndex("StartedAt")
 173                        .HasDatabaseName("IX_AlterationJob_StartedAt");
 174
 175                    b.HasIndex("Status")
 176                        .HasDatabaseName("IX_AlterationJob_Status");
 177
 178                    b.HasIndex("TenantId")
 179                        .HasDatabaseName("IX_AlterationJob_TenantId");
 180
 181                    b.HasIndex("WorkflowInstanceId")
 182                        .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId");
 183
 184                    b.ToTable("AlterationJobs", "Elsa");
 285                });
 86
 187            modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b =>
 188                {
 189                    b.Property<string>("Id")
 190                        .HasColumnType("text");
 191
 192                    b.Property<DateTimeOffset?>("CompletedAt")
 193                        .HasColumnType("timestamp with time zone");
 194
 195                    b.Property<DateTimeOffset>("CreatedAt")
 196                        .HasColumnType("timestamp with time zone");
 197
 198                    b.Property<string>("SerializedAlterations")
 199                        .HasColumnType("text");
 1100
 1101                    b.Property<string>("SerializedWorkflowInstanceFilter")
 1102                        .HasColumnType("text");
 1103
 1104                    b.Property<DateTimeOffset?>("StartedAt")
 1105                        .HasColumnType("timestamp with time zone");
 1106
 1107                    b.Property<string>("Status")
 1108                        .IsRequired()
 1109                        .HasColumnType("text");
 1110
 1111                    b.Property<string>("TenantId")
 1112                        .HasColumnType("text");
 1113
 1114                    b.HasKey("Id");
 1115
 1116                    b.HasIndex("CompletedAt")
 1117                        .HasDatabaseName("IX_AlterationPlan_CompletedAt");
 1118
 1119                    b.HasIndex("CreatedAt")
 1120                        .HasDatabaseName("IX_AlterationPlan_CreatedAt");
 1121
 1122                    b.HasIndex("StartedAt")
 1123                        .HasDatabaseName("IX_AlterationPlan_StartedAt");
 1124
 1125                    b.HasIndex("Status")
 1126                        .HasDatabaseName("IX_AlterationPlan_Status");
 1127
 1128                    b.HasIndex("TenantId")
 1129                        .HasDatabaseName("IX_AlterationPlan_TenantId");
 1130
 1131                    b.ToTable("AlterationPlans", "Elsa");
 2132                });
 133#pragma warning restore 612, 618
 1134        }
 135    }
 136}