< Summary

Line coverage
94%
Covered lines: 225
Uncovered lines: 12
Coverable lines: 237
Total lines: 289
Line coverage: 94.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/20251116182753_V3_6.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_6 : Migration
 9    {
 10        private readonly Elsa.Persistence.EFCore.IElsaDbContextSchema _schema;
 11
 12        /// <inheritdoc />
 213        public V3_6(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: "OriginalSource",
 223                schema: _schema.Schema,
 224                table: "WorkflowDefinitions",
 225                type: "text",
 226                nullable: true);
 27
 228            var schema = _schema.Schema;
 229            migrationBuilder.Sql($@"
 230                ALTER TABLE ""{schema}"".""WorkflowDefinitions""
 231                ALTER COLUMN ""StringData""
 232                TYPE jsonb
 233                USING ""StringData""::jsonb;
 234            ");
 235        }
 36
 37        /// <inheritdoc />
 38        protected override void Down(MigrationBuilder migrationBuilder)
 39        {
 040            var schema = _schema.Schema;
 041            migrationBuilder.Sql($@"
 042                ALTER TABLE ""{schema}"".""WorkflowDefinitions""
 043                ALTER COLUMN ""StringData""
 044                TYPE text
 045                USING ""StringData""::text;
 046            ");
 47
 048            migrationBuilder.DropColumn(
 049                name: "OriginalSource",
 050                schema: _schema.Schema,
 051                table: "WorkflowDefinitions");
 052        }
 53    }
 54}

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