< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 172
Coverable lines: 172
Total lines: 223
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

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

File(s)

/home/runner/work/lifechart/lifechart/src/LifeChart.Infrastructure/Migrations/20260602221929_InitialCreate.cs

#LineLine coverage
 1using System;
 2using Microsoft.EntityFrameworkCore.Migrations;
 3
 4#nullable disable
 5
 6namespace LifeChart.Infrastructure.Migrations
 7{
 8    /// <inheritdoc />
 9    public partial class InitialCreate : Migration
 10    {
 11        /// <inheritdoc />
 12        protected override void Up(MigrationBuilder migrationBuilder)
 13        {
 014            migrationBuilder.CreateTable(
 015                name: "DailyEntries",
 016                columns: table => new
 017                {
 018                    Id = table.Column<int>(type: "INTEGER", nullable: false)
 019                        .Annotation("Sqlite:Autoincrement", true),
 020                    Date = table.Column<DateTime>(type: "TEXT", nullable: false),
 021                    Mood = table.Column<int>(type: "INTEGER", nullable: false),
 022                    Functionality = table.Column<int>(type: "INTEGER", nullable: false),
 023                    SleepHours = table.Column<int>(type: "INTEGER", nullable: false),
 024                    MedicationTaken = table.Column<bool>(type: "INTEGER", nullable: false),
 025                    MenstrualCycle = table.Column<bool>(type: "INTEGER", nullable: false),
 026                    Symptoms = table.Column<string>(type: "TEXT", maxLength: 1000, nullable: true),
 027                    Notes = table.Column<string>(type: "TEXT", maxLength: 2000, nullable: true)
 028                },
 029                constraints: table =>
 030                {
 031                    table.PrimaryKey("PK_DailyEntries", x => x.Id);
 032                });
 33
 034            migrationBuilder.CreateTable(
 035                name: "Medications",
 036                columns: table => new
 037                {
 038                    Id = table.Column<int>(type: "INTEGER", nullable: false)
 039                        .Annotation("Sqlite:Autoincrement", true),
 040                    Name = table.Column<string>(type: "TEXT", maxLength: 200, nullable: false),
 041                    Dosage = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
 042                    MinStock = table.Column<int>(type: "INTEGER", nullable: false),
 043                    CurrentStock = table.Column<int>(type: "INTEGER", nullable: false),
 044                    Active = table.Column<bool>(type: "INTEGER", nullable: false)
 045                },
 046                constraints: table =>
 047                {
 048                    table.PrimaryKey("PK_Medications", x => x.Id);
 049                });
 50
 051            migrationBuilder.CreateTable(
 052                name: "IntakeTime",
 053                columns: table => new
 054                {
 055                    Id = table.Column<int>(type: "INTEGER", nullable: false)
 056                        .Annotation("Sqlite:Autoincrement", true),
 057                    Time = table.Column<string>(type: "TEXT", nullable: false),
 058                    DoseCount = table.Column<int>(type: "INTEGER", nullable: false),
 059                    MedicationId = table.Column<int>(type: "INTEGER", nullable: false)
 060                },
 061                constraints: table =>
 062                {
 063                    table.PrimaryKey("PK_IntakeTime", x => x.Id);
 064                    table.ForeignKey(
 065                        name: "FK_IntakeTime_Medications_MedicationId",
 066                        column: x => x.MedicationId,
 067                        principalTable: "Medications",
 068                        principalColumn: "Id",
 069                        onDelete: ReferentialAction.Cascade);
 070                });
 71
 072            migrationBuilder.CreateIndex(
 073                name: "IX_DailyEntries_Date",
 074                table: "DailyEntries",
 075                column: "Date",
 076                unique: true);
 77
 078            migrationBuilder.CreateIndex(
 079                name: "IX_IntakeTime_MedicationId",
 080                table: "IntakeTime",
 081                column: "MedicationId");
 082        }
 83
 84        /// <inheritdoc />
 85        protected override void Down(MigrationBuilder migrationBuilder)
 86        {
 087            migrationBuilder.DropTable(
 088                name: "DailyEntries");
 89
 090            migrationBuilder.DropTable(
 091                name: "IntakeTime");
 92
 093            migrationBuilder.DropTable(
 094                name: "Medications");
 095        }
 96    }
 97}

/home/runner/work/lifechart/lifechart/src/LifeChart.Infrastructure/Migrations/20260602221929_InitialCreate.Designer.cs

