< Summary - Heimdall API

Line coverage
100%
Covered lines: 936
Uncovered lines: 0
Coverable lines: 936
Total lines: 1036
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
100%
Covered methods: 3
Fully covered methods: 3
Total methods: 3
Method coverage: 100%
Full method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
File 1: Up(...)100%11100%
File 1: Down(...)100%11100%
File 2: BuildTargetModel(...)100%11100%

File(s)

/home/ci/agent/workspace/heimdall-api-docs_main/app/src/Infrastructure/ArturRios.Heimdall.Data/Migrations/20260723222435_InitialCreate.cs

#LineLine coverage
 1using System;
 2using Microsoft.EntityFrameworkCore.Migrations;
 3using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
 4
 5#nullable disable
 6
 7namespace ArturRios.Heimdall.Data.Migrations
 8{
 9    /// <inheritdoc />
 10    public partial class InitialCreate : Migration
 11    {
 12        /// <inheritdoc />
 13        protected override void Up(MigrationBuilder migrationBuilder)
 14        {
 1915            migrationBuilder.EnsureSchema(
 1916                name: "heimdall");
 17
 1918            migrationBuilder.CreateTable(
 1919                name: "role",
 1920                schema: "heimdall",
 1921                columns: table => new
 1922                {
 1923                    id = table.Column<long>(type: "bigint", nullable: false),
 1924                    public_id = table.Column<Guid>(type: "uuid", nullable: false),
 1925                    name = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: false),
 1926                    description = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: true)
 1927                },
 1928                constraints: table =>
 1929                {
 1930                    table.PrimaryKey("pk_role", x => x.id);
 3831                });
 32
 1933            migrationBuilder.CreateTable(
 1934                name: "scope",
 1935                schema: "heimdall",
 1936                columns: table => new
 1937                {
 1938                    id = table.Column<long>(type: "bigint", nullable: false)
 1939                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultCol
 1940                    public_id = table.Column<Guid>(type: "uuid", nullable: false),
 1941                    name = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: false),
 1942                    description = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: true),
 1943                    is_deleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
 1944                    google_sign_in_enabled = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
 1945                    created_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, defaultValueS
 1946                    updated_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, defaultValueS
 1947                },
 1948                constraints: table =>
 1949                {
 1950                    table.PrimaryKey("pk_scope", x => x.id);
 3851                });
 52
 1953            migrationBuilder.CreateTable(
 1954                name: "person",
 1955                schema: "heimdall",
 1956                columns: table => new
 1957                {
 1958                    id = table.Column<long>(type: "bigint", nullable: false)
 1959                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultCol
 1960                    public_id = table.Column<Guid>(type: "uuid", nullable: false),
 1961                    name = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: false),
 1962                    email = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
 1963                    password_hash = table.Column<byte[]>(type: "bytea", nullable: false),
 1964                    salt = table.Column<byte[]>(type: "bytea", nullable: false),
 1965                    is_deleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
 1966                    email_verified = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
 1967                    role_id = table.Column<long>(type: "bigint", nullable: false),
 1968                    created_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, defaultValueS
 1969                    updated_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, defaultValueS
 1970                },
 1971                constraints: table =>
 1972                {
 1973                    table.PrimaryKey("pk_person", x => x.id);
 1974                    table.ForeignKey(
 1975                        name: "fk_person_roles_role_id",
 1976                        column: x => x.role_id,
 1977                        principalSchema: "heimdall",
 1978                        principalTable: "role",
 1979                        principalColumn: "id",
 1980                        onDelete: ReferentialAction.Restrict);
 3881                });
 82
 1983            migrationBuilder.CreateTable(
 1984                name: "google_user",
 1985                schema: "heimdall",
 1986                columns: table => new
 1987                {
 1988                    id = table.Column<long>(type: "bigint", nullable: false)
 1989                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultCol
 1990                    public_id = table.Column<Guid>(type: "uuid", nullable: false),
 1991                    google_id = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),
 1992                    name = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: false),
 1993                    email = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
 1994                    email_verified = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
 1995                    profile_picture_url = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullabl
 1996                    is_deleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
 1997                    scope_id = table.Column<long>(type: "bigint", nullable: false),
 1998                    created_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, defaultValueS
 1999                    updated_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, defaultValueS
 19100                },
 19101                constraints: table =>
 19102                {
 19103                    table.PrimaryKey("pk_google_user", x => x.id);
 19104                    table.ForeignKey(
 19105                        name: "fk_google_user_scope_scope_id",
 19106                        column: x => x.scope_id,
 19107                        principalSchema: "heimdall",
 19108                        principalTable: "scope",
 19109                        principalColumn: "id",
 19110                        onDelete: ReferentialAction.Cascade);
 38111                });
 112
 19113            migrationBuilder.CreateTable(
 19114                name: "application",
 19115                schema: "heimdall",
 19116                columns: table => new
 19117                {
 19118                    id = table.Column<long>(type: "bigint", nullable: false)
 19119                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultCol
 19120                    public_id = table.Column<Guid>(type: "uuid", nullable: false),
 19121                    name = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: false),
 19122                    is_deleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
 19123                    scope_id = table.Column<long>(type: "bigint", nullable: false),
 19124                    owner_id = table.Column<long>(type: "bigint", nullable: false),
 19125                    created_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, defaultValueS
 19126                    updated_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, defaultValueS
 19127                },
 19128                constraints: table =>
 19129                {
 19130                    table.PrimaryKey("pk_application", x => x.id);
 19131                    table.ForeignKey(
 19132                        name: "fk_application_person_owner_id",
 19133                        column: x => x.owner_id,
 19134                        principalSchema: "heimdall",
 19135                        principalTable: "person",
 19136                        principalColumn: "id",
 19137                        onDelete: ReferentialAction.Cascade);
 19138                    table.ForeignKey(
 19139                        name: "fk_application_scope_scope_id",
 19140                        column: x => x.scope_id,
 19141                        principalSchema: "heimdall",
 19142                        principalTable: "scope",
 19143                        principalColumn: "id",
 19144                        onDelete: ReferentialAction.Cascade);
 38145                });
 146
 19147            migrationBuilder.CreateTable(
 19148                name: "email_verification_token",
 19149                schema: "heimdall",
 19150                columns: table => new
 19151                {
 19152                    id = table.Column<long>(type: "bigint", nullable: false)
 19153                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultCol
 19154                    person_id = table.Column<long>(type: "bigint", nullable: false),
 19155                    token = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
 19156                    expires_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
 19157                    used = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false)
 19158                },
 19159                constraints: table =>
 19160                {
 19161                    table.PrimaryKey("pk_email_verification_token", x => x.id);
 19162                    table.ForeignKey(
 19163                        name: "fk_email_verification_token_person_person_id",
 19164                        column: x => x.person_id,
 19165                        principalSchema: "heimdall",
 19166                        principalTable: "person",
 19167                        principalColumn: "id",
 19168                        onDelete: ReferentialAction.Cascade);
 38169                });
 170
 19171            migrationBuilder.CreateTable(
 19172                name: "password_reset_token",
 19173                schema: "heimdall",
 19174                columns: table => new
 19175                {
 19176                    id = table.Column<long>(type: "bigint", nullable: false)
 19177                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultCol
 19178                    person_id = table.Column<long>(type: "bigint", nullable: false),
 19179                    token = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
 19180                    expires_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
 19181                    used = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false)
 19182                },
 19183                constraints: table =>
 19184                {
 19185                    table.PrimaryKey("pk_password_reset_token", x => x.id);
 19186                    table.ForeignKey(
 19187                        name: "fk_password_reset_token_person_person_id",
 19188                        column: x => x.person_id,
 19189                        principalSchema: "heimdall",
 19190                        principalTable: "person",
 19191                        principalColumn: "id",
 19192                        onDelete: ReferentialAction.Cascade);
 38193                });
 194
 19195            migrationBuilder.CreateTable(
 19196                name: "scope_owner",
 19197                schema: "heimdall",
 19198                columns: table => new
 19199                {
 19200                    scope_id = table.Column<long>(type: "bigint", nullable: false),
 19201                    person_id = table.Column<long>(type: "bigint", nullable: false)
 19202                },
 19203                constraints: table =>
 19204                {
 19205                    table.PrimaryKey("pk_scope_owner", x => new { x.scope_id, x.person_id });
 19206                    table.ForeignKey(
 19207                        name: "fk_scope_owner_person_person_id",
 19208                        column: x => x.person_id,
 19209                        principalSchema: "heimdall",
 19210                        principalTable: "person",
 19211                        principalColumn: "id",
 19212                        onDelete: ReferentialAction.Cascade);
 19213                    table.ForeignKey(
 19214                        name: "fk_scope_owner_scope_scope_id",
 19215                        column: x => x.scope_id,
 19216                        principalSchema: "heimdall",
 19217                        principalTable: "scope",
 19218                        principalColumn: "id",
 19219                        onDelete: ReferentialAction.Cascade);
 38220                });
 221
 19222            migrationBuilder.CreateTable(
 19223                name: "scope_user",
 19224                schema: "heimdall",
 19225                columns: table => new
 19226                {
 19227                    scope_id = table.Column<long>(type: "bigint", nullable: false),
 19228                    person_id = table.Column<long>(type: "bigint", nullable: false)
 19229                },
 19230                constraints: table =>
 19231                {
 19232                    table.PrimaryKey("pk_scope_user", x => new { x.scope_id, x.person_id });
 19233                    table.ForeignKey(
 19234                        name: "fk_scope_user_person_person_id",
 19235                        column: x => x.person_id,
 19236                        principalSchema: "heimdall",
 19237                        principalTable: "person",
 19238                        principalColumn: "id",
 19239                        onDelete: ReferentialAction.Cascade);
 19240                    table.ForeignKey(
 19241                        name: "fk_scope_user_scope_scope_id",
 19242                        column: x => x.scope_id,
 19243                        principalSchema: "heimdall",
 19244                        principalTable: "scope",
 19245                        principalColumn: "id",
 19246                        onDelete: ReferentialAction.Cascade);
 38247                });
 248
 19249            migrationBuilder.CreateIndex(
 19250                name: "ix_application_owner_id",
 19251                schema: "heimdall",
 19252                table: "application",
 19253                column: "owner_id");
 254
 19255            migrationBuilder.CreateIndex(
 19256                name: "ix_application_public_id",
 19257                schema: "heimdall",
 19258                table: "application",
 19259                column: "public_id",
 19260                unique: true);
 261
 19262            migrationBuilder.CreateIndex(
 19263                name: "ix_application_scope_id",
 19264                schema: "heimdall",
 19265                table: "application",
 19266                column: "scope_id");
 267
 19268            migrationBuilder.CreateIndex(
 19269                name: "ix_email_verification_token_person_id",
 19270                schema: "heimdall",
 19271                table: "email_verification_token",
 19272                column: "person_id");
 273
 19274            migrationBuilder.CreateIndex(
 19275                name: "ix_email_verification_token_token",
 19276                schema: "heimdall",
 19277                table: "email_verification_token",
 19278                column: "token",
 19279                unique: true);
 280
 19281            migrationBuilder.CreateIndex(
 19282                name: "ix_google_user_public_id",
 19283                schema: "heimdall",
 19284                table: "google_user",
 19285                column: "public_id",
 19286                unique: true);
 287
 19288            migrationBuilder.CreateIndex(
 19289                name: "ix_google_user_scope_id_email",
 19290                schema: "heimdall",
 19291                table: "google_user",
 19292                columns: new[] { "scope_id", "email" },
 19293                unique: true);
 294
 19295            migrationBuilder.CreateIndex(
 19296                name: "ix_google_user_scope_id_google_id",
 19297                schema: "heimdall",
 19298                table: "google_user",
 19299                columns: new[] { "scope_id", "google_id" },
 19300                unique: true);
 301
 19302            migrationBuilder.CreateIndex(
 19303                name: "ix_password_reset_token_person_id",
 19304                schema: "heimdall",
 19305                table: "password_reset_token",
 19306                column: "person_id");
 307
 19308            migrationBuilder.CreateIndex(
 19309                name: "ix_password_reset_token_token",
 19310                schema: "heimdall",
 19311                table: "password_reset_token",
 19312                column: "token",
 19313                unique: true);
 314
 19315            migrationBuilder.CreateIndex(
 19316                name: "ix_person_email",
 19317                schema: "heimdall",
 19318                table: "person",
 19319                column: "email");
 320
 19321            migrationBuilder.CreateIndex(
 19322                name: "ix_person_public_id",
 19323                schema: "heimdall",
 19324                table: "person",
 19325                column: "public_id",
 19326                unique: true);
 327
 19328            migrationBuilder.CreateIndex(
 19329                name: "ix_person_role_id",
 19330                schema: "heimdall",
 19331                table: "person",
 19332                column: "role_id");
 333
 19334            migrationBuilder.CreateIndex(
 19335                name: "ix_role_name",
 19336                schema: "heimdall",
 19337                table: "role",
 19338                column: "name",
 19339                unique: true);
 340
 19341            migrationBuilder.CreateIndex(
 19342                name: "ix_role_public_id",
 19343                schema: "heimdall",
 19344                table: "role",
 19345                column: "public_id",
 19346                unique: true);
 347
 19348            migrationBuilder.CreateIndex(
 19349                name: "ix_scope_name",
 19350                schema: "heimdall",
 19351                table: "scope",
 19352                column: "name",
 19353                unique: true);
 354
 19355            migrationBuilder.CreateIndex(
 19356                name: "ix_scope_public_id",
 19357                schema: "heimdall",
 19358                table: "scope",
 19359                column: "public_id",
 19360                unique: true);
 361
 19362            migrationBuilder.CreateIndex(
 19363                name: "ix_scope_owner_person_id",
 19364                schema: "heimdall",
 19365                table: "scope_owner",
 19366                column: "person_id");
 367
 19368            migrationBuilder.CreateIndex(
 19369                name: "ix_scope_user_person_id",
 19370                schema: "heimdall",
 19371                table: "scope_user",
 19372                column: "person_id",
 19373                unique: true);
 19374        }
 375
 376        /// <inheritdoc />
 377        protected override void Down(MigrationBuilder migrationBuilder)
 378        {
 1379            migrationBuilder.DropTable(
 1380                name: "application",
 1381                schema: "heimdall");
 382
 1383            migrationBuilder.DropTable(
 1384                name: "email_verification_token",
 1385                schema: "heimdall");
 386
 1387            migrationBuilder.DropTable(
 1388                name: "google_user",
 1389                schema: "heimdall");
 390
 1391            migrationBuilder.DropTable(
 1392                name: "password_reset_token",
 1393                schema: "heimdall");
 394
 1395            migrationBuilder.DropTable(
 1396                name: "scope_owner",
 1397                schema: "heimdall");
 398
 1399            migrationBuilder.DropTable(
 1400                name: "scope_user",
 1401                schema: "heimdall");
 402
 1403            migrationBuilder.DropTable(
 1404                name: "person",
 1405                schema: "heimdall");
 406
 1407            migrationBuilder.DropTable(
 1408                name: "scope",
 1409                schema: "heimdall");
 410
 1411            migrationBuilder.DropTable(
 1412                name: "role",
 1413                schema: "heimdall");
 1414        }
 415    }
 416}

