< Summary - Heimdall API

Line coverage
97%
Covered lines: 908
Uncovered lines: 28
Coverable lines: 936
Total lines: 1036
Line coverage: 97%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
66%
Covered methods: 2
Fully covered methods: 2
Total methods: 3
Method coverage: 66.6%
Full method coverage: 66.6%

Metrics

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

File(s)

/home/runner/work/heimdall-api/heimdall-api/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        {
 415            migrationBuilder.EnsureSchema(
 416                name: "heimdall");
 17
 418            migrationBuilder.CreateTable(
 419                name: "role",
 420                schema: "heimdall",
 421                columns: table => new
 422                {
 423                    id = table.Column<long>(type: "bigint", nullable: false),
 424                    public_id = table.Column<Guid>(type: "uuid", nullable: false),
 425                    name = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: false),
 426                    description = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: true)
 427                },
 428                constraints: table =>
 429                {
 430                    table.PrimaryKey("pk_role", x => x.id);
 831                });
 32
 433            migrationBuilder.CreateTable(
 434                name: "scope",
 435                schema: "heimdall",
 436                columns: table => new
 437                {
 438                    id = table.Column<long>(type: "bigint", nullable: false)
 439                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultCol
 440                    public_id = table.Column<Guid>(type: "uuid", nullable: false),
 441                    name = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: false),
 442                    description = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: true),
 443                    is_deleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
 444                    google_sign_in_enabled = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
 445                    created_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, defaultValueS
 446                    updated_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, defaultValueS
 447                },
 448                constraints: table =>
 449                {
 450                    table.PrimaryKey("pk_scope", x => x.id);
 851                });
 52
 453            migrationBuilder.CreateTable(
 454                name: "person",
 455                schema: "heimdall",
 456                columns: table => new
 457                {
 458                    id = table.Column<long>(type: "bigint", nullable: false)
 459                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultCol
 460                    public_id = table.Column<Guid>(type: "uuid", nullable: false),
 461                    name = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: false),
 462                    email = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
 463                    password_hash = table.Column<byte[]>(type: "bytea", nullable: false),
 464                    salt = table.Column<byte[]>(type: "bytea", nullable: false),
 465                    is_deleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
 466                    email_verified = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
 467                    role_id = table.Column<long>(type: "bigint", nullable: false),
 468                    created_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, defaultValueS
 469                    updated_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, defaultValueS
 470                },
 471                constraints: table =>
 472                {
 473                    table.PrimaryKey("pk_person", x => x.id);
 474                    table.ForeignKey(
 475                        name: "fk_person_roles_role_id",
 476                        column: x => x.role_id,
 477                        principalSchema: "heimdall",
 478                        principalTable: "role",
 479                        principalColumn: "id",
 480                        onDelete: ReferentialAction.Restrict);
 881                });
 82
 483            migrationBuilder.CreateTable(
 484                name: "google_user",
 485                schema: "heimdall",
 486                columns: table => new
 487                {
 488                    id = table.Column<long>(type: "bigint", nullable: false)
 489                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultCol
 490                    public_id = table.Column<Guid>(type: "uuid", nullable: false),
 491                    google_id = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),
 492                    name = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: false),
 493                    email = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
 494                    email_verified = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
 495                    profile_picture_url = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullabl
 496                    is_deleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
 497                    scope_id = table.Column<long>(type: "bigint", nullable: false),
 498                    created_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, defaultValueS
 499                    updated_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, defaultValueS
 4100                },
 4101                constraints: table =>
 4102                {
 4103                    table.PrimaryKey("pk_google_user", x => x.id);
 4104                    table.ForeignKey(
 4105                        name: "fk_google_user_scope_scope_id",
 4106                        column: x => x.scope_id,
 4107                        principalSchema: "heimdall",
 4108                        principalTable: "scope",
 4109                        principalColumn: "id",
 4110                        onDelete: ReferentialAction.Cascade);
 8111                });
 112
 4113            migrationBuilder.CreateTable(
 4114                name: "application",
 4115                schema: "heimdall",
 4116                columns: table => new
 4117                {
 4118                    id = table.Column<long>(type: "bigint", nullable: false)
 4119                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultCol
 4120                    public_id = table.Column<Guid>(type: "uuid", nullable: false),
 4121                    name = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: false),
 4122                    is_deleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
 4123                    scope_id = table.Column<long>(type: "bigint", nullable: false),
 4124                    owner_id = table.Column<long>(type: "bigint", nullable: false),
 4125                    created_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, defaultValueS
 4126                    updated_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, defaultValueS
 4127                },
 4128                constraints: table =>
 4129                {
 4130                    table.PrimaryKey("pk_application", x => x.id);
 4131                    table.ForeignKey(
 4132                        name: "fk_application_person_owner_id",
 4133                        column: x => x.owner_id,
 4134                        principalSchema: "heimdall",
 4135                        principalTable: "person",
 4136                        principalColumn: "id",
 4137                        onDelete: ReferentialAction.Cascade);
 4138                    table.ForeignKey(
 4139                        name: "fk_application_scope_scope_id",
 4140                        column: x => x.scope_id,
 4141                        principalSchema: "heimdall",
 4142                        principalTable: "scope",
 4143                        principalColumn: "id",
 4144                        onDelete: ReferentialAction.Cascade);
 8145                });
 146
 4147            migrationBuilder.CreateTable(
 4148                name: "email_verification_token",
 4149                schema: "heimdall",
 4150                columns: table => new
 4151                {
 4152                    id = table.Column<long>(type: "bigint", nullable: false)
 4153                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultCol
 4154                    person_id = table.Column<long>(type: "bigint", nullable: false),
 4155                    token = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
 4156                    expires_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
 4157                    used = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false)
 4158                },
 4159                constraints: table =>
 4160                {
 4161                    table.PrimaryKey("pk_email_verification_token", x => x.id);
 4162                    table.ForeignKey(
 4163                        name: "fk_email_verification_token_person_person_id",
 4164                        column: x => x.person_id,
 4165                        principalSchema: "heimdall",
 4166                        principalTable: "person",
 4167                        principalColumn: "id",
 4168                        onDelete: ReferentialAction.Cascade);
 8169                });
 170
 4171            migrationBuilder.CreateTable(
 4172                name: "password_reset_token",
 4173                schema: "heimdall",
 4174                columns: table => new
 4175                {
 4176                    id = table.Column<long>(type: "bigint", nullable: false)
 4177                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultCol
 4178                    person_id = table.Column<long>(type: "bigint", nullable: false),
 4179                    token = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
 4180                    expires_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
 4181                    used = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false)
 4182                },
 4183                constraints: table =>
 4184                {
 4185                    table.PrimaryKey("pk_password_reset_token", x => x.id);
 4186                    table.ForeignKey(
 4187                        name: "fk_password_reset_token_person_person_id",
 4188                        column: x => x.person_id,
 4189                        principalSchema: "heimdall",
 4190                        principalTable: "person",
 4191                        principalColumn: "id",
 4192                        onDelete: ReferentialAction.Cascade);
 8193                });
 194
 4195            migrationBuilder.CreateTable(
 4196                name: "scope_owner",
 4197                schema: "heimdall",
 4198                columns: table => new
 4199                {
 4200                    scope_id = table.Column<long>(type: "bigint", nullable: false),
 4201                    person_id = table.Column<long>(type: "bigint", nullable: false)
 4202                },
 4203                constraints: table =>
 4204                {
 4205                    table.PrimaryKey("pk_scope_owner", x => new { x.scope_id, x.person_id });
 4206                    table.ForeignKey(
 4207                        name: "fk_scope_owner_person_person_id",
 4208                        column: x => x.person_id,
 4209                        principalSchema: "heimdall",
 4210                        principalTable: "person",
 4211                        principalColumn: "id",
 4212                        onDelete: ReferentialAction.Cascade);
 4213                    table.ForeignKey(
 4214                        name: "fk_scope_owner_scope_scope_id",
 4215                        column: x => x.scope_id,
 4216                        principalSchema: "heimdall",
 4217                        principalTable: "scope",
 4218                        principalColumn: "id",
 4219                        onDelete: ReferentialAction.Cascade);
 8220                });
 221
 4222            migrationBuilder.CreateTable(
 4223                name: "scope_user",
 4224                schema: "heimdall",
 4225                columns: table => new
 4226                {
 4227                    scope_id = table.Column<long>(type: "bigint", nullable: false),
 4228                    person_id = table.Column<long>(type: "bigint", nullable: false)
 4229                },
 4230                constraints: table =>
 4231                {
 4232                    table.PrimaryKey("pk_scope_user", x => new { x.scope_id, x.person_id });
 4233                    table.ForeignKey(
 4234                        name: "fk_scope_user_person_person_id",
 4235                        column: x => x.person_id,
 4236                        principalSchema: "heimdall",
 4237                        principalTable: "person",
 4238                        principalColumn: "id",
 4239                        onDelete: ReferentialAction.Cascade);
 4240                    table.ForeignKey(
 4241                        name: "fk_scope_user_scope_scope_id",
 4242                        column: x => x.scope_id,
 4243                        principalSchema: "heimdall",
 4244                        principalTable: "scope",
 4245                        principalColumn: "id",
 4246                        onDelete: ReferentialAction.Cascade);
 8247                });
 248
 4249            migrationBuilder.CreateIndex(
 4250                name: "ix_application_owner_id",
 4251                schema: "heimdall",
 4252                table: "application",
 4253                column: "owner_id");
 254
 4255            migrationBuilder.CreateIndex(
 4256                name: "ix_application_public_id",
 4257                schema: "heimdall",
 4258                table: "application",
 4259                column: "public_id",
 4260                unique: true);
 261
 4262            migrationBuilder.CreateIndex(
 4263                name: "ix_application_scope_id",
 4264                schema: "heimdall",
 4265                table: "application",
 4266                column: "scope_id");
 267
 4268            migrationBuilder.CreateIndex(
 4269                name: "ix_email_verification_token_person_id",
 4270                schema: "heimdall",
 4271                table: "email_verification_token",
 4272                column: "person_id");
 273
 4274            migrationBuilder.CreateIndex(
 4275                name: "ix_email_verification_token_token",
 4276                schema: "heimdall",
 4277                table: "email_verification_token",
 4278                column: "token",
 4279                unique: true);
 280
 4281            migrationBuilder.CreateIndex(
 4282                name: "ix_google_user_public_id",
 4283                schema: "heimdall",
 4284                table: "google_user",
 4285                column: "public_id",
 4286                unique: true);
 287
 4288            migrationBuilder.CreateIndex(
 4289                name: "ix_google_user_scope_id_email",
 4290                schema: "heimdall",
 4291                table: "google_user",
 4292                columns: new[] { "scope_id", "email" },
 4293                unique: true);
 294
 4295            migrationBuilder.CreateIndex(
 4296                name: "ix_google_user_scope_id_google_id",
 4297                schema: "heimdall",
 4298                table: "google_user",
 4299                columns: new[] { "scope_id", "google_id" },
 4300                unique: true);
 301
 4302            migrationBuilder.CreateIndex(
 4303                name: "ix_password_reset_token_person_id",
 4304                schema: "heimdall",
 4305                table: "password_reset_token",
 4306                column: "person_id");
 307
 4308            migrationBuilder.CreateIndex(
 4309                name: "ix_password_reset_token_token",
 4310                schema: "heimdall",
 4311                table: "password_reset_token",
 4312                column: "token",
 4313                unique: true);
 314
 4315            migrationBuilder.CreateIndex(
 4316                name: "ix_person_email",
 4317                schema: "heimdall",
 4318                table: "person",
 4319                column: "email");
 320
 4321            migrationBuilder.CreateIndex(
 4322                name: "ix_person_public_id",
 4323                schema: "heimdall",
 4324                table: "person",
 4325                column: "public_id",
 4326                unique: true);
 327
 4328            migrationBuilder.CreateIndex(
 4329                name: "ix_person_role_id",
 4330                schema: "heimdall",
 4331                table: "person",
 4332                column: "role_id");
 333
 4334            migrationBuilder.CreateIndex(
 4335                name: "ix_role_name",
 4336                schema: "heimdall",
 4337                table: "role",
 4338                column: "name",
 4339                unique: true);
 340
 4341            migrationBuilder.CreateIndex(
 4342                name: "ix_role_public_id",
 4343                schema: "heimdall",
 4344                table: "role",
 4345                column: "public_id",
 4346                unique: true);
 347
 4348            migrationBuilder.CreateIndex(
 4349                name: "ix_scope_name",
 4350                schema: "heimdall",
 4351                table: "scope",
 4352                column: "name",
 4353                unique: true);
 354
 4355            migrationBuilder.CreateIndex(
 4356                name: "ix_scope_public_id",
 4357                schema: "heimdall",
 4358                table: "scope",
 4359                column: "public_id",
 4360                unique: true);
 361
 4362            migrationBuilder.CreateIndex(
 4363                name: "ix_scope_owner_person_id",
 4364                schema: "heimdall",
 4365                table: "scope_owner",
 4366                column: "person_id");
 367
 4368            migrationBuilder.CreateIndex(
 4369                name: "ix_scope_user_person_id",
 4370                schema: "heimdall",
 4371                table: "scope_user",
 4372                column: "person_id",
 4373                unique: true);
 4374        }
 375
 376        /// <inheritdoc />
 377        protected override void Down(MigrationBuilder migrationBuilder)
 378        {
 0379            migrationBuilder.DropTable(
 0380                name: "application",
 0381                schema: "heimdall");
 382
 0383            migrationBuilder.DropTable(
 0384                name: "email_verification_token",
 0385                schema: "heimdall");
 386
 0387            migrationBuilder.DropTable(
 0388                name: "google_user",
 0389                schema: "heimdall");
 390
 0391            migrationBuilder.DropTable(
 0392                name: "password_reset_token",
 0393                schema: "heimdall");
 394
 0395            migrationBuilder.DropTable(
 0396                name: "scope_owner",
 0397                schema: "heimdall");
 398
 0399            migrationBuilder.DropTable(
 0400                name: "scope_user",
 0401                schema: "heimdall");
 402
 0403            migrationBuilder.DropTable(
 0404                name: "person",
 0405                schema: "heimdall");
 406
 0407            migrationBuilder.DropTable(
 0408                name: "scope",
 0409                schema: "heimdall");
 410
 0411            migrationBuilder.DropTable(
 0412                name: "role",
 0413                schema: "heimdall");
 0414        }
 415    }
 416}

