< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 171
Coverable lines: 171
Total lines: 222
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: 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/20231015122246_Initial.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 Initial : Migration
 9    {
 10        /// <inheritdoc />
 11        protected override void Up(MigrationBuilder migrationBuilder)
 12        {
 013            migrationBuilder.CreateTable(
 014                name: "Applications",
 015                columns: table => new
 016                {
 017                    Id = table.Column<string>(type: "TEXT", nullable: false),
 018                    ClientId = table.Column<string>(type: "TEXT", nullable: false),
 019                    HashedClientSecret = table.Column<string>(type: "TEXT", nullable: false),
 020                    HashedClientSecretSalt = table.Column<string>(type: "TEXT", nullable: false),
 021                    Name = table.Column<string>(type: "TEXT", nullable: false),
 022                    HashedApiKey = table.Column<string>(type: "TEXT", nullable: false),
 023                    HashedApiKeySalt = table.Column<string>(type: "TEXT", nullable: false),
 024                    Roles = table.Column<string>(type: "TEXT", nullable: false)
 025                },
 026                constraints: table =>
 027                {
 028                    table.PrimaryKey("PK_Applications", x => x.Id);
 029                });
 30
 031            migrationBuilder.CreateTable(
 032                name: "Roles",
 033                columns: table => new
 034                {
 035                    Id = table.Column<string>(type: "TEXT", nullable: false),
 036                    Name = table.Column<string>(type: "TEXT", nullable: false),
 037                    Permissions = table.Column<string>(type: "TEXT", nullable: false)
 038                },
 039                constraints: table =>
 040                {
 041                    table.PrimaryKey("PK_Roles", x => x.Id);
 042                });
 43
 044            migrationBuilder.CreateTable(
 045                name: "Users",
 046                columns: table => new
 047                {
 048                    Id = table.Column<string>(type: "TEXT", nullable: false),
 049                    Name = table.Column<string>(type: "TEXT", nullable: false),
 050                    HashedPassword = table.Column<string>(type: "TEXT", nullable: false),
 051                    HashedPasswordSalt = table.Column<string>(type: "TEXT", nullable: false),
 052                    Roles = table.Column<string>(type: "TEXT", nullable: false)
 053                },
 054                constraints: table =>
 055                {
 056                    table.PrimaryKey("PK_Users", x => x.Id);
 057                });
 58
 059            migrationBuilder.CreateIndex(
 060                name: "IX_Application_ClientId",
 061                table: "Applications",
 062                column: "ClientId",
 063                unique: true);
 64
 065            migrationBuilder.CreateIndex(
 066                name: "IX_Application_Name",
 067                table: "Applications",
 068                column: "Name",
 069                unique: true);
 70
 071            migrationBuilder.CreateIndex(
 072                name: "IX_Role_Name",
 073                table: "Roles",
 074                column: "Name",
 075                unique: true);
 76
 077            migrationBuilder.CreateIndex(
 078                name: "IX_User_Name",
 079                table: "Users",
 080                column: "Name",
 081                unique: true);
 082        }
 83
 84        /// <inheritdoc />
 85        protected override void Down(MigrationBuilder migrationBuilder)
 86        {
 087            migrationBuilder.DropTable(
 088                name: "Applications");
 89
 090            migrationBuilder.DropTable(
 091                name: "Roles");
 92
 093            migrationBuilder.DropTable(
 094                name: "Users");
 095        }
 96    }
 97}

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Identity/20231015122246_Initial.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("20231015122246_Initial")]
 14    partial class Initial
 15    {
 16        /// <inheritdoc />
 17        protected override void BuildTargetModel(ModelBuilder modelBuilder)
 18        {
 19#pragma warning disable 612, 618
 020            modelBuilder.HasAnnotation("ProductVersion", "7.0.11");
 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.HasKey("Id");
 057
 058                    b.HasIndex("ClientId")
 059                        .IsUnique()
 060                        .HasDatabaseName("IX_Application_ClientId");
 061
 062                    b.HasIndex("Name")
 063                        .IsUnique()
 064                        .HasDatabaseName("IX_Application_Name");
 065
 066                    b.ToTable("Applications");
 067                });
 68
 069            modelBuilder.Entity("Elsa.Identity.Entities.Role", b =>
 070                {
 071                    b.Property<string>("Id")
 072                        .HasColumnType("TEXT");
 073
 074                    b.Property<string>("Name")
 075                        .IsRequired()
 076                        .HasColumnType("TEXT");
 077
 078                    b.Property<string>("Permissions")
 079                        .IsRequired()
 080                        .HasColumnType("TEXT")
 081                        .HasColumnName("Permissions");
 082
 083                    b.HasKey("Id");
 084
 085                    b.HasIndex("Name")
 086                        .IsUnique()
 087                        .HasDatabaseName("IX_Role_Name");
 088
 089                    b.ToTable("Roles");
 090                });
 91
 092            modelBuilder.Entity("Elsa.Identity.Entities.User", b =>
 093                {
 094                    b.Property<string>("Id")
 095                        .HasColumnType("TEXT");
 096
 097                    b.Property<string>("HashedPassword")
 098                        .IsRequired()
 099                        .HasColumnType("TEXT");
 0100
 0101                    b.Property<string>("HashedPasswordSalt")
 0102                        .IsRequired()
 0103                        .HasColumnType("TEXT");
 0104
 0105                    b.Property<string>("Name")
 0106                        .IsRequired()
 0107                        .HasColumnType("TEXT");
 0108
 0109                    b.Property<string>("Roles")
 0110                        .IsRequired()
 0111                        .HasColumnType("TEXT")
 0112                        .HasColumnName("Roles");
 0113
 0114                    b.HasKey("Id");
 0115
 0116                    b.HasIndex("Name")
 0117                        .IsUnique()
 0118                        .HasDatabaseName("IX_User_Name");
 0119
 0120                    b.ToTable("Users");
 0121                });
 122#pragma warning restore 612, 618
 0123        }
 124    }
 125}