< Summary

Line coverage
90%
Covered lines: 227
Uncovered lines: 25
Coverable lines: 252
Total lines: 312
Line coverage: 90%
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/Management/20240329200740_V3_1.cs

#LineLine coverage
 1using Microsoft.EntityFrameworkCore.Migrations;
 2
 3#nullable disable
 4
 5namespace Elsa.Persistence.EFCore.PostgreSql.Migrations.Management
 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.AddColumn<string>(
 222                name: "DataCompressionAlgorithm",
 223                schema: _schema.Schema,
 224                table: "WorkflowInstances",
 225                type: "text",
 226                nullable: true);
 27
 228            migrationBuilder.AddColumn<bool>(
 229                name: "IsSystem",
 230                schema: _schema.Schema,
 231                table: "WorkflowInstances",
 232                type: "boolean",
 233                nullable: false,
 234                defaultValue: false);
 35
 236            migrationBuilder.AddColumn<string>(
 237                name: "ParentWorkflowInstanceId",
 238                schema: _schema.Schema,
 239                table: "WorkflowInstances",
 240                type: "text",
 241                nullable: true);
 42
 243            migrationBuilder.AddColumn<bool>(
 244                name: "IsSystem",
 245                schema: _schema.Schema,
 246                table: "WorkflowDefinitions",
 247                type: "boolean",
 248                nullable: false,
 249                defaultValue: false);
 50
 251            migrationBuilder.CreateIndex(
 252                name: "IX_WorkflowInstance_IsSystem",
 253                schema: _schema.Schema,
 254                table: "WorkflowInstances",
 255                column: "IsSystem");
 56
 257            migrationBuilder.CreateIndex(
 258                name: "IX_WorkflowDefinition_IsSystem",
 259                schema: _schema.Schema,
 260                table: "WorkflowDefinitions",
 261                column: "IsSystem");
 262        }
 63
 64        /// <inheritdoc />
 65        protected override void Down(MigrationBuilder migrationBuilder)
 66        {
 067            migrationBuilder.DropIndex(
 068                name: "IX_WorkflowInstance_IsSystem",
 069                schema: _schema.Schema,
 070                table: "WorkflowInstances");
 71
 072            migrationBuilder.DropIndex(
 073                name: "IX_WorkflowDefinition_IsSystem",
 074                schema: _schema.Schema,
 075                table: "WorkflowDefinitions");
 76
 077            migrationBuilder.DropColumn(
 078                name: "DataCompressionAlgorithm",
 079                schema: _schema.Schema,
 080                table: "WorkflowInstances");
 81
 082            migrationBuilder.DropColumn(
 083                name: "IsSystem",
 084                schema: _schema.Schema,
 085                table: "WorkflowInstances");
 86
 087            migrationBuilder.DropColumn(
 088                name: "ParentWorkflowInstanceId",
 089                schema: _schema.Schema,
 090                table: "WorkflowInstances");
 91
 092            migrationBuilder.DropColumn(
 093                name: "IsSystem",
 094                schema: _schema.Schema,
 095                table: "WorkflowDefinitions");
 096        }
 97    }
 98}

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Management/20240329200740_V3_1.Designer.cs

