< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 168
Coverable lines: 168
Total lines: 226
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.Sqlite/Migrations/Identity/20241212211850_V3_3.cs

#LineLine coverage
 1using Microsoft.EntityFrameworkCore.Migrations;
 2
 3#nullable disable
 4
 5namespace Elsa.Persistence.EFCore.Sqlite.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                table: "Users",
 024                type: "TEXT",
 025                nullable: true);
 26
 027            migrationBuilder.AddColumn<string>(
 028                name: "TenantId",
 029                table: "Roles",
 030                type: "TEXT",
 031                nullable: true);
 32
 033            migrationBuilder.AddColumn<string>(
 034                name: "TenantId",
 035                table: "Applications",
 036                type: "TEXT",
 037                nullable: true);
 38
 039            migrationBuilder.CreateIndex(
 040                name: "IX_User_TenantId",
 041                table: "Users",
 042                column: "TenantId");
 43
 044            migrationBuilder.CreateIndex(
 045                name: "IX_Role_TenantId",
 046                table: "Roles",
 047                column: "TenantId");
 48
 049            migrationBuilder.CreateIndex(
 050                name: "IX_Application_TenantId",
 051                table: "Applications",
 052                column: "TenantId");
 053        }
 54
 55        /// <inheritdoc />
 56        protected override void Down(MigrationBuilder migrationBuilder)
 57        {
 058            migrationBuilder.DropIndex(
 059                name: "IX_User_TenantId",
 060                table: "Users");
 61
 062            migrationBuilder.DropIndex(
 063                name: "IX_Role_TenantId",
 064                table: "Roles");
 65
 066            migrationBuilder.DropIndex(
 067                name: "IX_Application_TenantId",
 068                table: "Applications");
 69
 070            migrationBuilder.DropColumn(
 071                name: "TenantId",
 072                table: "Users");
 73
 074            migrationBuilder.DropColumn(
 075                name: "TenantId",
 076                table: "Roles");
 77
 078            migrationBuilder.DropColumn(
 079                name: "TenantId",
 080                table: "Applications");
 081        }
 82    }
 83}

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Identity/20241212211850_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;
 7
 8#nullable disable
 9
 10namespace Elsa.Persistence.EFCore.Sqlite.Migrations.Identity
 11{
 12    [DbContext(typeof(IdentityElsaDbContext))]
 13    [Migration("20241212211850_V3_3")]
 14    partial class V3_3
 15    {
 16        /// <inheritdoc />
 17        protected override void BuildTargetModel(ModelBuilder modelBuilder)
 18        {
 19#pragma warning disable 612, 618
 020            modelBuilder.HasAnnotation("ProductVersion", "7.0.20");
 21
 022            modelBuilder.Entity("Elsa.Identity.Entities.Application", b =>
 023                {
 024                    b.Property<string>("Id")
 025                        .HasColumnType("TEXT");
 026
 027                    b.Property<string>("ClientId")
 028                        .IsRequired()
 029                        .HasColumnType("TEXT");
 030
 031                    b.Property<string>("HashedApiKey")
 032                        .IsRequired()
 033                        .HasColumnType("TEXT");
 034
 035                    b.Property<string>("HashedApiKeySalt")
 036                        .IsRequired()
 037                        .HasColumnType("TEXT");
 038
 039                    b.Property<string>("HashedClientSecret")
 040                        .IsRequired()
 041                        .HasColumnType("TEXT");
 042
 043                    b.Property<string>("HashedClientSecretSalt")
 044                        .IsRequired()
 045                        .HasColumnType("TEXT");
 046
 047                    b.Property<string>("Name")
 048                        .IsRequired()
 049                        .HasColumnType("TEXT");
 050
 051                    b.Property<string>("Roles")
 052                        .IsRequired()
 053                        .HasColumnType("TEXT")
 054                        .HasColumnName("Roles");
 055
 056                    b.Property<string>("TenantId")
 057                        .HasColumnType("TEXT");
 058
 059                    b.HasKey("Id");
 060
 061                    b.HasIndex("ClientId")
 062                        .IsUnique()
 063                        .HasDatabaseName("IX_Application_ClientId");
 064
 065                    b.HasIndex("Name")
 066                        .IsUnique()
 067                        .HasDatabaseName("IX_Application_Name");
 068
 069                    b.HasIndex("TenantId")
 070                        .HasDatabaseName("IX_Application_TenantId");
 071
 072                    b.ToTable("Applications");
 073                });
 74
 075            modelBuilder.Entity("Elsa.Identity.Entities.Role", b =>
 076                {
 077                    b.Property<string>("Id")
 078                        .HasColumnType("TEXT");
 079
 080                    b.Property<string>("Name")
 081                        .IsRequired()
 082                        .HasColumnType("TEXT");
 083
 084                    b.Property<string>("Permissions")
 085                        .IsRequired()
 086                        .HasColumnType("TEXT")
 087                        .HasColumnName("Permissions");
 088
 089                    b.Property<string>("TenantId")
 090                        .HasColumnType("TEXT");
 091
 092                    b.HasKey("Id");
 093
 094                    b.HasIndex("Name")
 095                        .IsUnique()
 096                        .HasDatabaseName("IX_Role_Name");
 097
 098                    b.HasIndex("TenantId")
 099                        .HasDatabaseName("IX_Role_TenantId");
 0100
 0101                    b.ToTable("Roles");
 0102                });
 103
 0104            modelBuilder.Entity("Elsa.Identity.Entities.User", b =>
 0105                {
 0106                    b.Property<string>("Id")
 0107                        .HasColumnType("TEXT");
 0108
 0109                    b.Property<string>("HashedPassword")
 0110                        .IsRequired()
 0111                        .HasColumnType("TEXT");
 0112
 0113                    b.Property<string>("HashedPasswordSalt")
 0114                        .IsRequired()
 0115                        .HasColumnType("TEXT");
 0116
 0117                    b.Property<string>("Name")
 0118                        .IsRequired()
 0119                        .HasColumnType("TEXT");
 0120
 0121                    b.Property<string>("Roles")
 0122                        .IsRequired()
 0123                        .HasColumnType("TEXT")
 0124                        .HasColumnName("Roles");
 0125
 0126                    b.Property<string>("TenantId")
 0127                        .HasColumnType("TEXT");
 0128
 0129                    b.HasKey("Id");
 0130
 0131                    b.HasIndex("Name")
 0132                        .IsUnique()
 0133                        .HasDatabaseName("IX_User_Name");
 0134
 0135                    b.HasIndex("TenantId")
 0136                        .HasDatabaseName("IX_User_TenantId");
 0137
 0138                    b.ToTable("Users");
 0139                });
 140#pragma warning restore 612, 618
 0141        }
 142    }
 143}