< Summary

Line coverage
97%
Covered lines: 139
Uncovered lines: 4
Coverable lines: 143
Total lines: 199
Line coverage: 97.2%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
File 1: .ctor(...)50%22100%
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.Secrets.Persistence.EFCore.SqlServer/Migrations/Secrets/20260531141743_Initial.cs

#LineLine coverage
 1using System;
 2using Elsa.Persistence.EFCore;
 3using Microsoft.EntityFrameworkCore.Migrations;
 4
 5#nullable disable
 6
 7namespace Elsa.Secrets.Persistence.EFCore.SqlServer.Migrations.Secrets
 8{
 9    /// <inheritdoc />
 10    public partial class Initial : Migration
 11    {
 12        private readonly IElsaDbContextSchema _schema;
 13
 214        public Initial(IElsaDbContextSchema schema)
 15        {
 216            _schema = schema ?? throw new ArgumentNullException(nameof(schema));
 217        }
 18
 19        /// <inheritdoc />
 20        protected override void Up(MigrationBuilder migrationBuilder)
 21        {
 222            migrationBuilder.EnsureSchema(
 223                name: _schema.Schema);
 24
 225            migrationBuilder.CreateTable(
 226                name: "Secrets",
 227                schema: _schema.Schema,
 228                columns: table => new
 229                {
 230                    Id = table.Column<string>(type: "nvarchar(450)", nullable: false),
 231                    Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
 232                    NormalizedName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
 233                    DisplayName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
 234                    Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
 235                    TypeName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
 236                    StoreName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
 237                    Scope = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
 238                    Status = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: false),
 239                    CreatedAt = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
 240                    UpdatedAt = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
 241                    Tags = table.Column<string>(type: "nvarchar(max)", nullable: false),
 242                    Versions = table.Column<string>(type: "nvarchar(max)", nullable: false)
 243                },
 244                constraints: table =>
 245                {
 246                    table.PrimaryKey("PK_Secrets", x => x.Id);
 447                });
 48
 249            migrationBuilder.CreateIndex(
 250                name: "IX_Secret_NormalizedName",
 251                schema: _schema.Schema,
 252                table: "Secrets",
 253                column: "NormalizedName",
 254                unique: true);
 55
 256            migrationBuilder.CreateIndex(
 257                name: "IX_Secret_Scope",
 258                schema: _schema.Schema,
 259                table: "Secrets",
 260                column: "Scope");
 61
 262            migrationBuilder.CreateIndex(
 263                name: "IX_Secret_Status",
 264                schema: _schema.Schema,
 265                table: "Secrets",
 266                column: "Status");
 67
 268            migrationBuilder.CreateIndex(
 269                name: "IX_Secret_StoreName",
 270                schema: _schema.Schema,
 271                table: "Secrets",
 272                column: "StoreName");
 73
 274            migrationBuilder.CreateIndex(
 275                name: "IX_Secret_TypeName",
 276                schema: _schema.Schema,
 277                table: "Secrets",
 278                column: "TypeName");
 279        }
 80
 81        /// <inheritdoc />
 82        protected override void Down(MigrationBuilder migrationBuilder)
 83        {
 084            migrationBuilder.DropTable(
 085                name: "Secrets",
 086                schema: _schema.Schema);
 087        }
 88    }
 89}

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Secrets.Persistence.EFCore.SqlServer/Migrations/Secrets/20260531141743_Initial.Designer.cs

#LineLine coverage
 1// <auto-generated />
 2using System;
 3using Elsa.Secrets.Persistence.EFCore;
 4using Microsoft.EntityFrameworkCore;
 5using Microsoft.EntityFrameworkCore.Infrastructure;
 6using Microsoft.EntityFrameworkCore.Metadata;
 7using Microsoft.EntityFrameworkCore.Migrations;
 8using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
 9
 10#nullable disable
 11
 12namespace Elsa.Secrets.Persistence.EFCore.SqlServer.Migrations.Secrets
 13{
 14    [DbContext(typeof(SecretsElsaDbContext))]
 15    [Migration("20260531141743_Initial")]
 16    partial class Initial
 17    {
 18        /// <inheritdoc />
 19        protected override void BuildTargetModel(ModelBuilder modelBuilder)
 20        {
 21#pragma warning disable 612, 618
 222            modelBuilder
 223                .HasDefaultSchema("Elsa")
 224                .HasAnnotation("ProductVersion", "9.0.16")
 225                .HasAnnotation("Relational:MaxIdentifierLength", 128);
 26
 227            SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
 28
 229            modelBuilder.Entity("Elsa.Secrets.Models.Secret", b =>
 230                {
 231                    b.Property<string>("Id")
 232                        .HasColumnType("nvarchar(450)");
 233
 234                    b.Property<DateTimeOffset>("CreatedAt")
 235                        .HasColumnType("datetimeoffset");
 236
 237                    b.Property<string>("Description")
 238                        .HasColumnType("nvarchar(max)");
 239
 240                    b.Property<string>("DisplayName")
 241                        .IsRequired()
 242                        .HasMaxLength(200)
 243                        .HasColumnType("nvarchar(200)");
 244
 245                    b.Property<string>("Name")
 246                        .IsRequired()
 247                        .HasMaxLength(200)
 248                        .HasColumnType("nvarchar(200)");
 249
 250                    b.Property<string>("NormalizedName")
 251                        .IsRequired()
 252                        .HasMaxLength(200)
 253                        .HasColumnType("nvarchar(200)");
 254
 255                    b.Property<string>("Scope")
 256                        .HasMaxLength(200)
 257                        .HasColumnType("nvarchar(200)");
 258
 259                    b.Property<string>("SerializedTags")
 260                        .IsRequired()
 261                        .HasColumnType("nvarchar(max)")
 262                        .HasColumnName("Tags");
 263
 264                    b.Property<string>("SerializedVersions")
 265                        .IsRequired()
 266                        .HasColumnType("nvarchar(max)")
 267                        .HasColumnName("Versions");
 268
 269                    b.Property<string>("Status")
 270                        .IsRequired()
 271                        .HasMaxLength(32)
 272                        .HasColumnType("nvarchar(32)");
 273
 274                    b.Property<string>("StoreName")
 275                        .IsRequired()
 276                        .HasMaxLength(100)
 277                        .HasColumnType("nvarchar(100)");
 278
 279                    b.Property<string>("TypeName")
 280                        .IsRequired()
 281                        .HasMaxLength(100)
 282                        .HasColumnType("nvarchar(100)");
 283
 284                    b.Property<DateTimeOffset?>("UpdatedAt")
 285                        .HasColumnType("datetimeoffset");
 286
 287                    b.HasKey("Id");
 288
 289                    b.HasIndex("NormalizedName")
 290                        .IsUnique()
 291                        .HasDatabaseName("IX_Secret_NormalizedName");
 292
 293                    b.HasIndex("Scope")
 294                        .HasDatabaseName("IX_Secret_Scope");
 295
 296                    b.HasIndex("Status")
 297                        .HasDatabaseName("IX_Secret_Status");
 298
 299                    b.HasIndex("StoreName")
 2100                        .HasDatabaseName("IX_Secret_StoreName");
 2101
 2102                    b.HasIndex("TypeName")
 2103                        .HasDatabaseName("IX_Secret_TypeName");
 2104
 2105                    b.ToTable("Secrets", "Elsa");
 4106                });
 107#pragma warning restore 612, 618
 2108        }
 109    }
 110}