< Summary

Line coverage
96%
Covered lines: 202
Uncovered lines: 7
Coverable lines: 209
Total lines: 267
Line coverage: 96.6%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

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

File(s)

/home/runner/work/ClutterStock/ClutterStock/backend/src/Infrastructure/Database/Migrations/20260427212353_Init.cs

#LineLine coverage
 1using System;
 2using Microsoft.EntityFrameworkCore.Migrations;
 3using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
 4
 5#nullable disable
 6
 7namespace ClutterStock.Infrastructure.Migrations
 8{
 9    /// <inheritdoc />
 10    public partial class Init : Migration
 11    {
 12        /// <inheritdoc />
 13        protected override void Up(MigrationBuilder migrationBuilder)
 14        {
 1015            migrationBuilder.CreateTable(
 1016                name: "Location",
 1017                columns: table => new
 1018                {
 1019                    Id = table.Column<int>(type: "integer", nullable: false)
 1020                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultCol
 1021                    Name = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: false),
 1022                    Description = table.Column<string>(type: "character varying(2000)", maxLength: 2000, nullable: true)
 1023                    CreatedAtUtc = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
 1024                    UpdatedAtUtc = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true)
 1025                },
 1026                constraints: table =>
 1027                {
 1028                    table.PrimaryKey("PK_Location", x => x.Id);
 1029                });
 30
 1031            migrationBuilder.CreateTable(
 1032                name: "Room",
 1033                columns: table => new
 1034                {
 1035                    Id = table.Column<int>(type: "integer", nullable: false)
 1036                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultCol
 1037                    LocationId = table.Column<int>(type: "integer", nullable: false),
 1038                    Name = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: false),
 1039                    Description = table.Column<string>(type: "character varying(2000)", maxLength: 2000, nullable: true)
 1040                    CreatedAtUtc = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
 1041                    UpdatedAtUtc = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true)
 1042                },
 1043                constraints: table =>
 1044                {
 1045                    table.PrimaryKey("PK_Room", x => x.Id);
 1046                    table.ForeignKey(
 1047                        name: "FK_Room_Location_LocationId",
 1048                        column: x => x.LocationId,
 1049                        principalTable: "Location",
 1050                        principalColumn: "Id",
 1051                        onDelete: ReferentialAction.Cascade);
 1052                });
 53
 1054            migrationBuilder.CreateTable(
 1055                name: "Item",
 1056                columns: table => new
 1057                {
 1058                    Id = table.Column<int>(type: "integer", nullable: false)
 1059                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultCol
 1060                    RoomId = table.Column<int>(type: "integer", nullable: false),
 1061                    Name = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: false),
 1062                    Description = table.Column<string>(type: "character varying(2000)", maxLength: 2000, nullable: true)
 1063                    Category = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: true),
 1064                    Notes = table.Column<string>(type: "character varying(2000)", maxLength: 2000, nullable: true),
 1065                    CreatedAtUtc = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
 1066                    UpdatedAtUtc = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true)
 1067                },
 1068                constraints: table =>
 1069                {
 1070                    table.PrimaryKey("PK_Item", x => x.Id);
 1071                    table.ForeignKey(
 1072                        name: "FK_Item_Room_RoomId",
 1073                        column: x => x.RoomId,
 1074                        principalTable: "Room",
 1075                        principalColumn: "Id",
 1076                        onDelete: ReferentialAction.Cascade);
 1077                });
 78
 1079            migrationBuilder.CreateIndex(
 1080                name: "IX_Item_RoomId",
 1081                table: "Item",
 1082                column: "RoomId");
 83
 1084            migrationBuilder.CreateIndex(
 1085                name: "IX_Room_LocationId",
 1086                table: "Room",
 1087                column: "LocationId");
 1088        }
 89
 90        /// <inheritdoc />
 91        protected override void Down(MigrationBuilder migrationBuilder)
 92        {
 093            migrationBuilder.DropTable(
 094                name: "Item");
 95
 096            migrationBuilder.DropTable(
 097                name: "Room");
 98
 099            migrationBuilder.DropTable(
 0100                name: "Location");
 0101        }
 102    }
 103}

/home/runner/work/ClutterStock/ClutterStock/backend/src/Infrastructure/Database/Migrations/20260427212353_Init.Designer.cs