/home/runner/work/heimdall-api/heimdall-api/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
 222            modelBuilder
 223                .HasDefaultSchema("heimdall")
 224                .HasAnnotation("ProductVersion", "10.0.10")
 225                .HasAnnotation("Relational:MaxIdentifierLength", 63);
 26
 227            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
 28
 229            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.Application", b =>
 230                {
 231                    b.Property<long>("Id")
 232                        .ValueGeneratedOnAdd()
 233                        .HasColumnType("bigint")
 234                        .HasColumnName("id")
 235                        .HasColumnOrder(1);
 236
 237                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
 238
 239                    b.Property<DateTime>("CreatedAt")
 240                        .ValueGeneratedOnAdd()
 241                        .HasColumnType("timestamp with time zone")
 242                        .HasColumnName("created_at")
 243                        .HasDefaultValueSql("now()");
 244
 245                    b.Property<bool>("IsDeleted")
 246                        .ValueGeneratedOnAdd()
 247                        .HasColumnType("boolean")
 248                        .HasDefaultValue(false)
 249                        .HasColumnName("is_deleted");
 250
 251                    b.Property<string>("Name")
 252                        .IsRequired()
 253                        .HasMaxLength(200)
 254                        .HasColumnType("character varying(200)")
 255                        .HasColumnName("name");
 256
 257                    b.Property<long>("OwnerId")
 258                        .HasColumnType("bigint")
 259                        .HasColumnName("owner_id");
 260
 261                    b.Property<Guid>("PublicId")
 262                        .HasColumnType("uuid")
 263                        .HasColumnName("public_id");
 264
 265                    b.Property<long>("ScopeId")
 266                        .HasColumnType("bigint")
 267                        .HasColumnName("scope_id");
 268
 269                    b.Property<DateTime>("UpdatedAt")
 270                        .ValueGeneratedOnAdd()
 271                        .HasColumnType("timestamp with time zone")
 272                        .HasColumnName("updated_at")
 273                        .HasDefaultValueSql("now()");
 274
 275                    b.HasKey("Id")
 276                        .HasName("pk_application");
 277
 278                    b.HasIndex("OwnerId")
 279                        .HasDatabaseName("ix_application_owner_id");
 280
 281                    b.HasIndex("PublicId")
 282                        .IsUnique()
 283                        .HasDatabaseName("ix_application_public_id");
 284
 285                    b.HasIndex("ScopeId")
 286                        .HasDatabaseName("ix_application_scope_id");
 287
 288                    b.ToTable("application", "heimdall");
 489                });
 90
 291            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.EmailVerificationToken", b =>
 292                {
 293                    b.Property<long>("Id")
 294                        .ValueGeneratedOnAdd()
 295                        .HasColumnType("bigint")
 296                        .HasColumnName("id")
 297                        .HasColumnOrder(1);
 298
 299                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
 2100
 2101                    b.Property<DateTime>("ExpiresAt")
 2102                        .HasColumnType("timestamp with time zone")
 2103                        .HasColumnName("expires_at");
 2104
 2105                    b.Property<long>("PersonId")
 2106                        .HasColumnType("bigint")
 2107                        .HasColumnName("person_id");
 2108
 2109                    b.Property<string>("Token")
 2110                        .IsRequired()
 2111                        .HasMaxLength(256)
 2112                        .HasColumnType("character varying(256)")
 2113                        .HasColumnName("token");
 2114
 2115                    b.Property<bool>("Used")
 2116                        .ValueGeneratedOnAdd()
 2117                        .HasColumnType("boolean")
 2118                        .HasDefaultValue(false)
 2119                        .HasColumnName("used");
 2120
 2121                    b.HasKey("Id")
 2122                        .HasName("pk_email_verification_token");
 2123
 2124                    b.HasIndex("PersonId")
 2125                        .HasDatabaseName("ix_email_verification_token_person_id");
 2126
 2127                    b.HasIndex("Token")
 2128                        .IsUnique()
 2129                        .HasDatabaseName("ix_email_verification_token_token");
 2130
 2131                    b.ToTable("email_verification_token", "heimdall");
 4132                });
 133
 2134            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.GoogleUser", b =>
 2135                {
 2136                    b.Property<long>("Id")
 2137                        .ValueGeneratedOnAdd()
 2138                        .HasColumnType("bigint")
 2139                        .HasColumnName("id")
 2140                        .HasColumnOrder(1);
 2141
 2142                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
 2143
 2144                    b.Property<DateTime>("CreatedAt")
 2145                        .ValueGeneratedOnAdd()
 2146                        .HasColumnType("timestamp with time zone")
 2147                        .HasColumnName("created_at")
 2148                        .HasDefaultValueSql("now()");
 2149
 2150                    b.Property<string>("Email")
 2151                        .IsRequired()
 2152                        .HasMaxLength(256)
 2153                        .HasColumnType("character varying(256)")
 2154                        .HasColumnName("email");
 2155
 2156                    b.Property<bool>("EmailVerified")
 2157                        .ValueGeneratedOnAdd()
 2158                        .HasColumnType("boolean")
 2159                        .HasDefaultValue(false)
 2160                        .HasColumnName("email_verified");
 2161
 2162                    b.Property<string>("GoogleId")
 2163                        .IsRequired()
 2164                        .HasMaxLength(255)
 2165                        .HasColumnType("character varying(255)")
 2166                        .HasColumnName("google_id");
 2167
 2168                    b.Property<bool>("IsDeleted")
 2169                        .ValueGeneratedOnAdd()
 2170                        .HasColumnType("boolean")
 2171                        .HasDefaultValue(false)
 2172                        .HasColumnName("is_deleted");
 2173
 2174                    b.Property<string>("Name")
 2175                        .IsRequired()
 2176                        .HasMaxLength(200)
 2177                        .HasColumnType("character varying(200)")
 2178                        .HasColumnName("name");
 2179
 2180                    b.Property<string>("ProfilePictureUrl")
 2181                        .HasMaxLength(2048)
 2182                        .HasColumnType("character varying(2048)")
 2183                        .HasColumnName("profile_picture_url");
 2184
 2185                    b.Property<Guid>("PublicId")
 2186                        .HasColumnType("uuid")
 2187                        .HasColumnName("public_id");
 2188
 2189                    b.Property<long>("ScopeId")
 2190                        .HasColumnType("bigint")
 2191                        .HasColumnName("scope_id");
 2192
 2193                    b.Property<DateTime>("UpdatedAt")
 2194                        .ValueGeneratedOnAdd()
 2195                        .HasColumnType("timestamp with time zone")
 2196                        .HasColumnName("updated_at")
 2197                        .HasDefaultValueSql("now()");
 2198
 2199                    b.HasKey("Id")
 2200                        .HasName("pk_google_user");
 2201
 2202                    b.HasIndex("PublicId")
 2203                        .IsUnique()
 2204                        .HasDatabaseName("ix_google_user_public_id");
 2205
 2206                    b.HasIndex("ScopeId", "Email")
 2207                        .IsUnique()
 2208                        .HasDatabaseName("ix_google_user_scope_id_email");
 2209
 2210                    b.HasIndex("ScopeId", "GoogleId")
 2211                        .IsUnique()
 2212                        .HasDatabaseName("ix_google_user_scope_id_google_id");
 2213
 2214                    b.ToTable("google_user", "heimdall");
 4215                });
 216
 2217            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.PasswordResetToken", b =>
 2218                {
 2219                    b.Property<long>("Id")
 2220                        .ValueGeneratedOnAdd()
 2221                        .HasColumnType("bigint")
 2222                        .HasColumnName("id")
 2223                        .HasColumnOrder(1);
 2224
 2225                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
 2226
 2227                    b.Property<DateTime>("ExpiresAt")
 2228                        .HasColumnType("timestamp with time zone")
 2229                        .HasColumnName("expires_at");
 2230
 2231                    b.Property<long>("PersonId")
 2232                        .HasColumnType("bigint")
 2233                        .HasColumnName("person_id");
 2234
 2235                    b.Property<string>("Token")
 2236                        .IsRequired()
 2237                        .HasMaxLength(256)
 2238                        .HasColumnType("character varying(256)")
 2239                        .HasColumnName("token");
 2240
 2241                    b.Property<bool>("Used")
 2242                        .ValueGeneratedOnAdd()
 2243                        .HasColumnType("boolean")
 2244                        .HasDefaultValue(false)
 2245                        .HasColumnName("used");
 2246
 2247                    b.HasKey("Id")
 2248                        .HasName("pk_password_reset_token");
 2249
 2250                    b.HasIndex("PersonId")
 2251                        .HasDatabaseName("ix_password_reset_token_person_id");
 2252
 2253                    b.HasIndex("Token")
 2254                        .IsUnique()
 2255                        .HasDatabaseName("ix_password_reset_token_token");
 2256
 2257                    b.ToTable("password_reset_token", "heimdall");
 4258                });
 259
 2260            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.Person", b =>
 2261                {
 2262                    b.Property<long>("Id")
 2263                        .ValueGeneratedOnAdd()
 2264                        .HasColumnType("bigint")
 2265                        .HasColumnName("id")
 2266                        .HasColumnOrder(1);
 2267
 2268                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
 2269
 2270                    b.Property<DateTime>("CreatedAt")
 2271                        .ValueGeneratedOnAdd()
 2272                        .HasColumnType("timestamp with time zone")
 2273                        .HasColumnName("created_at")
 2274                        .HasDefaultValueSql("now()");
 2275
 2276                    b.Property<string>("Email")
 2277                        .IsRequired()
 2278                        .HasMaxLength(256)
 2279                        .HasColumnType("character varying(256)")
 2280                        .HasColumnName("email");
 2281
 2282                    b.Property<bool>("EmailVerified")
 2283                        .ValueGeneratedOnAdd()
 2284                        .HasColumnType("boolean")
 2285                        .HasDefaultValue(false)
 2286                        .HasColumnName("email_verified");
 2287
 2288                    b.Property<bool>("IsDeleted")
 2289                        .ValueGeneratedOnAdd()
 2290                        .HasColumnType("boolean")
 2291                        .HasDefaultValue(false)
 2292                        .HasColumnName("is_deleted");
 2293
 2294                    b.Property<string>("Name")
 2295                        .IsRequired()
 2296                        .HasMaxLength(200)
 2297                        .HasColumnType("character varying(200)")
 2298                        .HasColumnName("name");
 2299
 2300                    b.Property<byte[]>("PasswordHash")
 2301                        .IsRequired()
 2302                        .HasColumnType("bytea")
 2303                        .HasColumnName("password_hash");
 2304
 2305                    b.Property<Guid>("PublicId")
 2306                        .HasColumnType("uuid")
 2307                        .HasColumnName("public_id");
 2308
 2309                    b.Property<long>("RoleId")
 2310                        .HasColumnType("bigint")
 2311                        .HasColumnName("role_id");
 2312
 2313                    b.Property<byte[]>("Salt")
 2314                        .IsRequired()
 2315                        .HasColumnType("bytea")
 2316                        .HasColumnName("salt");
 2317
 2318                    b.Property<DateTime>("UpdatedAt")
 2319                        .ValueGeneratedOnAdd()
 2320                        .HasColumnType("timestamp with time zone")
 2321                        .HasColumnName("updated_at")
 2322                        .HasDefaultValueSql("now()");
 2323
 2324                    b.HasKey("Id")
 2325                        .HasName("pk_person");
 2326
 2327                    b.HasIndex("Email")
 2328                        .HasDatabaseName("ix_person_email");
 2329
 2330                    b.HasIndex("PublicId")
 2331                        .IsUnique()
 2332                        .HasDatabaseName("ix_person_public_id");
 2333
 2334                    b.HasIndex("RoleId")
 2335                        .HasDatabaseName("ix_person_role_id");
 2336
 2337                    b.ToTable("person", "heimdall");
 4338                });
 339
 2340            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.Role", b =>
 2341                {
 2342                    b.Property<long>("Id")
 2343                        .HasColumnType("bigint")
 2344                        .HasColumnName("id")
 2345                        .HasColumnOrder(1);
 2346
 2347                    b.Property<string>("Description")
 2348                        .HasMaxLength(500)
 2349                        .HasColumnType("character varying(500)")
 2350                        .HasColumnName("description");
 2351
 2352                    b.Property<string>("Name")
 2353                        .IsRequired()
 2354                        .HasMaxLength(200)
 2355                        .HasColumnType("character varying(200)")
 2356                        .HasColumnName("name");
 2357
 2358                    b.Property<Guid>("PublicId")
 2359                        .HasColumnType("uuid")
 2360                        .HasColumnName("public_id");
 2361
 2362                    b.HasKey("Id")
 2363                        .HasName("pk_role");
 2364
 2365                    b.HasIndex("Name")
 2366                        .IsUnique()
 2367                        .HasDatabaseName("ix_role_name");
 2368
 2369                    b.HasIndex("PublicId")
 2370                        .IsUnique()
 2371                        .HasDatabaseName("ix_role_public_id");
 2372
 2373                    b.ToTable("role", "heimdall");
 4374                });
 375
 2376            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.Scope", b =>
 2377                {
 2378                    b.Property<long>("Id")
 2379                        .ValueGeneratedOnAdd()
 2380                        .HasColumnType("bigint")
 2381                        .HasColumnName("id")
 2382                        .HasColumnOrder(1);
 2383
 2384                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
 2385
 2386                    b.Property<DateTime>("CreatedAt")
 2387                        .ValueGeneratedOnAdd()
 2388                        .HasColumnType("timestamp with time zone")
 2389                        .HasColumnName("created_at")
 2390                        .HasDefaultValueSql("now()");
 2391
 2392                    b.Property<string>("Description")
 2393                        .HasMaxLength(500)
 2394                        .HasColumnType("character varying(500)")
 2395                        .HasColumnName("description");
 2396
 2397                    b.Property<bool>("GoogleSignInEnabled")
 2398                        .ValueGeneratedOnAdd()
 2399                        .HasColumnType("boolean")
 2400                        .HasDefaultValue(false)
 2401                        .HasColumnName("google_sign_in_enabled");
 2402
 2403                    b.Property<bool>("IsDeleted")
 2404                        .ValueGeneratedOnAdd()
 2405                        .HasColumnType("boolean")
 2406                        .HasDefaultValue(false)
 2407                        .HasColumnName("is_deleted");
 2408
 2409                    b.Property<string>("Name")
 2410                        .IsRequired()
 2411                        .HasMaxLength(200)
 2412                        .HasColumnType("character varying(200)")
 2413                        .HasColumnName("name");
 2414
 2415                    b.Property<Guid>("PublicId")
 2416                        .HasColumnType("uuid")
 2417                        .HasColumnName("public_id");
 2418
 2419                    b.Property<DateTime>("UpdatedAt")
 2420                        .ValueGeneratedOnAdd()
 2421                        .HasColumnType("timestamp with time zone")
 2422                        .HasColumnName("updated_at")
 2423                        .HasDefaultValueSql("now()");
 2424
 2425                    b.HasKey("Id")
 2426                        .HasName("pk_scope");
 2427
 2428                    b.HasIndex("Name")
 2429                        .IsUnique()
 2430                        .HasDatabaseName("ix_scope_name");
 2431
 2432                    b.HasIndex("PublicId")
 2433                        .IsUnique()
 2434                        .HasDatabaseName("ix_scope_public_id");
 2435
 2436                    b.ToTable("scope", "heimdall");
 4437                });
 438
 2439            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.ScopeOwner", b =>
 2440                {
 2441                    b.Property<long>("ScopeId")
 2442                        .HasColumnType("bigint")
 2443                        .HasColumnName("scope_id");
 2444
 2445                    b.Property<long>("PersonId")
 2446                        .HasColumnType("bigint")
 2447                        .HasColumnName("person_id");
 2448
 2449                    b.HasKey("ScopeId", "PersonId")
 2450                        .HasName("pk_scope_owner");
 2451
 2452                    b.HasIndex("PersonId")
 2453                        .HasDatabaseName("ix_scope_owner_person_id");
 2454
 2455                    b.ToTable("scope_owner", "heimdall");
 4456                });
 457
 2458            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.ScopeUser", b =>
 2459                {
 2460                    b.Property<long>("ScopeId")
 2461                        .HasColumnType("bigint")
 2462                        .HasColumnName("scope_id");
 2463
 2464                    b.Property<long>("PersonId")
 2465                        .HasColumnType("bigint")
 2466                        .HasColumnName("person_id");
 2467
 2468                    b.HasKey("ScopeId", "PersonId")
 2469                        .HasName("pk_scope_user");
 2470
 2471                    b.HasIndex("PersonId")
 2472                        .IsUnique()
 2473                        .HasDatabaseName("ix_scope_user_person_id");
 2474
 2475                    b.ToTable("scope_user", "heimdall");
 4476                });
 477
 2478            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.Application", b =>
 2479                {
 2480                    b.HasOne("ArturRios.Heimdall.Domain.Entities.Person", "Owner")
 2481                        .WithMany("OwnedApplications")
 2482                        .HasForeignKey("OwnerId")
 2483                        .OnDelete(DeleteBehavior.Cascade)
 2484                        .IsRequired()
 2485                        .HasConstraintName("fk_application_person_owner_id");
 2486
 2487                    b.HasOne("ArturRios.Heimdall.Domain.Entities.Scope", "Scope")
 2488                        .WithMany("Applications")
 2489                        .HasForeignKey("ScopeId")
 2490                        .OnDelete(DeleteBehavior.Cascade)
 2491                        .IsRequired()
 2492                        .HasConstraintName("fk_application_scope_scope_id");
 2493
 2494                    b.Navigation("Owner");
 2495
 2496                    b.Navigation("Scope");
 4497                });
 498
 2499            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.EmailVerificationToken", b =>
 2500                {
 2501                    b.HasOne("ArturRios.Heimdall.Domain.Entities.Person", "Person")
 2502                        .WithMany("EmailVerificationTokens")
 2503                        .HasForeignKey("PersonId")
 2504                        .OnDelete(DeleteBehavior.Cascade)
 2505                        .IsRequired()
 2506                        .HasConstraintName("fk_email_verification_token_person_person_id");
 2507
 2508                    b.Navigation("Person");
 4509                });
 510
 2511            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.GoogleUser", b =>
 2512                {
 2513                    b.HasOne("ArturRios.Heimdall.Domain.Entities.Scope", "Scope")
 2514                        .WithMany("GoogleUsers")
 2515                        .HasForeignKey("ScopeId")
 2516                        .OnDelete(DeleteBehavior.Cascade)
 2517                        .IsRequired()
 2518                        .HasConstraintName("fk_google_user_scope_scope_id");
 2519
 2520                    b.Navigation("Scope");
 4521                });
 522
 2523            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.PasswordResetToken", b =>
 2524                {
 2525                    b.HasOne("ArturRios.Heimdall.Domain.Entities.Person", "Person")
 2526                        .WithMany("PasswordResetTokens")
 2527                        .HasForeignKey("PersonId")
 2528                        .OnDelete(DeleteBehavior.Cascade)
 2529                        .IsRequired()
 2530                        .HasConstraintName("fk_password_reset_token_person_person_id");
 2531
 2532                    b.Navigation("Person");
 4533                });
 534
 2535            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.Person", b =>
 2536                {
 2537                    b.HasOne("ArturRios.Heimdall.Domain.Entities.Role", "Role")
 2538                        .WithMany("Persons")
 2539                        .HasForeignKey("RoleId")
 2540                        .OnDelete(DeleteBehavior.Restrict)
 2541                        .IsRequired()
 2542                        .HasConstraintName("fk_person_roles_role_id");
 2543
 2544                    b.Navigation("Role");
 4545                });
 546
 2547            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.ScopeOwner", b =>
 2548                {
 2549                    b.HasOne("ArturRios.Heimdall.Domain.Entities.Person", "Person")
 2550                        .WithMany("ScopeOwnerships")
 2551                        .HasForeignKey("PersonId")
 2552                        .OnDelete(DeleteBehavior.Cascade)
 2553                        .IsRequired()
 2554                        .HasConstraintName("fk_scope_owner_person_person_id");
 2555
 2556                    b.HasOne("ArturRios.Heimdall.Domain.Entities.Scope", "Scope")
 2557                        .WithMany("Owners")
 2558                        .HasForeignKey("ScopeId")
 2559                        .OnDelete(DeleteBehavior.Cascade)
 2560                        .IsRequired()
 2561                        .HasConstraintName("fk_scope_owner_scope_scope_id");
 2562
 2563                    b.Navigation("Person");
 2564
 2565                    b.Navigation("Scope");
 4566                });
 567
 2568            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.ScopeUser", b =>
 2569                {
 2570                    b.HasOne("ArturRios.Heimdall.Domain.Entities.Person", "Person")
 2571                        .WithOne("ScopeMembership")
 2572                        .HasForeignKey("ArturRios.Heimdall.Domain.Entities.ScopeUser", "PersonId")
 2573                        .OnDelete(DeleteBehavior.Cascade)
 2574                        .IsRequired()
 2575                        .HasConstraintName("fk_scope_user_person_person_id");
 2576
 2577                    b.HasOne("ArturRios.Heimdall.Domain.Entities.Scope", "Scope")
 2578                        .WithMany("Users")
 2579                        .HasForeignKey("ScopeId")
 2580                        .OnDelete(DeleteBehavior.Cascade)
 2581                        .IsRequired()
 2582                        .HasConstraintName("fk_scope_user_scope_scope_id");
 2583
 2584                    b.Navigation("Person");
 2585
 2586                    b.Navigation("Scope");
 4587                });
 588
 2589            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.Person", b =>
 2590                {
 2591                    b.Navigation("EmailVerificationTokens");
 2592
 2593                    b.Navigation("OwnedApplications");
 2594
 2595                    b.Navigation("PasswordResetTokens");
 2596
 2597                    b.Navigation("ScopeMembership");
 2598
 2599                    b.Navigation("ScopeOwnerships");
 4600                });
 601
 2602            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.Role", b =>
 2603                {
 2604                    b.Navigation("Persons");
 4605                });
 606
 2607            modelBuilder.Entity("ArturRios.Heimdall.Domain.Entities.Scope", b =>
 2608                {
 2609                    b.Navigation("Applications");
 2610
 2611                    b.Navigation("GoogleUsers");
 2612
 2613                    b.Navigation("Owners");
 2614
 2615                    b.Navigation("Users");
 4616                });
 617#pragma warning restore 612, 618
 2618        }
 619    }
 620}