< Summary

Line coverage
87%
Covered lines: 89
Uncovered lines: 13
Coverable lines: 102
Total lines: 155
Line coverage: 87.2%
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.SqlServer/Migrations/Labels/20241212212012_V3_3.cs

#LineLine coverage
 1using Microsoft.EntityFrameworkCore.Migrations;
 2
 3#nullable disable
 4
 5namespace Elsa.Persistence.EFCore.SqlServer.Migrations.Labels
 6{
 7    /// <inheritdoc />
 8    public partial class V3_3 : Migration
 9    {
 10        private readonly Elsa.Persistence.EFCore.IElsaDbContextSchema _schema;
 11
 12        /// <inheritdoc />
 313        public V3_3(Elsa.Persistence.EFCore.IElsaDbContextSchema schema)
 14        {
 315            _schema = schema;
 316        }
 17
 18        /// <inheritdoc />
 19        protected override void Up(MigrationBuilder migrationBuilder)
 20        {
 321            migrationBuilder.AddColumn<string>(
 322                name: "TenantId",
 323                schema: _schema.Schema,
 324                table: "WorkflowDefinitionLabels",
 325                type: "nvarchar(450)",
 326                nullable: true);
 27
 328            migrationBuilder.AddColumn<string>(
 329                name: "TenantId",
 330                schema: _schema.Schema,
 331                table: "Labels",
 332                type: "nvarchar(max)",
 333                nullable: true);
 34
 335            migrationBuilder.CreateIndex(
 336                name: "WorkflowDefinitionLabel_TenantId",
 337                schema: _schema.Schema,
 338                table: "WorkflowDefinitionLabels",
 339                column: "TenantId");
 340        }
 41
 42        /// <inheritdoc />
 43        protected override void Down(MigrationBuilder migrationBuilder)
 44        {
 045            migrationBuilder.DropIndex(
 046                name: "WorkflowDefinitionLabel_TenantId",
 047                schema: _schema.Schema,
 048                table: "WorkflowDefinitionLabels");
 49
 050            migrationBuilder.DropColumn(
 051                name: "TenantId",
 052                schema: _schema.Schema,
 053                table: "WorkflowDefinitionLabels");
 54
 055            migrationBuilder.DropColumn(
 056                name: "TenantId",
 057                schema: _schema.Schema,
 058                table: "Labels");
 059        }
 60    }
 61}

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Labels/20241212212012_V3_3.Designer.cs

#LineLine coverage
 1// <auto-generated />
 2using Elsa.Persistence.EFCore.Modules.Labels;
 3using Microsoft.EntityFrameworkCore;
 4using Microsoft.EntityFrameworkCore.Infrastructure;
 5using Microsoft.EntityFrameworkCore.Metadata;
 6using Microsoft.EntityFrameworkCore.Migrations;
 7using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
 8
 9#nullable disable
 10
 11namespace Elsa.Persistence.EFCore.SqlServer.Migrations.Labels
 12{
 13    [DbContext(typeof(LabelsElsaDbContext))]
 14    [Migration("20241212212012_V3_3")]
 15    partial class V3_3
 16    {
 17        /// <inheritdoc />
 18        protected override void BuildTargetModel(ModelBuilder modelBuilder)
 19        {
 20#pragma warning disable 612, 618
 321            modelBuilder
 322                .HasDefaultSchema("Elsa")
 323                .HasAnnotation("ProductVersion", "7.0.20")
 324                .HasAnnotation("Relational:MaxIdentifierLength", 128);
 25
 326            SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
 27
 328            modelBuilder.Entity("Elsa.Labels.Entities.Label", b =>
 329                {
 330                    b.Property<string>("Id")
 331                        .HasColumnType("nvarchar(450)");
 332
 333                    b.Property<string>("Color")
 334                        .HasColumnType("nvarchar(max)");
 335
 336                    b.Property<string>("Description")
 337                        .HasColumnType("nvarchar(max)");
 338
 339                    b.Property<string>("Name")
 340                        .IsRequired()
 341                        .HasColumnType("nvarchar(max)");
 342
 343                    b.Property<string>("NormalizedName")
 344                        .IsRequired()
 345                        .HasColumnType("nvarchar(max)");
 346
 347                    b.Property<string>("TenantId")
 348                        .HasColumnType("nvarchar(max)");
 349
 350                    b.HasKey("Id");
 351
 352                    b.ToTable("Labels", "Elsa");
 653                });
 54
 355            modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b =>
 356                {
 357                    b.Property<string>("Id")
 358                        .HasColumnType("nvarchar(450)");
 359
 360                    b.Property<string>("LabelId")
 361                        .IsRequired()
 362                        .HasColumnType("nvarchar(450)");
 363
 364                    b.Property<string>("TenantId")
 365                        .HasColumnType("nvarchar(450)");
 366
 367                    b.Property<string>("WorkflowDefinitionId")
 368                        .IsRequired()
 369                        .HasColumnType("nvarchar(450)");
 370
 371                    b.Property<string>("WorkflowDefinitionVersionId")
 372                        .IsRequired()
 373                        .HasColumnType("nvarchar(450)");
 374
 375                    b.HasKey("Id");
 376
 377                    b.HasIndex("LabelId")
 378                        .HasDatabaseName("WorkflowDefinitionLabel_LabelId");
 379
 380                    b.HasIndex("TenantId")
 381                        .HasDatabaseName("WorkflowDefinitionLabel_TenantId");
 382
 383                    b.HasIndex("WorkflowDefinitionId")
 384                        .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId");
 385
 386                    b.HasIndex("WorkflowDefinitionVersionId")
 387                        .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId");
 388
 389                    b.ToTable("WorkflowDefinitionLabels", "Elsa");
 690                });
 91#pragma warning restore 612, 618
 392        }
 93    }
 94}