/home/ci/agent/workspace/heimdall-api-docs_main/app/src/Infrastructure/ArturRios.Heimdall.Data/Migrations/20260723222435_InitialCreate.Designer.cs

#LineLine coverage
 1// <auto-generated />
 2using System;
 3using ArturRios.Heimdall.Data.Configuration;
 4using Microsoft.EntityFrameworkCore;
 5using Microsoft.EntityFrameworkCore.Infrastructure;
 6using Microsoft.EntityFrameworkCore.Migrations;
 7using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
 8using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
 9
 10#nullable disable
 11
 12namespace ArturRios.Heimdall.Data.Migrations
 13{
 14    [DbContext(typeof(AppDbContext))]
 15    [Migration("20260723222435_InitialCreate")]
 16    partial class InitialCreate
 17    {
 18        /// <inheritdoc />
 19        protected override void BuildTargetModel(ModelBuilder modelBuilder)
 20        {
 21#pragma warning disable 612, 618
 1022            modelBuilder
 1023                .HasDefaultSchema("heimdall")
 1024                .HasAnnotation("ProductVersion", "10.0.10")
 1025                .HasAnnotation("Relational:MaxIdentifierLength", 63);
 26
 1027            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
 28
 1029            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.Application", b =>
 1030                {
 1031                    b.Property<long>("Id")
 1032                        .ValueGeneratedOnAdd()
 1033                        .HasColumnType("bigint")
 1034                        .HasColumnName("id")
 1035                        .HasColumnOrder(1);
 1036
 1037                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
 1038
 1039                    b.Property<DateTime>("CreatedAt")
 1040                        .ValueGeneratedOnAdd()
 1041                        .HasColumnType("timestamp with time zone")
 1042                        .HasColumnName("created_at")
 1043                        .HasDefaultValueSql("now()");
 1044
 1045                    b.Property<bool>("IsDeleted")
 1046                        .ValueGeneratedOnAdd()
 1047                        .HasColumnType("boolean")
 1048                        .HasDefaultValue(false)
 1049                        .HasColumnName("is_deleted");
 1050
 1051                    b.Property<string>("Name")
 1052                        .IsRequired()
 1053                        .HasMaxLength(200)
 1054                        .HasColumnType("character varying(200)")
 1055                        .HasColumnName("name");
 1056
 1057                    b.Property<long>("OwnerId")
 1058                        .HasColumnType("bigint")
 1059                        .HasColumnName("owner_id");
 1060
 1061                    b.Property<Guid>("PublicId")
 1062                        .HasColumnType("uuid")
 1063                        .HasColumnName("public_id");
 1064
 1065                    b.Property<long>("ScopeId")
 1066                        .HasColumnType("bigint")
 1067                        .HasColumnName("scope_id");
 1068
 1069                    b.Property<DateTime>("UpdatedAt")
 1070                        .ValueGeneratedOnAdd()
 1071                        .HasColumnType("timestamp with time zone")
 1072                        .HasColumnName("updated_at")
 1073                        .HasDefaultValueSql("now()");
 1074
 1075                    b.HasKey("Id")
 1076                        .HasName("pk_application");
 1077
 1078                    b.HasIndex("OwnerId")
 1079                        .HasDatabaseName("ix_application_owner_id");
 1080
 1081                    b.HasIndex("PublicId")
 1082                        .IsUnique()
 1083                        .HasDatabaseName("ix_application_public_id");
 1084
 1085                    b.HasIndex("ScopeId")
 1086                        .HasDatabaseName("ix_application_scope_id");
 1087
 1088                    b.ToTable("application", "heimdall");
 2089                });
 90
 1091            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.EmailVerificationToken", b =>
 1092                {
 1093                    b.Property<long>("Id")
 1094                        .ValueGeneratedOnAdd()
 1095                        .HasColumnType("bigint")
 1096                        .HasColumnName("id")
 1097                        .HasColumnOrder(1);
 1098
 1099                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
 10100
 10101                    b.Property<DateTime>("ExpiresAt")
 10102                        .HasColumnType("timestamp with time zone")
 10103                        .HasColumnName("expires_at");
 10104
 10105                    b.Property<long>("PersonId")
 10106                        .HasColumnType("bigint")
 10107                        .HasColumnName("person_id");
 10108
 10109                    b.Property<string>("Token")
 10110                        .IsRequired()
 10111                        .HasMaxLength(256)
 10112                        .HasColumnType("character varying(256)")
 10113                        .HasColumnName("token");
 10114
 10115                    b.Property<bool>("Used")
 10116                        .ValueGeneratedOnAdd()
 10117                        .HasColumnType("boolean")
 10118                        .HasDefaultValue(false)
 10119                        .HasColumnName("used");
 10120
 10121                    b.HasKey("Id")
 10122                        .HasName("pk_email_verification_token");
 10123
 10124                    b.HasIndex("PersonId")
 10125                        .HasDatabaseName("ix_email_verification_token_person_id");
 10126
 10127                    b.HasIndex("Token")
 10128                        .IsUnique()
 10129                        .HasDatabaseName("ix_email_verification_token_token");
 10130
 10131                    b.ToTable("email_verification_token", "heimdall");
 20132                });
 133
 10134            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.GoogleUser", b =>
 10135                {
 10136                    b.Property<long>("Id")
 10137                        .ValueGeneratedOnAdd()
 10138                        .HasColumnType("bigint")
 10139                        .HasColumnName("id")
 10140                        .HasColumnOrder(1);
 10141
 10142                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
 10143
 10144                    b.Property<DateTime>("CreatedAt")
 10145                        .ValueGeneratedOnAdd()
 10146                        .HasColumnType("timestamp with time zone")
 10147                        .HasColumnName("created_at")
 10148                        .HasDefaultValueSql("now()");
 10149
 10150                    b.Property<string>("Email")
 10151                        .IsRequired()
 10152                        .HasMaxLength(256)
 10153                        .HasColumnType("character varying(256)")
 10154                        .HasColumnName("email");
 10155
 10156                    b.Property<bool>("EmailVerified")
 10157                        .ValueGeneratedOnAdd()
 10158                        .HasColumnType("boolean")
 10159                        .HasDefaultValue(false)
 10160                        .HasColumnName("email_verified");
 10161
 10162                    b.Property<string>("GoogleId")
 10163                        .IsRequired()
 10164                        .HasMaxLength(255)
 10165                        .HasColumnType("character varying(255)")
 10166                        .HasColumnName("google_id");
 10167
 10168                    b.Property<bool>("IsDeleted")
 10169                        .ValueGeneratedOnAdd()
 10170                        .HasColumnType("boolean")
 10171                        .HasDefaultValue(false)
 10172                        .HasColumnName("is_deleted");
 10173
 10174                    b.Property<string>("Name")
 10175                        .IsRequired()
 10176                        .HasMaxLength(200)
 10177                        .HasColumnType("character varying(200)")
 10178                        .HasColumnName("name");
 10179
 10180                    b.Property<string>("ProfilePictureUrl")
 10181                        .HasMaxLength(2048)
 10182                        .HasColumnType("character varying(2048)")
 10183                        .HasColumnName("profile_picture_url");
 10184
 10185                    b.Property<Guid>("PublicId")
 10186                        .HasColumnType("uuid")
 10187                        .HasColumnName("public_id");
 10188
 10189                    b.Property<long>("ScopeId")
 10190                        .HasColumnType("bigint")
 10191                        .HasColumnName("scope_id");
 10192
 10193                    b.Property<DateTime>("UpdatedAt")
 10194                        .ValueGeneratedOnAdd()
 10195                        .HasColumnType("timestamp with time zone")
 10196                        .HasColumnName("updated_at")
 10197                        .HasDefaultValueSql("now()");
 10198
 10199                    b.HasKey("Id")
 10200                        .HasName("pk_google_user");
 10201
 10202                    b.HasIndex("PublicId")
 10203                        .IsUnique()
 10204                        .HasDatabaseName("ix_google_user_public_id");
 10205
 10206                    b.HasIndex("ScopeId", "Email")
 10207                        .IsUnique()
 10208                        .HasDatabaseName("ix_google_user_scope_id_email");
 10209
 10210                    b.HasIndex("ScopeId", "GoogleId")
 10211                        .IsUnique()
 10212                        .HasDatabaseName("ix_google_user_scope_id_google_id");
 10213
 10214                    b.ToTable("google_user", "heimdall");
 20215                });
 216
 10217            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.PasswordResetToken", b =>
 10218                {
 10219                    b.Property<long>("Id")
 10220                        .ValueGeneratedOnAdd()
 10221                        .HasColumnType("bigint")
 10222                        .HasColumnName("id")
 10223                        .HasColumnOrder(1);
 10224
 10225                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
 10226
 10227                    b.Property<DateTime>("ExpiresAt")
 10228                        .HasColumnType("timestamp with time zone")
 10229                        .HasColumnName("expires_at");
 10230
 10231                    b.Property<long>("PersonId")
 10232                        .HasColumnType("bigint")
 10233                        .HasColumnName("person_id");
 10234
 10235                    b.Property<string>("Token")
 10236                        .IsRequired()
 10237                        .HasMaxLength(256)
 10238                        .HasColumnType("character varying(256)")
 10239                        .HasColumnName("token");
 10240
 10241                    b.Property<bool>("Used")
 10242                        .ValueGeneratedOnAdd()
 10243                        .HasColumnType("boolean")
 10244                        .HasDefaultValue(false)
 10245                        .HasColumnName("used");
 10246
 10247                    b.HasKey("Id")
 10248                        .HasName("pk_password_reset_token");
 10249
 10250                    b.HasIndex("PersonId")
 10251                        .HasDatabaseName("ix_password_reset_token_person_id");
 10252
 10253                    b.HasIndex("Token")
 10254                        .IsUnique()
 10255                        .HasDatabaseName("ix_password_reset_token_token");
 10256
 10257                    b.ToTable("password_reset_token", "heimdall");
 20258                });
 259
 10260            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.Person", b =>
 10261                {
 10262                    b.Property<long>("Id")
 10263                        .ValueGeneratedOnAdd()
 10264                        .HasColumnType("bigint")
 10265                        .HasColumnName("id")
 10266                        .HasColumnOrder(1);
 10267
 10268                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
 10269
 10270                    b.Property<DateTime>("CreatedAt")
 10271                        .ValueGeneratedOnAdd()
 10272                        .HasColumnType("timestamp with time zone")
 10273                        .HasColumnName("created_at")
 10274                        .HasDefaultValueSql("now()");
 10275
 10276                    b.Property<string>("Email")
 10277                        .IsRequired()
 10278                        .HasMaxLength(256)
 10279                        .HasColumnType("character varying(256)")
 10280                        .HasColumnName("email");
 10281
 10282                    b.Property<bool>("EmailVerified")
 10283                        .ValueGeneratedOnAdd()
 10284                        .HasColumnType("boolean")
 10285                        .HasDefaultValue(false)
 10286                        .HasColumnName("email_verified");
 10287
 10288                    b.Property<bool>("IsDeleted")
 10289                        .ValueGeneratedOnAdd()
 10290                        .HasColumnType("boolean")
 10291                        .HasDefaultValue(false)
 10292                        .HasColumnName("is_deleted");
 10293
 10294                    b.Property<string>("Name")
 10295                        .IsRequired()
 10296                        .HasMaxLength(200)
 10297                        .HasColumnType("character varying(200)")
 10298                        .HasColumnName("name");
 10299
 10300                    b.Property<byte[]>("PasswordHash")
 10301                        .IsRequired()
 10302                        .HasColumnType("bytea")
 10303                        .HasColumnName("password_hash");
 10304
 10305                    b.Property<Guid>("PublicId")
 10306                        .HasColumnType("uuid")
 10307                        .HasColumnName("public_id");
 10308
 10309                    b.Property<long>("RoleId")
 10310                        .HasColumnType("bigint")
 10311                        .HasColumnName("role_id");
 10312
 10313                    b.Property<byte[]>("Salt")
 10314                        .IsRequired()
 10315                        .HasColumnType("bytea")
 10316                        .HasColumnName("salt");
 10317
 10318                    b.Property<DateTime>("UpdatedAt")
 10319                        .ValueGeneratedOnAdd()
 10320                        .HasColumnType("timestamp with time zone")
 10321                        .HasColumnName("updated_at")
 10322                        .HasDefaultValueSql("now()");
 10323
 10324                    b.HasKey("Id")
 10325                        .HasName("pk_person");
 10326
 10327                    b.HasIndex("Email")
 10328                        .HasDatabaseName("ix_person_email");
 10329
 10330                    b.HasIndex("PublicId")
 10331                        .IsUnique()
 10332                        .HasDatabaseName("ix_person_public_id");
 10333
 10334                    b.HasIndex("RoleId")
 10335                        .HasDatabaseName("ix_person_role_id");
 10336
 10337                    b.ToTable("person", "heimdall");
 20338                });
 339
 10340            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.Role", b =>
 10341                {
 10342                    b.Property<long>("Id")
 10343                        .HasColumnType("bigint")
 10344                        .HasColumnName("id")
 10345                        .HasColumnOrder(1);
 10346
 10347                    b.Property<string>("Description")
 10348                        .HasMaxLength(500)
 10349                        .HasColumnType("character varying(500)")
 10350                        .HasColumnName("description");
 10351
 10352                    b.Property<string>("Name")
 10353                        .IsRequired()
 10354                        .HasMaxLength(200)
 10355                        .HasColumnType("character varying(200)")
 10356                        .HasColumnName("name");
 10357
 10358                    b.Property<Guid>("PublicId")
 10359                        .HasColumnType("uuid")
 10360                        .HasColumnName("public_id");
 10361
 10362                    b.HasKey("Id")
 10363                        .HasName("pk_role");
 10364
 10365                    b.HasIndex("Name")
 10366                        .IsUnique()
 10367                        .HasDatabaseName("ix_role_name");
 10368
 10369                    b.HasIndex("PublicId")
 10370                        .IsUnique()
 10371                        .HasDatabaseName("ix_role_public_id");
 10372
 10373                    b.ToTable("role", "heimdall");
 20374                });
 375
 10376            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.Scope", b =>
 10377                {
 10378                    b.Property<long>("Id")
 10379                        .ValueGeneratedOnAdd()
 10380                        .HasColumnType("bigint")
 10381                        .HasColumnName("id")
 10382                        .HasColumnOrder(1);
 10383
 10384                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
 10385
 10386                    b.Property<DateTime>("CreatedAt")
 10387                        .ValueGeneratedOnAdd()
 10388                        .HasColumnType("timestamp with time zone")
 10389                        .HasColumnName("created_at")
 10390                        .HasDefaultValueSql("now()");
 10391
 10392                    b.Property<string>("Description")
 10393                        .HasMaxLength(500)
 10394                        .HasColumnType("character varying(500)")
 10395                        .HasColumnName("description");
 10396
 10397                    b.Property<bool>("GoogleSignInEnabled")
 10398                        .ValueGeneratedOnAdd()
 10399                        .HasColumnType("boolean")
 10400                        .HasDefaultValue(false)
 10401                        .HasColumnName("google_sign_in_enabled");
 10402
 10403                    b.Property<bool>("IsDeleted")
 10404                        .ValueGeneratedOnAdd()
 10405                        .HasColumnType("boolean")
 10406                        .HasDefaultValue(false)
 10407                        .HasColumnName("is_deleted");
 10408
 10409                    b.Property<string>("Name")
 10410                        .IsRequired()
 10411                        .HasMaxLength(200)
 10412                        .HasColumnType("character varying(200)")
 10413                        .HasColumnName("name");
 10414
 10415                    b.Property<Guid>("PublicId")
 10416                        .HasColumnType("uuid")
 10417                        .HasColumnName("public_id");
 10418
 10419                    b.Property<DateTime>("UpdatedAt")
 10420                        .ValueGeneratedOnAdd()
 10421                        .HasColumnType("timestamp with time zone")
 10422                        .HasColumnName("updated_at")
 10423                        .HasDefaultValueSql("now()");
 10424
 10425                    b.HasKey("Id")
 10426                        .HasName("pk_scope");
 10427
 10428                    b.HasIndex("Name")
 10429                        .IsUnique()
 10430                        .HasDatabaseName("ix_scope_name");
 10431
 10432                    b.HasIndex("PublicId")
 10433                        .IsUnique()
 10434                        .HasDatabaseName("ix_scope_public_id");
 10435
 10436                    b.ToTable("scope", "heimdall");
 20437                });
 438
 10439            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.ScopeOwner", b =>
 10440                {
 10441                    b.Property<long>("ScopeId")
 10442                        .HasColumnType("bigint")
 10443                        .HasColumnName("scope_id");
 10444
 10445                    b.Property<long>("PersonId")
 10446                        .HasColumnType("bigint")
 10447                        .HasColumnName("person_id");
 10448
 10449                    b.HasKey("ScopeId", "PersonId")
 10450                        .HasName("pk_scope_owner");
 10451
 10452                    b.HasIndex("PersonId")
 10453                        .HasDatabaseName("ix_scope_owner_person_id");
 10454
 10455                    b.ToTable("scope_owner", "heimdall");
 20456                });
 457
 10458            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.ScopeUser", b =>
 10459                {
 10460                    b.Property<long>("ScopeId")
 10461                        .HasColumnType("bigint")
 10462                        .HasColumnName("scope_id");
 10463
 10464                    b.Property<long>("PersonId")
 10465                        .HasColumnType("bigint")
 10466                        .HasColumnName("person_id");
 10467
 10468                    b.HasKey("ScopeId", "PersonId")
 10469                        .HasName("pk_scope_user");
 10470
 10471                    b.HasIndex("PersonId")
 10472                        .IsUnique()
 10473                        .HasDatabaseName("ix_scope_user_person_id");
 10474
 10475                    b.ToTable("scope_user", "heimdall");
 20476                });
 477
 10478            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.Application", b =>
 10479                {
 10480                    b.HasOne("ArturRios.Heimdall.Domain.Entities.Person", "Owner")
 10481                        .WithMany("OwnedApplications")
 10482                        .HasForeignKey("OwnerId")
 10483                        .OnDelete(DeleteBehavior.Cascade)
 10484                        .IsRequired()
 10485                        .HasConstraintName("fk_application_person_owner_id");
 10486
 10487                    b.HasOne("ArturRios.Heimdall.Domain.Entities.Scope", "Scope")
 10488                        .WithMany("Applications")
 10489                        .HasForeignKey("ScopeId")
 10490                        .OnDelete(DeleteBehavior.Cascade)
 10491                        .IsRequired()
 10492                        .HasConstraintName("fk_application_scope_scope_id");
 10493
 10494                    b.Navigation("Owner");
 10495
 10496                    b.Navigation("Scope");
 20497                });
 498
 10499            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.EmailVerificationToken", b =>
 10500                {
 10501                    b.HasOne("ArturRios.Heimdall.Domain.Entities.Person", "Person")
 10502                        .WithMany("EmailVerificationTokens")
 10503                        .HasForeignKey("PersonId")
 10504                        .OnDelete(DeleteBehavior.Cascade)
 10505                        .IsRequired()
 10506                        .HasConstraintName("fk_email_verification_token_person_person_id");
 10507
 10508                    b.Navigation("Person");
 20509                });
 510
 10511            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.GoogleUser", b =>
 10512                {
 10513                    b.HasOne("ArturRios.Heimdall.Domain.Entities.Scope", "Scope")
 10514                        .WithMany("GoogleUsers")
 10515                        .HasForeignKey("ScopeId")
 10516                        .OnDelete(DeleteBehavior.Cascade)
 10517                        .IsRequired()
 10518                        .HasConstraintName("fk_google_user_scope_scope_id");
 10519
 10520                    b.Navigation("Scope");
 20521                });
 522
 10523            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.PasswordResetToken", b =>
 10524                {
 10525                    b.HasOne("ArturRios.Heimdall.Domain.Entities.Person", "Person")
 10526                        .WithMany("PasswordResetTokens")
 10527                        .HasForeignKey("PersonId")
 10528                        .OnDelete(DeleteBehavior.Cascade)
 10529                        .IsRequired()
 10530                        .HasConstraintName("fk_password_reset_token_person_person_id");
 10531
 10532                    b.Navigation("Person");
 20533                });
 534
 10535            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.Person", b =>
 10536                {
 10537                    b.HasOne("ArturRios.Heimdall.Domain.Entities.Role", "Role")
 10538                        .WithMany("Persons")
 10539                        .HasForeignKey("RoleId")
 10540                        .OnDelete(DeleteBehavior.Restrict)
 10541                        .IsRequired()
 10542                        .HasConstraintName("fk_person_roles_role_id");
 10543
 10544                    b.Navigation("Role");
 20545                });
 546
 10547            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.ScopeOwner", b =>
 10548                {
 10549                    b.HasOne("ArturRios.Heimdall.Domain.Entities.Person", "Person")
 10550                        .WithMany("ScopeOwnerships")
 10551                        .HasForeignKey("PersonId")
 10552                        .OnDelete(DeleteBehavior.Cascade)
 10553                        .IsRequired()
 10554                        .HasConstraintName("fk_scope_owner_person_person_id");
 10555
 10556                    b.HasOne("ArturRios.Heimdall.Domain.Entities.Scope", "Scope")
 10557                        .WithMany("Owners")
 10558                        .HasForeignKey("ScopeId")
 10559                        .OnDelete(DeleteBehavior.Cascade)
 10560                        .IsRequired()
 10561                        .HasConstraintName("fk_scope_owner_scope_scope_id");
 10562
 10563                    b.Navigation("Person");
 10564
 10565                    b.Navigation("Scope");
 20566                });
 567
 10568            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.ScopeUser", b =>
 10569                {
 10570                    b.HasOne("ArturRios.Heimdall.Domain.Entities.Person", "Person")
 10571                        .WithOne("ScopeMembership")
 10572                        .HasForeignKey("ArturRios.Heimdall.Domain.Entities.ScopeUser", "PersonId")
 10573                        .OnDelete(DeleteBehavior.Cascade)
 10574                        .IsRequired()
 10575                        .HasConstraintName("fk_scope_user_person_person_id");
 10576
 10577                    b.HasOne("ArturRios.Heimdall.Domain.Entities.Scope", "Scope")
 10578                        .WithMany("Users")
 10579                        .HasForeignKey("ScopeId")
 10580                        .OnDelete(DeleteBehavior.Cascade)
 10581                        .IsRequired()
 10582                        .HasConstraintName("fk_scope_user_scope_scope_id");
 10583
 10584                    b.Navigation("Person");
 10585
 10586                    b.Navigation("Scope");
 20587                });
 588
 10589            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.Person", b =>
 10590                {
 10591                    b.Navigation("EmailVerificationTokens");
 10592
 10593                    b.Navigation("OwnedApplications");
 10594
 10595                    b.Navigation("PasswordResetTokens");
 10596
 10597                    b.Navigation("ScopeMembership");
 10598
 10599                    b.Navigation("ScopeOwnerships");
 20600                });
 601
 10602            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.Role", b =>
 10603                {
 10604                    b.Navigation("Persons");
 20605                });
 606
 10607            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.Scope", b =>
 10608                {
 10609                    b.Navigation("Applications");
 10610
 10611                    b.Navigation("GoogleUsers");
 10612
 10613                    b.Navigation("Owners");
 10614
 10615                    b.Navigation("Users");
 20616                });
 617#pragma warning restore 612, 618
 10618        }
 619    }
 620}