Files
AI-Health/backend/src/Health.Infrastructure/Data/Migrations/20260710052811_AddAppleSignIn.Designer.cs
2026-07-10 05:37:24 +00:00

1467 lines
50 KiB
C#

// <auto-generated />
using System;
using System.Collections.Generic;
using Health.Infrastructure.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Health.Infrastructure.Data.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20260710052811_AddAppleSignIn")]
partial class AddAppleSignIn
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Health.Domain.Entities.Consultation", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTime?>("ClosedAt")
.HasColumnType("timestamp with time zone");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("DoctorId")
.HasColumnType("uuid");
b.Property<int>("Month")
.HasColumnType("integer");
b.Property<string>("Status")
.IsRequired()
.HasColumnType("text");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("DoctorId");
b.HasIndex("UserId");
b.ToTable("Consultations");
});
modelBuilder.Entity("Health.Domain.Entities.ConsultationMessage", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<Guid>("ConsultationId")
.HasColumnType("uuid");
b.Property<string>("Content")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("SenderName")
.HasColumnType("text");
b.Property<string>("SenderType")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("ConsultationId", "CreatedAt")
.IsDescending(false, true);
b.ToTable("ConsultationMessages");
});
modelBuilder.Entity("Health.Domain.Entities.Conversation", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("AgentType")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<int>("MessageCount")
.HasColumnType("integer");
b.Property<string>("Summary")
.HasColumnType("text");
b.Property<string>("Title")
.HasColumnType("text");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("UserId", "UpdatedAt")
.IsDescending(false, true);
b.ToTable("Conversations");
});
modelBuilder.Entity("Health.Domain.Entities.ConversationMessage", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Content")
.IsRequired()
.HasColumnType("text");
b.Property<Guid>("ConversationId")
.HasColumnType("uuid");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Intent")
.HasColumnType("text");
b.Property<string>("MetadataJson")
.HasColumnType("jsonb");
b.Property<string>("Role")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("ConversationId", "CreatedAt");
b.ToTable("ConversationMessages");
});
modelBuilder.Entity("Health.Domain.Entities.DeviceToken", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<bool>("IsActive")
.HasColumnType("boolean");
b.Property<string>("Platform")
.IsRequired()
.HasColumnType("text");
b.Property<string>("PushToken")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("DeviceTokens");
});
modelBuilder.Entity("Health.Domain.Entities.DietFoodItem", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<int?>("Calories")
.HasColumnType("integer");
b.Property<decimal?>("CarbsGrams")
.HasColumnType("numeric");
b.Property<Guid>("DietRecordId")
.HasColumnType("uuid");
b.Property<decimal?>("FatGrams")
.HasColumnType("numeric");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Portion")
.HasColumnType("text");
b.Property<decimal?>("ProteinGrams")
.HasColumnType("numeric");
b.Property<int>("SortOrder")
.HasColumnType("integer");
b.Property<string>("Warning")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("DietRecordId");
b.ToTable("DietFoodItems");
});
modelBuilder.Entity("Health.Domain.Entities.DietRecord", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<int?>("HealthScore")
.HasColumnType("integer");
b.Property<string>("MealType")
.IsRequired()
.HasColumnType("text");
b.Property<DateOnly>("RecordedAt")
.HasColumnType("date");
b.Property<int?>("TotalCalories")
.HasColumnType("integer");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("UserId", "RecordedAt")
.IsDescending(false, true);
b.ToTable("DietRecords");
});
modelBuilder.Entity("Health.Domain.Entities.Doctor", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("AvatarUrl")
.HasColumnType("text");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Department")
.HasColumnType("text");
b.Property<string>("Introduction")
.HasColumnType("text");
b.Property<bool>("IsActive")
.HasColumnType("boolean");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Phone")
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.Property<string>("ProfessionalDirection")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("Title")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Doctors");
});
modelBuilder.Entity("Health.Domain.Entities.DoctorProfile", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("AvatarUrl")
.HasColumnType("text");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Department")
.HasColumnType("text");
b.Property<Guid?>("DoctorId")
.HasColumnType("uuid");
b.Property<string>("Hospital")
.HasColumnType("text");
b.Property<bool>("IsActive")
.HasColumnType("boolean");
b.Property<bool>("IsOnline")
.HasColumnType("boolean");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("Title")
.HasColumnType("text");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("DoctorId");
b.HasIndex("UserId")
.IsUnique();
b.ToTable("DoctorProfiles");
});
modelBuilder.Entity("Health.Domain.Entities.ExercisePlan", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<DateOnly>("EndDate")
.HasColumnType("date");
b.Property<TimeOnly>("ReminderTime")
.HasColumnType("time without time zone");
b.Property<DateOnly>("StartDate")
.HasColumnType("date");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("UserId", "StartDate", "EndDate");
b.ToTable("ExercisePlans");
});
modelBuilder.Entity("Health.Domain.Entities.ExercisePlanItem", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTime?>("CompletedAt")
.HasColumnType("timestamp with time zone");
b.Property<int>("DurationMinutes")
.HasColumnType("integer");
b.Property<string>("ExerciseType")
.IsRequired()
.HasColumnType("text");
b.Property<bool>("IsCompleted")
.HasColumnType("boolean");
b.Property<bool>("IsRestDay")
.HasColumnType("boolean");
b.Property<Guid>("PlanId")
.HasColumnType("uuid");
b.Property<DateOnly>("ScheduledDate")
.HasColumnType("date");
b.HasKey("Id");
b.HasIndex("PlanId", "ScheduledDate")
.IsUnique();
b.ToTable("ExercisePlanItems");
});
modelBuilder.Entity("Health.Domain.Entities.FollowUp", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Department")
.HasColumnType("text");
b.Property<string>("DoctorName")
.HasColumnType("text");
b.Property<string>("Notes")
.HasColumnType("text");
b.Property<DateTime>("ScheduledAt")
.HasColumnType("timestamp with time zone");
b.Property<int>("Status")
.HasColumnType("integer");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("text");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("FollowUps");
});
modelBuilder.Entity("Health.Domain.Entities.HealthArchive", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.PrimitiveCollection<List<string>>("Allergies")
.IsRequired()
.HasColumnType("text[]");
b.PrimitiveCollection<List<string>>("ChronicDiseases")
.IsRequired()
.HasColumnType("text[]");
b.Property<string>("Diagnosis")
.HasColumnType("text");
b.PrimitiveCollection<List<string>>("DietRestrictions")
.IsRequired()
.HasColumnType("text[]");
b.Property<string>("FamilyHistory")
.HasColumnType("text");
b.Property<DateOnly?>("SurgeryDate")
.HasColumnType("date");
b.Property<string>("SurgeryType")
.HasColumnType("text");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("UserId")
.IsUnique();
b.ToTable("HealthArchives");
});
modelBuilder.Entity("Health.Domain.Entities.HealthArchiveSurgery", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateOnly?>("Date")
.HasColumnType("date");
b.Property<Guid>("HealthArchiveId")
.HasColumnType("uuid");
b.Property<int>("SortOrder")
.HasColumnType("integer");
b.Property<string>("Type")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Id");
b.HasIndex("HealthArchiveId", "SortOrder");
b.ToTable("HealthArchiveSurgeries", (string)null);
});
modelBuilder.Entity("Health.Domain.Entities.HealthRecord", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<int?>("Diastolic")
.HasColumnType("integer");
b.Property<bool>("IsAbnormal")
.HasColumnType("boolean");
b.Property<string>("MetricType")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("RecordedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Source")
.IsRequired()
.HasColumnType("text");
b.Property<int?>("Systolic")
.HasColumnType("integer");
b.Property<string>("Unit")
.HasColumnType("text");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.Property<decimal?>("Value")
.HasColumnType("numeric");
b.HasKey("Id");
b.HasIndex("UserId", "MetricType");
b.HasIndex("UserId", "RecordedAt")
.IsDescending(false, true);
b.ToTable("HealthRecords");
});
modelBuilder.Entity("Health.Domain.Entities.Medication", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Dosage")
.HasColumnType("text");
b.Property<DateOnly?>("EndDate")
.HasColumnType("date");
b.Property<string>("Frequency")
.IsRequired()
.HasColumnType("text");
b.Property<bool>("IsActive")
.HasColumnType("boolean");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Notes")
.HasColumnType("text");
b.Property<string>("Source")
.IsRequired()
.HasColumnType("text");
b.Property<DateOnly?>("StartDate")
.HasColumnType("date");
b.PrimitiveCollection<List<TimeOnly>>("TimeOfDay")
.IsRequired()
.HasColumnType("time[]");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("UserId", "IsActive");
b.ToTable("Medications");
});
modelBuilder.Entity("Health.Domain.Entities.MedicationLog", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTime?>("ConfirmedAt")
.HasColumnType("timestamp with time zone");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("MedicationId")
.HasColumnType("uuid");
b.Property<TimeOnly>("ScheduledTime")
.HasColumnType("time without time zone");
b.Property<string>("Status")
.IsRequired()
.HasColumnType("text");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("MedicationId", "CreatedAt")
.IsDescending(false, true);
b.ToTable("MedicationLogs");
});
modelBuilder.Entity("Health.Domain.Entities.NotificationPreference", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<bool>("AbnormalAlert")
.HasColumnType("boolean");
b.Property<bool>("DoctorReply")
.HasColumnType("boolean");
b.Property<bool>("FollowUpReminder")
.HasColumnType("boolean");
b.Property<bool>("HealthRecordReminder")
.HasColumnType("boolean");
b.Property<bool>("HealthRecordReminderBloodPressure")
.HasColumnType("boolean");
b.Property<bool>("HealthRecordReminderGlucose")
.HasColumnType("boolean");
b.Property<bool>("HealthRecordReminderHeartRate")
.HasColumnType("boolean");
b.Property<bool>("HealthRecordReminderSpO2")
.HasColumnType("boolean");
b.Property<bool>("HealthRecordReminderWeight")
.HasColumnType("boolean");
b.Property<bool>("MedicationReminder")
.HasColumnType("boolean");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("UserId")
.IsUnique();
b.ToTable("NotificationPreferences");
});
modelBuilder.Entity("Health.Domain.Entities.RefreshToken", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<DateTime>("ExpiresAt")
.HasColumnType("timestamp with time zone");
b.Property<bool>("IsRevoked")
.HasColumnType("boolean");
b.Property<string>("Token")
.IsRequired()
.HasColumnType("text");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.ToTable("RefreshTokens");
});
modelBuilder.Entity("Health.Domain.Entities.Report", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("AiIndicators")
.HasColumnType("jsonb");
b.Property<string>("AiSummary")
.HasColumnType("text");
b.Property<string>("Category")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("DoctorComment")
.HasColumnType("text");
b.Property<string>("DoctorName")
.HasColumnType("text");
b.Property<string>("DoctorRecommendation")
.HasColumnType("text");
b.Property<string>("FileType")
.IsRequired()
.HasColumnType("text");
b.Property<string>("FileUrl")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime?>("ReviewedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Severity")
.HasColumnType("text");
b.Property<string>("Status")
.IsRequired()
.HasColumnType("text");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("Reports");
});
modelBuilder.Entity("Health.Domain.Entities.User", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("AppleUserId")
.HasColumnType("text");
b.Property<string>("AvatarUrl")
.HasColumnType("text");
b.Property<DateOnly?>("BirthDate")
.HasColumnType("date");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid?>("DoctorId")
.HasColumnType("uuid");
b.Property<string>("Gender")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("Phone")
.HasColumnType("text");
b.Property<string>("Role")
.IsRequired()
.ValueGeneratedOnAdd()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasDefaultValue("User");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("AppleUserId")
.IsUnique();
b.HasIndex("DoctorId");
b.HasIndex("Phone")
.IsUnique();
b.ToTable("Users");
});
modelBuilder.Entity("Health.Domain.Entities.UserNotification", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("ActionTargetId")
.HasColumnType("text");
b.Property<string>("ActionType")
.HasMaxLength(64)
.HasColumnType("character varying(64)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<bool>("IsDeleted")
.HasColumnType("boolean");
b.Property<bool>("IsRead")
.HasColumnType("boolean");
b.Property<string>("Message")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime?>("ReadAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Severity")
.IsRequired()
.HasMaxLength(16)
.HasColumnType("character varying(16)");
b.Property<Guid>("SourceId")
.HasColumnType("uuid");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Type")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("SourceId")
.IsUnique();
b.HasIndex("UserId", "IsDeleted", "IsRead", "CreatedAt");
b.ToTable("UserNotifications", (string)null);
});
modelBuilder.Entity("Health.Domain.Entities.VerificationCode", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Code")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<DateTime>("ExpiresAt")
.HasColumnType("timestamp with time zone");
b.Property<bool>("IsUsed")
.HasColumnType("boolean");
b.Property<string>("Phone")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("Phone", "CreatedAt")
.IsDescending(false, true);
b.ToTable("VerificationCodes");
});
modelBuilder.Entity("Health.Infrastructure.Data.Records.AiWriteCommandRecord", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Arguments")
.IsRequired()
.HasColumnType("jsonb");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<DateTime>("ExpiresAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Status")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)");
b.Property<string>("ToolName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("UserId", "Status", "ExpiresAt");
b.ToTable("AiWriteCommands", (string)null);
});
modelBuilder.Entity("Health.Infrastructure.Data.Records.DietImageAnalysisTaskRecord", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<int>("Attempts")
.HasColumnType("integer");
b.Property<DateTime>("AvailableAt")
.HasColumnType("timestamp with time zone");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("FilePaths")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("LastError")
.HasColumnType("text");
b.Property<int?>("ResultCode")
.HasColumnType("integer");
b.Property<string>("ResultData")
.HasColumnType("text");
b.Property<string>("ResultMessage")
.HasColumnType("text");
b.Property<string>("Status")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("Status", "AvailableAt");
b.ToTable("DietImageAnalysisTasks", (string)null);
});
modelBuilder.Entity("Health.Infrastructure.Data.Records.MedicationReminderTaskRecord", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<int>("Attempts")
.HasColumnType("integer");
b.Property<DateTime>("AvailableAt")
.HasColumnType("timestamp with time zone");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Dosage")
.HasColumnType("text");
b.Property<string>("LastError")
.HasColumnType("text");
b.Property<Guid>("MedicationId")
.HasColumnType("uuid");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<DateOnly>("ScheduledDate")
.HasColumnType("date");
b.Property<TimeOnly>("ScheduledTime")
.HasColumnType("time without time zone");
b.Property<string>("Status")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("Status", "AvailableAt");
b.HasIndex("MedicationId", "ScheduledDate", "ScheduledTime")
.IsUnique();
b.ToTable("MedicationReminderTasks", (string)null);
});
modelBuilder.Entity("Health.Infrastructure.Data.Records.NotificationOutboxRecord", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<int>("Attempts")
.HasColumnType("integer");
b.Property<DateTime>("AvailableAt")
.HasColumnType("timestamp with time zone");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("LastError")
.HasColumnType("text");
b.Property<string>("Payload")
.IsRequired()
.HasColumnType("jsonb");
b.Property<Guid>("SourceTaskId")
.HasColumnType("uuid");
b.Property<string>("Status")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)");
b.Property<string>("Type")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("SourceTaskId")
.IsUnique();
b.HasIndex("Status", "AvailableAt");
b.ToTable("NotificationOutbox", (string)null);
});
modelBuilder.Entity("Health.Infrastructure.Data.Records.ReportAnalysisTaskRecord", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<int>("Attempts")
.HasColumnType("integer");
b.Property<DateTime>("AvailableAt")
.HasColumnType("timestamp with time zone");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("FilePath")
.IsRequired()
.HasColumnType("text");
b.Property<string>("LastError")
.HasColumnType("text");
b.Property<Guid>("ReportId")
.HasColumnType("uuid");
b.Property<string>("Status")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("ReportId");
b.HasIndex("Status", "AvailableAt");
b.ToTable("ReportAnalysisTasks", (string)null);
});
modelBuilder.Entity("Health.Domain.Entities.Consultation", b =>
{
b.HasOne("Health.Domain.Entities.Doctor", "Doctor")
.WithMany("Consultations")
.HasForeignKey("DoctorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Health.Domain.Entities.User", "User")
.WithMany("Consultations")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Doctor");
b.Navigation("User");
});
modelBuilder.Entity("Health.Domain.Entities.ConsultationMessage", b =>
{
b.HasOne("Health.Domain.Entities.Consultation", "Consultation")
.WithMany("Messages")
.HasForeignKey("ConsultationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Consultation");
});
modelBuilder.Entity("Health.Domain.Entities.Conversation", b =>
{
b.HasOne("Health.Domain.Entities.User", "User")
.WithMany("Conversations")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("Health.Domain.Entities.ConversationMessage", b =>
{
b.HasOne("Health.Domain.Entities.Conversation", "Conversation")
.WithMany("Messages")
.HasForeignKey("ConversationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Conversation");
});
modelBuilder.Entity("Health.Domain.Entities.DeviceToken", b =>
{
b.HasOne("Health.Domain.Entities.User", "User")
.WithMany("DeviceTokens")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("Health.Domain.Entities.DietFoodItem", b =>
{
b.HasOne("Health.Domain.Entities.DietRecord", "DietRecord")
.WithMany("FoodItems")
.HasForeignKey("DietRecordId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("DietRecord");
});
modelBuilder.Entity("Health.Domain.Entities.DietRecord", b =>
{
b.HasOne("Health.Domain.Entities.User", "User")
.WithMany("DietRecords")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("Health.Domain.Entities.DoctorProfile", b =>
{
b.HasOne("Health.Domain.Entities.Doctor", "Doctor")
.WithMany()
.HasForeignKey("DoctorId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Health.Domain.Entities.User", "User")
.WithOne("DoctorProfile")
.HasForeignKey("Health.Domain.Entities.DoctorProfile", "UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Doctor");
b.Navigation("User");
});
modelBuilder.Entity("Health.Domain.Entities.ExercisePlan", b =>
{
b.HasOne("Health.Domain.Entities.User", "User")
.WithMany("ExercisePlans")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("Health.Domain.Entities.ExercisePlanItem", b =>
{
b.HasOne("Health.Domain.Entities.ExercisePlan", "Plan")
.WithMany("Items")
.HasForeignKey("PlanId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Plan");
});
modelBuilder.Entity("Health.Domain.Entities.FollowUp", b =>
{
b.HasOne("Health.Domain.Entities.User", "User")
.WithMany("FollowUps")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("Health.Domain.Entities.HealthArchive", b =>
{
b.HasOne("Health.Domain.Entities.User", "User")
.WithOne("HealthArchive")
.HasForeignKey("Health.Domain.Entities.HealthArchive", "UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("Health.Domain.Entities.HealthArchiveSurgery", b =>
{
b.HasOne("Health.Domain.Entities.HealthArchive", "HealthArchive")
.WithMany("Surgeries")
.HasForeignKey("HealthArchiveId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("HealthArchive");
});
modelBuilder.Entity("Health.Domain.Entities.HealthRecord", b =>
{
b.HasOne("Health.Domain.Entities.User", "User")
.WithMany("HealthRecords")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("Health.Domain.Entities.Medication", b =>
{
b.HasOne("Health.Domain.Entities.User", "User")
.WithMany("Medications")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("Health.Domain.Entities.MedicationLog", b =>
{
b.HasOne("Health.Domain.Entities.Medication", "Medication")
.WithMany("Logs")
.HasForeignKey("MedicationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Medication");
});
modelBuilder.Entity("Health.Domain.Entities.NotificationPreference", b =>
{
b.HasOne("Health.Domain.Entities.User", "User")
.WithOne("NotificationPreference")
.HasForeignKey("Health.Domain.Entities.NotificationPreference", "UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("Health.Domain.Entities.Report", b =>
{
b.HasOne("Health.Domain.Entities.User", "User")
.WithMany("Reports")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("Health.Domain.Entities.User", b =>
{
b.HasOne("Health.Domain.Entities.Doctor", "Doctor")
.WithMany()
.HasForeignKey("DoctorId")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("Doctor");
});
modelBuilder.Entity("Health.Domain.Entities.Consultation", b =>
{
b.Navigation("Messages");
});
modelBuilder.Entity("Health.Domain.Entities.Conversation", b =>
{
b.Navigation("Messages");
});
modelBuilder.Entity("Health.Domain.Entities.DietRecord", b =>
{
b.Navigation("FoodItems");
});
modelBuilder.Entity("Health.Domain.Entities.Doctor", b =>
{
b.Navigation("Consultations");
});
modelBuilder.Entity("Health.Domain.Entities.ExercisePlan", b =>
{
b.Navigation("Items");
});
modelBuilder.Entity("Health.Domain.Entities.HealthArchive", b =>
{
b.Navigation("Surgeries");
});
modelBuilder.Entity("Health.Domain.Entities.Medication", b =>
{
b.Navigation("Logs");
});
modelBuilder.Entity("Health.Domain.Entities.User", b =>
{
b.Navigation("Consultations");
b.Navigation("Conversations");
b.Navigation("DeviceTokens");
b.Navigation("DietRecords");
b.Navigation("DoctorProfile");
b.Navigation("ExercisePlans");
b.Navigation("FollowUps");
b.Navigation("HealthArchive");
b.Navigation("HealthRecords");
b.Navigation("Medications");
b.Navigation("NotificationPreference");
b.Navigation("Reports");
});
#pragma warning restore 612, 618
}
}
}