< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 184
Coverable lines: 184
Total lines: 244
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/Identity/20241212211900_V3_3.cs

#LineLine coverage
 1using Microsoft.EntityFrameworkCore.Migrations;
 2
 3#nullable disable
 4
 5namespace Elsa.Persistence.EFCore.PostgreSql.Migrations.Identity
 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.AddColumn<string>(
 022                name: "TenantId",
 023                schema: _schema.Schema,
 024                table: "Users",
 025                type: "text",
 026                nullable: true);
 27
 028            migrationBuilder.AddColumn<string>(
 029                name: "TenantId",
 030                schema: _schema.Schema,
 031                table: "Roles",
 032                type: "text",
 033                nullable: true);
 34
 035            migrationBuilder.AddColumn<string>(
 036                name: "TenantId",
 037                schema: _schema.Schema,
 038                table: "Applications",
 039                type: "text",
 040                nullable: true);
 41
 042            migrationBuilder.CreateIndex(
 043                name: "IX_User_TenantId",
 044                schema: _schema.Schema,
 045                table: "Users",
 046                column: "TenantId");
 47
 048            migrationBuilder.CreateIndex(
 049                name: "IX_Role_TenantId",
 050                schema: _schema.Schema,
 051                table: "Roles",
 052                column: "TenantId");
 53
 054            migrationBuilder.CreateIndex(
 055                name: "IX_Application_TenantId",
 056                schema: _schema.Schema,
 057                table: "Applications",
 058                column: "TenantId");
 059        }
 60
 61        /// <inheritdoc />
 62        protected override void Down(MigrationBuilder migrationBuilder)
 63        {
 064            migrationBuilder.DropIndex(
 065                name: "IX_User_TenantId",
 066                schema: _schema.Schema,
 067                table: "Users");
 68
 069            migrationBuilder.DropIndex(
 070                name: "IX_Role_TenantId",
 071                schema: _schema.Schema,
 072                table: "Roles");
 73
 074            migrationBuilder.DropIndex(
 075                name: "IX_Application_TenantId",
 076                schema: _schema.Schema,
 077                table: "Applications");
 78
 079            migrationBuilder.DropColumn(
 080                name: "TenantId",
 081                schema: _schema.Schema,
 082                table: "Users");
 83
 084            migrationBuilder.DropColumn(
 085                name: "TenantId",
 086                schema: _schema.Schema,
 087                table: "Roles");
 88
 089            migrationBuilder.DropColumn(
 090                name: "TenantId",
 091                schema: _schema.Schema,
 092                table: "Applications");
 093        }
 94    }
 95}

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

#LineLine coverage
 1// <auto-generated />
 2using Elsa.Persistence.EFCore.Modules.Identity;
 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.Identity
 12{
 13    [DbContext(typeof(IdentityElsaDbContext))]
 14    [Migration("20241212211900_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.Identity.Entities.Application", b =>
 029                {
 030                    b.Property<string>("Id")
 031                        .HasColumnType("text");
 032
 033                    b.Property<string>("ClientId")
 034                        .IsRequired()
 035                        .HasColumnType("text");
 036
 037                    b.Property<string>("HashedApiKey")
 038                        .IsRequired()
 039                        .HasColumnType("text");
 040
 041                    b.Property<string>("HashedApiKeySalt")
 042                        .IsRequired()
 043                        .HasColumnType("text");
 044
 045                    b.Property<string>("HashedClientSecret")
 046                        .IsRequired()
 047                        .HasColumnType("text");
 048
 049                    b.Property<string>("HashedClientSecretSalt")
 050                        .IsRequired()
 051                        .HasColumnType("text");
 052
 053                    b.Property<string>("Name")
 054                        .IsRequired()
 055                        .HasColumnType("text");
 056
 057                    b.Property<string>("Roles")
 058                        .IsRequired()
 059                        .HasColumnType("text")
 060                        .HasColumnName("Roles");
 061
 062                    b.Property<string>("TenantId")
 063                        .HasColumnType("text");
 064
 065                    b.HasKey("Id");
 066
 067                    b.HasIndex("ClientId")
 068                        .IsUnique()
 069                        .HasDatabaseName("IX_Application_ClientId");
 070
 071                    b.HasIndex("Name")
 072                        .IsUnique()
 073                        .HasDatabaseName("IX_Application_Name");
 074
 075                    b.HasIndex("TenantId")
 076                        .HasDatabaseName("IX_Application_TenantId");
 077
 078                    b.ToTable("Applications", "Elsa");
 079                });
 80
 081            modelBuilder.Entity("Elsa.Identity.Entities.Role", b =>
 082                {
 083                    b.Property<string>("Id")
 084                        .HasColumnType("text");
 085
 086                    b.Property<string>("Name")
 087                        .IsRequired()
 088                        .HasColumnType("text");
 089
 090                    b.Property<string>("Permissions")
 091                        .IsRequired()
 092                        .HasColumnType("text")
 093                        .HasColumnName("Permissions");
 094
 095                    b.Property<string>("TenantId")
 096                        .HasColumnType("text");
 097
 098                    b.HasKey("Id");
 099
 0100                    b.HasIndex("Name")
 0101                        .IsUnique()
 0102                        .HasDatabaseName("IX_Role_Name");
 0103
 0104                    b.HasIndex("TenantId")
 0105                        .HasDatabaseName("IX_Role_TenantId");
 0106
 0107                    b.ToTable("Roles", "Elsa");
 0108                });
 109
 0110            modelBuilder.Entity("Elsa.Identity.Entities.User", b =>
 0111                {
 0112                    b.Property<string>("Id")
 0113                        .HasColumnType("text");
 0114
 0115                    b.Property<string>("HashedPassword")
 0116                        .IsRequired()
 0117                        .HasColumnType("text");
 0118
 0119                    b.Property<string>("HashedPasswordSalt")
 0120                        .IsRequired()
 0121                        .HasColumnType("text");
 0122
 0123                    b.Property<string>("Name")
 0124                        .IsRequired()
 0125                        .HasColumnType("text");
 0126
 0127                    b.Property<string>("Roles")
 0128                        .IsRequired()
 0129                        .HasColumnType("text")
 0130                        .HasColumnName("Roles");
 0131
 0132                    b.Property<string>("TenantId")
 0133                        .HasColumnType("text");
 0134
 0135                    b.HasKey("Id");
 0136
 0137                    b.HasIndex("Name")
 0138                        .IsUnique()
 0139                        .HasDatabaseName("IX_User_Name");
 0140
 0141                    b.HasIndex("TenantId")
 0142                        .HasDatabaseName("IX_User_TenantId");
 0143
 0144                    b.ToTable("Users", "Elsa");
 0145                });
 146#pragma warning restore 612, 618
 0147        }
 148    }
 149}