#LineLine coverage
 1// <auto-generated />
 2using System;
 3using Elsa.Persistence.EFCore.Modules.Management;
 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.Management
 13{
 14    [DbContext(typeof(ManagementElsaDbContext))]
 15    [Migration("20240329200740_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.Workflows.Management.Entities.WorkflowDefinition", b =>
 130                {
 131                    b.Property<string>("Id")
 132                        .HasColumnType("text");
 133
 134                    b.Property<byte[]>("BinaryData")
 135                        .HasColumnType("bytea");
 136
 137                    b.Property<DateTimeOffset>("CreatedAt")
 138                        .HasColumnType("timestamp with time zone");
 139
 140                    b.Property<string>("Data")
 141                        .HasColumnType("text");
 142
 143                    b.Property<string>("DefinitionId")
 144                        .IsRequired()
 145                        .HasColumnType("text");
 146
 147                    b.Property<string>("Description")
 148                        .HasColumnType("text");
 149
 150                    b.Property<bool>("IsLatest")
 151                        .HasColumnType("boolean");
 152
 153                    b.Property<bool>("IsPublished")
 154                        .HasColumnType("boolean");
 155
 156                    b.Property<bool>("IsReadonly")
 157                        .HasColumnType("boolean");
 158
 159                    b.Property<bool>("IsSystem")
 160                        .HasColumnType("boolean");
 161
 162                    b.Property<string>("MaterializerContext")
 163                        .HasColumnType("text");
 164
 165                    b.Property<string>("MaterializerName")
 166                        .IsRequired()
 167                        .HasColumnType("text");
 168
 169                    b.Property<string>("Name")
 170                        .HasColumnType("text");
 171
 172                    b.Property<string>("ProviderName")
 173                        .HasColumnType("text");
 174
 175                    b.Property<string>("StringData")
 176                        .HasColumnType("text");
 177
 178                    b.Property<string>("ToolVersion")
 179                        .HasColumnType("text");
 180
 181                    b.Property<bool?>("UsableAsActivity")
 182                        .HasColumnType("boolean");
 183
 184                    b.Property<int>("Version")
 185                        .HasColumnType("integer");
 186
 187                    b.HasKey("Id");
 188
 189                    b.HasIndex("IsLatest")
 190                        .HasDatabaseName("IX_WorkflowDefinition_IsLatest");
 191
 192                    b.HasIndex("IsPublished")
 193                        .HasDatabaseName("IX_WorkflowDefinition_IsPublished");
 194
 195                    b.HasIndex("IsSystem")
 196                        .HasDatabaseName("IX_WorkflowDefinition_IsSystem");
 197
 198                    b.HasIndex("Name")
 199                        .HasDatabaseName("IX_WorkflowDefinition_Name");
 1100
 1101                    b.HasIndex("UsableAsActivity")
 1102                        .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity");
 1103
 1104                    b.HasIndex("Version")
 1105                        .HasDatabaseName("IX_WorkflowDefinition_Version");
 1106
 1107                    b.HasIndex("DefinitionId", "Version")
 1108                        .IsUnique()
 1109                        .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version");
 1110
 1111                    b.ToTable("WorkflowDefinitions", "Elsa");
 2112                });
 113
 1114            modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b =>
 1115                {
 1116                    b.Property<string>("Id")
 1117                        .HasColumnType("text");
 1118
 1119                    b.Property<string>("CorrelationId")
 1120                        .HasColumnType("text");
 1121
 1122                    b.Property<DateTimeOffset>("CreatedAt")
 1123                        .HasColumnType("timestamp with time zone");
 1124
 1125                    b.Property<string>("Data")
 1126                        .HasColumnType("text");
 1127
 1128                    b.Property<string>("DataCompressionAlgorithm")
 1129                        .HasColumnType("text");
 1130
 1131                    b.Property<string>("DefinitionId")
 1132                        .IsRequired()
 1133                        .HasColumnType("text");
 1134
 1135                    b.Property<string>("DefinitionVersionId")
 1136                        .IsRequired()
 1137                        .HasColumnType("text");
 1138
 1139                    b.Property<DateTimeOffset?>("FinishedAt")
 1140                        .HasColumnType("timestamp with time zone");
 1141
 1142                    b.Property<int>("IncidentCount")
 1143                        .HasColumnType("integer");
 1144
 1145                    b.Property<bool>("IsSystem")
 1146                        .HasColumnType("boolean");
 1147
 1148                    b.Property<string>("Name")
 1149                        .HasColumnType("text");
 1150
 1151                    b.Property<string>("ParentWorkflowInstanceId")
 1152                        .HasColumnType("text");
 1153
 1154                    b.Property<string>("Status")
 1155                        .IsRequired()
 1156                        .HasColumnType("text");
 1157
 1158                    b.Property<string>("SubStatus")
 1159                        .IsRequired()
 1160                        .HasColumnType("text");
 1161
 1162                    b.Property<DateTimeOffset>("UpdatedAt")
 1163                        .HasColumnType("timestamp with time zone");
 1164
 1165                    b.Property<int>("Version")
 1166                        .HasColumnType("integer");
 1167
 1168                    b.HasKey("Id");
 1169
 1170                    b.HasIndex("CorrelationId")
 1171                        .HasDatabaseName("IX_WorkflowInstance_CorrelationId");
 1172
 1173                    b.HasIndex("CreatedAt")
 1174                        .HasDatabaseName("IX_WorkflowInstance_CreatedAt");
 1175
 1176                    b.HasIndex("DefinitionId")
 1177                        .HasDatabaseName("IX_WorkflowInstance_DefinitionId");
 1178
 1179                    b.HasIndex("FinishedAt")
 1180                        .HasDatabaseName("IX_WorkflowInstance_FinishedAt");
 1181
 1182                    b.HasIndex("IsSystem")
 1183                        .HasDatabaseName("IX_WorkflowInstance_IsSystem");
 1184
 1185                    b.HasIndex("Name")
 1186                        .HasDatabaseName("IX_WorkflowInstance_Name");
 1187
 1188                    b.HasIndex("Status")
 1189                        .HasDatabaseName("IX_WorkflowInstance_Status");
 1190
 1191                    b.HasIndex("SubStatus")
 1192                        .HasDatabaseName("IX_WorkflowInstance_SubStatus");
 1193
 1194                    b.HasIndex("UpdatedAt")
 1195                        .HasDatabaseName("IX_WorkflowInstance_UpdatedAt");
 1196
 1197                    b.HasIndex("Status", "DefinitionId")
 1198                        .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId");
 1199
 1200                    b.HasIndex("Status", "SubStatus")
 1201                        .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus");
 1202
 1203                    b.HasIndex("SubStatus", "DefinitionId")
 1204                        .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId");
 1205
 1206                    b.HasIndex("Status", "SubStatus", "DefinitionId", "Version")
 1207                        .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version");
 1208
 1209                    b.ToTable("WorkflowInstances", "Elsa");
 2210                });
 211#pragma warning restore 612, 618
 1212        }
 213    }
 214}