< Summary

Line coverage
92%
Covered lines: 225
Uncovered lines: 17
Coverable lines: 242
Total lines: 298
Line coverage: 92.9%
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/20241212211805_V3_3.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_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: "WorkflowInstances",
 225                type: "text",
 226                nullable: true);
 27
 228            migrationBuilder.AddColumn<string>(
 229                name: "TenantId",
 230                schema: _schema.Schema,
 231                table: "WorkflowDefinitions",
 232                type: "text",
 233                nullable: true);
 34
 235            migrationBuilder.CreateIndex(
 236                name: "IX_WorkflowInstance_TenantId",
 237                schema: _schema.Schema,
 238                table: "WorkflowInstances",
 239                column: "TenantId");
 40
 241            migrationBuilder.CreateIndex(
 242                name: "IX_WorkflowDefinition_TenantId",
 243                schema: _schema.Schema,
 244                table: "WorkflowDefinitions",
 245                column: "TenantId");
 246        }
 47
 48        /// <inheritdoc />
 49        protected override void Down(MigrationBuilder migrationBuilder)
 50        {
 051            migrationBuilder.DropIndex(
 052                name: "IX_WorkflowInstance_TenantId",
 053                schema: _schema.Schema,
 054                table: "WorkflowInstances");
 55
 056            migrationBuilder.DropIndex(
 057                name: "IX_WorkflowDefinition_TenantId",
 058                schema: _schema.Schema,
 059                table: "WorkflowDefinitions");
 60
 061            migrationBuilder.DropColumn(
 062                name: "TenantId",
 063                schema: _schema.Schema,
 064                table: "WorkflowInstances");
 65
 066            migrationBuilder.DropColumn(
 067                name: "TenantId",
 068                schema: _schema.Schema,
 069                table: "WorkflowDefinitions");
 070        }
 71    }
 72}

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Management/20241212211805_V3_3.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("20241212211805_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.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>("TenantId")
 179                        .HasColumnType("text");
 180
 181                    b.Property<string>("ToolVersion")
 182                        .HasColumnType("text");
 183
 184                    b.Property<bool?>("UsableAsActivity")
 185                        .HasColumnType("boolean");
 186
 187                    b.Property<int>("Version")
 188                        .HasColumnType("integer");
 189
 190                    b.HasKey("Id");
 191
 192                    b.HasIndex("IsLatest")
 193                        .HasDatabaseName("IX_WorkflowDefinition_IsLatest");
 194
 195                    b.HasIndex("IsPublished")
 196                        .HasDatabaseName("IX_WorkflowDefinition_IsPublished");
 197
 198                    b.HasIndex("IsSystem")
 199                        .HasDatabaseName("IX_WorkflowDefinition_IsSystem");
 1100
 1101                    b.HasIndex("Name")
 1102                        .HasDatabaseName("IX_WorkflowDefinition_Name");
 1103
 1104                    b.HasIndex("TenantId")
 1105                        .HasDatabaseName("IX_WorkflowDefinition_TenantId");
 1106
 1107                    b.HasIndex("UsableAsActivity")
 1108                        .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity");
 1109
 1110                    b.HasIndex("Version")
 1111                        .HasDatabaseName("IX_WorkflowDefinition_Version");
 1112
 1113                    b.HasIndex("DefinitionId", "Version")
 1114                        .IsUnique()
 1115                        .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version");
 1116
 1117                    b.ToTable("WorkflowDefinitions", "Elsa");
 2118                });
 119
 1120            modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b =>
 1121                {
 1122                    b.Property<string>("Id")
 1123                        .HasColumnType("text");
 1124
 1125                    b.Property<string>("CorrelationId")
 1126                        .HasColumnType("text");
 1127
 1128                    b.Property<DateTimeOffset>("CreatedAt")
 1129                        .HasColumnType("timestamp with time zone");
 1130
 1131                    b.Property<string>("Data")
 1132                        .HasColumnType("text");
 1133
 1134                    b.Property<string>("DataCompressionAlgorithm")
 1135                        .HasColumnType("text");
 1136
 1137                    b.Property<string>("DefinitionId")
 1138                        .IsRequired()
 1139                        .HasColumnType("text");
 1140
 1141                    b.Property<string>("DefinitionVersionId")
 1142                        .IsRequired()
 1143                        .HasColumnType("text");
 1144
 1145                    b.Property<DateTimeOffset?>("FinishedAt")
 1146                        .HasColumnType("timestamp with time zone");
 1147
 1148                    b.Property<int>("IncidentCount")
 1149                        .HasColumnType("integer");
 1150
 1151                    b.Property<bool>("IsSystem")
 1152                        .HasColumnType("boolean");
 1153
 1154                    b.Property<string>("Name")
 1155                        .HasColumnType("text");
 1156
 1157                    b.Property<string>("ParentWorkflowInstanceId")
 1158                        .HasColumnType("text");
 1159
 1160                    b.Property<string>("Status")
 1161                        .IsRequired()
 1162                        .HasColumnType("text");
 1163
 1164                    b.Property<string>("SubStatus")
 1165                        .IsRequired()
 1166                        .HasColumnType("text");
 1167
 1168                    b.Property<string>("TenantId")
 1169                        .HasColumnType("text");
 1170
 1171                    b.Property<DateTimeOffset>("UpdatedAt")
 1172                        .HasColumnType("timestamp with time zone");
 1173
 1174                    b.Property<int>("Version")
 1175                        .HasColumnType("integer");
 1176
 1177                    b.HasKey("Id");
 1178
 1179                    b.HasIndex("CorrelationId")
 1180                        .HasDatabaseName("IX_WorkflowInstance_CorrelationId");
 1181
 1182                    b.HasIndex("CreatedAt")
 1183                        .HasDatabaseName("IX_WorkflowInstance_CreatedAt");
 1184
 1185                    b.HasIndex("DefinitionId")
 1186                        .HasDatabaseName("IX_WorkflowInstance_DefinitionId");
 1187
 1188                    b.HasIndex("FinishedAt")
 1189                        .HasDatabaseName("IX_WorkflowInstance_FinishedAt");
 1190
 1191                    b.HasIndex("IsSystem")
 1192                        .HasDatabaseName("IX_WorkflowInstance_IsSystem");
 1193
 1194                    b.HasIndex("Name")
 1195                        .HasDatabaseName("IX_WorkflowInstance_Name");
 1196
 1197                    b.HasIndex("Status")
 1198                        .HasDatabaseName("IX_WorkflowInstance_Status");
 1199
 1200                    b.HasIndex("SubStatus")
 1201                        .HasDatabaseName("IX_WorkflowInstance_SubStatus");
 1202
 1203                    b.HasIndex("TenantId")
 1204                        .HasDatabaseName("IX_WorkflowInstance_TenantId");
 1205
 1206                    b.HasIndex("UpdatedAt")
 1207                        .HasDatabaseName("IX_WorkflowInstance_UpdatedAt");
 1208
 1209                    b.HasIndex("Status", "DefinitionId")
 1210                        .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId");
 1211
 1212                    b.HasIndex("Status", "SubStatus")
 1213                        .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus");
 1214
 1215                    b.HasIndex("SubStatus", "DefinitionId")
 1216                        .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId");
 1217
 1218                    b.HasIndex("Status", "SubStatus", "DefinitionId", "Version")
 1219                        .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version");
 1220
 1221                    b.ToTable("WorkflowInstances", "Elsa");
 2222                });
 223#pragma warning restore 612, 618
 1224        }
 225    }
 226}