#LineLine coverage
 1// <auto-generated />
 2using System;
 3using LifeChart.Infrastructure.Persistence;
 4using Microsoft.EntityFrameworkCore;
 5using Microsoft.EntityFrameworkCore.Infrastructure;
 6using Microsoft.EntityFrameworkCore.Migrations;
 7using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
 8
 9#nullable disable
 10
 11namespace LifeChart.Infrastructure.Migrations
 12{
 13    [DbContext(typeof(LifeChartDbContext))]
 14    [Migration("20260602221929_InitialCreate")]
 15    partial class InitialCreate
 16    {
 17        /// <inheritdoc />
 18        protected override void BuildTargetModel(ModelBuilder modelBuilder)
 19        {
 20#pragma warning disable 612, 618
 021            modelBuilder.HasAnnotation("ProductVersion", "10.0.8");
 22
 023            modelBuilder.Entity("LifeChart.Domain.Entries.DailyEntry", b =>
 024                {
 025                    b.Property<int>("Id")
 026                        .ValueGeneratedOnAdd()
 027                        .HasColumnType("INTEGER");
 028
 029                    b.Property<DateTime>("Date")
 030                        .HasColumnType("TEXT");
 031
 032                    b.Property<int>("Functionality")
 033                        .HasColumnType("INTEGER");
 034
 035                    b.Property<bool>("MedicationTaken")
 036                        .HasColumnType("INTEGER");
 037
 038                    b.Property<bool>("MenstrualCycle")
 039                        .HasColumnType("INTEGER");
 040
 041                    b.Property<int>("Mood")
 042                        .HasColumnType("INTEGER");
 043
 044                    b.Property<string>("Notes")
 045                        .HasMaxLength(2000)
 046                        .HasColumnType("TEXT");
 047
 048                    b.Property<int>("SleepHours")
 049                        .HasColumnType("INTEGER");
 050
 051                    b.Property<string>("Symptoms")
 052                        .HasMaxLength(1000)
 053                        .HasColumnType("TEXT");
 054
 055                    b.HasKey("Id");
 056
 057                    b.HasIndex("Date")
 058                        .IsUnique();
 059
 060                    b.ToTable("DailyEntries");
 061                });
 62
 063            modelBuilder.Entity("LifeChart.Domain.Medications.Medication", b =>
 064                {
 065                    b.Property<int>("Id")
 066                        .ValueGeneratedOnAdd()
 067                        .HasColumnType("INTEGER");
 068
 069                    b.Property<bool>("Active")
 070                        .HasColumnType("INTEGER");
 071
 072                    b.Property<int>("CurrentStock")
 073                        .HasColumnType("INTEGER");
 074
 075                    b.Property<string>("Dosage")
 076                        .IsRequired()
 077                        .HasMaxLength(100)
 078                        .HasColumnType("TEXT");
 079
 080                    b.Property<int>("MinStock")
 081                        .HasColumnType("INTEGER");
 082
 083                    b.Property<string>("Name")
 084                        .IsRequired()
 085                        .HasMaxLength(200)
 086                        .HasColumnType("TEXT");
 087
 088                    b.HasKey("Id");
 089
 090                    b.ToTable("Medications");
 091                });
 92
 093            modelBuilder.Entity("LifeChart.Domain.Medications.Medication", b =>
 094                {
 095                    b.OwnsMany("LifeChart.Domain.Medications.IntakeTime", "IntakeTimes", b1 =>
 096                        {
 097                            b1.Property<int>("Id")
 098                                .ValueGeneratedOnAdd()
 099                                .HasColumnType("INTEGER");
 0100
 0101                            b1.Property<int>("DoseCount")
 0102                                .HasColumnType("INTEGER");
 0103
 0104                            b1.Property<int>("MedicationId")
 0105                                .HasColumnType("INTEGER");
 0106
 0107                            b1.Property<string>("Time")
 0108                                .IsRequired()
 0109                                .HasColumnType("TEXT");
 0110
 0111                            b1.HasKey("Id");
 0112
 0113                            b1.HasIndex("MedicationId");
 0114
 0115                            b1.ToTable("IntakeTime");
 0116
 0117                            b1.WithOwner()
 0118                                .HasForeignKey("MedicationId");
 0119                        });
 0120
 0121                    b.Navigation("IntakeTimes");
 0122                });
 123#pragma warning restore 612, 618
 0124        }
 125    }
 126}