< Summary

Line coverage
84%
Covered lines: 122
Uncovered lines: 22
Coverable lines: 144
Total lines: 198
Line coverage: 84.7%
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/20240329200643_V3_1.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_1 : Migration
 9    {
 10        private readonly IElsaDbContextSchema _schema;
 11
 12        /// <inheritdoc />
 213        public V3_1(IElsaDbContextSchema schema)
 14        {
 215            _schema = schema;
 216        }
 17
 18        /// <inheritdoc />
 19        protected override void Up(MigrationBuilder migrationBuilder)
 20        {
 221            migrationBuilder.RenameColumn(
 222                name: "SerializedWorkflowInstanceIds",
 223                schema: _schema.Schema,
 224                table: "AlterationPlans",
 225                newName: "SerializedWorkflowInstanceFilter");
 26
 227            migrationBuilder.AlterColumn<string>(
 228                name: "Status",
 229                schema: _schema.Schema,
 230                table: "AlterationPlans",
 231                type: "text",
 232                nullable: false,
 233                oldClrType: typeof(int),
 234                oldType: "integer");
 35
 236            migrationBuilder.AlterColumn<string>(
 237                name: "Status",
 238                schema: _schema.Schema,
 239                table: "AlterationJobs",
 240                type: "text",
 241                nullable: false,
 242                oldClrType: typeof(int),
 243                oldType: "integer");
 244        }
 45
 46        /// <inheritdoc />
 47        protected override void Down(MigrationBuilder migrationBuilder)
 48        {
 049            migrationBuilder.RenameColumn(
 050                name: "SerializedWorkflowInstanceFilter",
 051                schema: _schema.Schema,
 052                table: "AlterationPlans",
 053                newName: "SerializedWorkflowInstanceIds");
 54
 055            migrationBuilder.AlterColumn<int>(
 056                name: "Status",
 057                schema: _schema.Schema,
 058                table: "AlterationPlans",
 059                type: "integer",
 060                nullable: false,
 061                oldClrType: typeof(string),
 062                oldType: "text");
 63
 064            migrationBuilder.AlterColumn<int>(
 065                name: "Status",
 066                schema: _schema.Schema,
 067                table: "AlterationJobs",
 068                type: "integer",
 069                nullable: false,
 070                oldClrType: typeof(string),
 071                oldType: "text");
 072        }
 73    }
 74}

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Alterations/20240329200643_V3_1.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("20240329200643_V3_1")]
 16    partial class V3_1
 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.14")
 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>("WorkflowInstanceId")
 155                        .IsRequired()
 156                        .HasColumnType("text");
 157
 158                    b.HasKey("Id");
 159
 160                    b.HasIndex("CompletedAt")
 161                        .HasDatabaseName("IX_AlterationJob_CompletedAt");
 162
 163                    b.HasIndex("CreatedAt")
 164                        .HasDatabaseName("IX_AlterationJob_CreatedAt");
 165
 166                    b.HasIndex("PlanId")
 167                        .HasDatabaseName("IX_AlterationJob_PlanId");
 168
 169                    b.HasIndex("StartedAt")
 170                        .HasDatabaseName("IX_AlterationJob_StartedAt");
 171
 172                    b.HasIndex("Status")
 173                        .HasDatabaseName("IX_AlterationJob_Status");
 174
 175                    b.HasIndex("WorkflowInstanceId")
 176                        .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId");
 177
 178                    b.ToTable("AlterationJobs", "Elsa");
 279                });
 80
 181            modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b =>
 182                {
 183                    b.Property<string>("Id")
 184                        .HasColumnType("text");
 185
 186                    b.Property<DateTimeOffset?>("CompletedAt")
 187                        .HasColumnType("timestamp with time zone");
 188
 189                    b.Property<DateTimeOffset>("CreatedAt")
 190                        .HasColumnType("timestamp with time zone");
 191
 192                    b.Property<string>("SerializedAlterations")
 193                        .HasColumnType("text");
 194
 195                    b.Property<string>("SerializedWorkflowInstanceFilter")
 196                        .HasColumnType("text");
 197
 198                    b.Property<DateTimeOffset?>("StartedAt")
 199                        .HasColumnType("timestamp with time zone");
 1100
 1101                    b.Property<string>("Status")
 1102                        .IsRequired()
 1103                        .HasColumnType("text");
 1104
 1105                    b.HasKey("Id");
 1106
 1107                    b.HasIndex("CompletedAt")
 1108                        .HasDatabaseName("IX_AlterationPlan_CompletedAt");
 1109
 1110                    b.HasIndex("CreatedAt")
 1111                        .HasDatabaseName("IX_AlterationPlan_CreatedAt");
 1112
 1113                    b.HasIndex("StartedAt")
 1114                        .HasDatabaseName("IX_AlterationPlan_StartedAt");
 1115
 1116                    b.HasIndex("Status")
 1117                        .HasDatabaseName("IX_AlterationPlan_Status");
 1118
 1119                    b.ToTable("AlterationPlans", "Elsa");
 2120                });
 121#pragma warning restore 612, 618
 1122        }
 123    }
 124}