#LineLine coverage
 1// <auto-generated />
 2using System;
 3using ClutterStock.Infrastructure.Database;
 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 ClutterStock.Infrastructure.Migrations
 13{
 14    [DbContext(typeof(ApplicationContext))]
 15    [Migration("20260427212353_Init")]
 16    partial class Init
 17    {
 18        /// <inheritdoc />
 19        protected override void BuildTargetModel(ModelBuilder modelBuilder)
 20        {
 21#pragma warning disable 612, 618
 522            modelBuilder
 523                .HasAnnotation("ProductVersion", "10.0.7")
 524                .HasAnnotation("Relational:MaxIdentifierLength", 63);
 25
 526            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
 27
 528            modelBuilder.Entity("ClutterStock.Entities.Item", b =>
 529                {
 530                    b.Property<int>("Id")
 531                        .ValueGeneratedOnAdd()
 532                        .HasColumnType("integer");
 533
 534                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
 535
 536                    b.Property<string>("Category")
 537                        .HasMaxLength(100)
 538                        .HasColumnType("character varying(100)");
 539
 540                    b.Property<DateTimeOffset>("CreatedAtUtc")
 541                        .HasColumnType("timestamp with time zone");
 542
 543                    b.Property<string>("Description")
 544                        .HasMaxLength(2000)
 545                        .HasColumnType("character varying(2000)");
 546
 547                    b.Property<string>("Name")
 548                        .IsRequired()
 549                        .HasMaxLength(200)
 550                        .HasColumnType("character varying(200)");
 551
 552                    b.Property<string>("Notes")
 553                        .HasMaxLength(2000)
 554                        .HasColumnType("character varying(2000)");
 555
 556                    b.Property<int>("RoomId")
 557                        .HasColumnType("integer");
 558
 559                    b.Property<DateTimeOffset?>("UpdatedAtUtc")
 560                        .HasColumnType("timestamp with time zone");
 561
 562                    b.HasKey("Id");
 563
 564                    b.HasIndex("RoomId");
 565
 566                    b.ToTable("Item", (string)null);
 567                });
 68
 569            modelBuilder.Entity("ClutterStock.Entities.Location", b =>
 570                {
 571                    b.Property<int>("Id")
 572                        .ValueGeneratedOnAdd()
 573                        .HasColumnType("integer");
 574
 575                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
 576
 577                    b.Property<DateTimeOffset>("CreatedAtUtc")
 578                        .HasColumnType("timestamp with time zone");
 579
 580                    b.Property<string>("Description")
 581                        .HasMaxLength(2000)
 582                        .HasColumnType("character varying(2000)");
 583
 584                    b.Property<string>("Name")
 585                        .IsRequired()
 586                        .HasMaxLength(200)
 587                        .HasColumnType("character varying(200)");
 588
 589                    b.Property<DateTimeOffset?>("UpdatedAtUtc")
 590                        .HasColumnType("timestamp with time zone");
 591
 592                    b.HasKey("Id");
 593
 594                    b.ToTable("Location", (string)null);
 595                });
 96
 597            modelBuilder.Entity("ClutterStock.Entities.Room", b =>
 598                {
 599                    b.Property<int>("Id")
 5100                        .ValueGeneratedOnAdd()
 5101                        .HasColumnType("integer");
 5102
 5103                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
 5104
 5105                    b.Property<DateTimeOffset>("CreatedAtUtc")
 5106                        .HasColumnType("timestamp with time zone");
 5107
 5108                    b.Property<string>("Description")
 5109                        .HasMaxLength(2000)
 5110                        .HasColumnType("character varying(2000)");
 5111
 5112                    b.Property<int>("LocationId")
 5113                        .HasColumnType("integer");
 5114
 5115                    b.Property<string>("Name")
 5116                        .IsRequired()
 5117                        .HasMaxLength(200)
 5118                        .HasColumnType("character varying(200)");
 5119
 5120                    b.Property<DateTimeOffset?>("UpdatedAtUtc")
 5121                        .HasColumnType("timestamp with time zone");
 5122
 5123                    b.HasKey("Id");
 5124
 5125                    b.HasIndex("LocationId");
 5126
 5127                    b.ToTable("Room", (string)null);
 5128                });
 129
 5130            modelBuilder.Entity("ClutterStock.Entities.Item", b =>
 5131                {
 5132                    b.HasOne("ClutterStock.Entities.Room", "Room")
 5133                        .WithMany("Items")
 5134                        .HasForeignKey("RoomId")
 5135                        .OnDelete(DeleteBehavior.Cascade)
 5136                        .IsRequired();
 5137
 5138                    b.Navigation("Room");
 5139                });
 140
 5141            modelBuilder.Entity("ClutterStock.Entities.Room", b =>
 5142                {
 5143                    b.HasOne("ClutterStock.Entities.Location", "Location")
 5144                        .WithMany("Rooms")
 5145                        .HasForeignKey("LocationId")
 5146                        .OnDelete(DeleteBehavior.Cascade)
 5147                        .IsRequired();
 5148
 5149                    b.Navigation("Location");
 5150                });
 151
 5152            modelBuilder.Entity("ClutterStock.Entities.Location", b =>
 5153                {
 5154                    b.Navigation("Rooms");
 5155                });
 156
 5157            modelBuilder.Entity("ClutterStock.Entities.Room", b =>
 5158                {
 5159                    b.Navigation("Items");
 5160                });
 161#pragma warning restore 612, 618
 5162        }
 163    }
 164}