< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 66
Coverable lines: 66
Total lines: 117
Line coverage: 0%
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%210%
File 1: Up(...)100%210%
File 1: Down(...)100%210%
File 2: BuildTargetModel(...)100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Tenants/20241212212210_V3_3.cs

#LineLine coverage
 1using Microsoft.EntityFrameworkCore.Migrations;
 2
 3#nullable disable
 4
 5namespace Elsa.Persistence.EFCore.PostgreSql.Migrations.Tenants
 6{
 7    /// <inheritdoc />
 8    public partial class V3_3 : Migration
 9    {
 10        private readonly Elsa.Persistence.EFCore.IElsaDbContextSchema _schema;
 11
 12        /// <inheritdoc />
 013        public V3_3(Elsa.Persistence.EFCore.IElsaDbContextSchema schema)
 14        {
 015            _schema = schema;
 016        }
 17
 18        /// <inheritdoc />
 19        protected override void Up(MigrationBuilder migrationBuilder)
 20        {
 021            migrationBuilder.EnsureSchema(
 022                name: "Elsa");
 23
 024            migrationBuilder.CreateTable(
 025                name: "Tenants",
 026                schema: _schema.Schema,
 027                columns: table => new
 028                {
 029                    Id = table.Column<string>(type: "text", nullable: false),
 030                    Name = table.Column<string>(type: "text", nullable: false),
 031                    Configuration = table.Column<string>(type: "text", nullable: false),
 032                    TenantId = table.Column<string>(type: "text", nullable: true)
 033                },
 034                constraints: table =>
 035                {
 036                    table.PrimaryKey("PK_Tenants", x => x.Id);
 037                });
 38
 039            migrationBuilder.CreateIndex(
 040                name: "IX_Tenant_Name",
 041                schema: _schema.Schema,
 042                table: "Tenants",
 043                column: "Name");
 44
 045            migrationBuilder.CreateIndex(
 046                name: "IX_Tenant_TenantId",
 047                schema: _schema.Schema,
 048                table: "Tenants",
 049                column: "TenantId");
 050        }
 51
 52        /// <inheritdoc />
 53        protected override void Down(MigrationBuilder migrationBuilder)
 54        {
 055            migrationBuilder.DropTable(
 056                name: "Tenants",
 057                schema: _schema.Schema);
 058        }
 59    }
 60}

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Tenants/20241212212210_V3_3.Designer.cs

#LineLine coverage
 1// <auto-generated />
 2using Elsa.Persistence.EFCore.Modules.Tenants;
 3using Microsoft.EntityFrameworkCore;
 4using Microsoft.EntityFrameworkCore.Infrastructure;
 5using Microsoft.EntityFrameworkCore.Migrations;
 6using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
 7using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
 8
 9#nullable disable
 10
 11namespace Elsa.Persistence.EFCore.PostgreSql.Migrations.Tenants
 12{
 13    [DbContext(typeof(TenantsElsaDbContext))]
 14    [Migration("20241212212210_V3_3")]
 15    partial class V3_3
 16    {
 17        /// <inheritdoc />
 18        protected override void BuildTargetModel(ModelBuilder modelBuilder)
 19        {
 20#pragma warning disable 612, 618
 021            modelBuilder
 022                .HasDefaultSchema("Elsa")
 023                .HasAnnotation("ProductVersion", "7.0.20")
 024                .HasAnnotation("Relational:MaxIdentifierLength", 63);
 25
 026            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
 27
 028            modelBuilder.Entity("Elsa.Common.Multitenancy.Tenant", b =>
 029                {
 030                    b.Property<string>("Id")
 031                        .HasColumnType("text");
 032
 033                    b.Property<string>("Configuration")
 034                        .IsRequired()
 035                        .HasColumnType("text");
 036
 037                    b.Property<string>("Name")
 038                        .IsRequired()
 039                        .HasColumnType("text");
 040
 041                    b.Property<string>("TenantId")
 042                        .HasColumnType("text");
 043
 044                    b.HasKey("Id");
 045
 046                    b.HasIndex("Name")
 047                        .HasDatabaseName("IX_Tenant_Name");
 048
 049                    b.HasIndex("TenantId")
 050                        .HasDatabaseName("IX_Tenant_TenantId");
 051
 052                    b.ToTable("Tenants", "Elsa");
 053                });
 54#pragma warning restore 612, 618
 055        }
 56    }
 57}