// <auto-generated />
using System;
using FamilyNido.Persistence;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;

#nullable disable

namespace FamilyNido.Persistence.Migrations
{
    [DbContext(typeof(ApplicationDbContext))]
    partial class ApplicationDbContextModelSnapshot : ModelSnapshot
    {
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "10.0.7")
                .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("FamilyNido.Domain.Agenda.MemberAgendaException", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<DateTimeOffset>("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");

                    b.Property<string>("CreatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("created_by");

                    b.Property<DateOnly>("Date")
                        .HasColumnType("date")
                        .HasColumnName("date");

                    b.Property<TimeOnly?>("EndTime")
                        .HasColumnType("time without time zone")
                        .HasColumnName("end_time");

                    b.Property<Guid>("FamilyId")
                        .HasColumnType("uuid")
                        .HasColumnName("family_id");

                    b.Property<Guid>("FamilyMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("family_member_id");

                    b.Property<bool?>("IsAway")
                        .HasColumnType("boolean")
                        .HasColumnName("is_away");

                    b.Property<bool>("IsCancelled")
                        .HasColumnType("boolean")
                        .HasColumnName("is_cancelled");

                    b.Property<string>("Label")
                        .HasMaxLength(120)
                        .HasColumnType("character varying(120)")
                        .HasColumnName("label");

                    b.Property<string>("Location")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("location");

                    b.Property<string>("Notes")
                        .HasMaxLength(500)
                        .HasColumnType("character varying(500)")
                        .HasColumnName("notes");

                    b.Property<Guid?>("PatternId")
                        .HasColumnType("uuid")
                        .HasColumnName("pattern_id");

                    b.Property<TimeOnly?>("StartTime")
                        .HasColumnType("time without time zone")
                        .HasColumnName("start_time");

                    b.Property<int?>("TransportMode")
                        .HasColumnType("integer")
                        .HasColumnName("transport_mode");

                    b.Property<DateTimeOffset?>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.Property<string>("UpdatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("updated_by");

                    b.HasKey("Id")
                        .HasName("pk_member_agenda_exceptions");

                    b.HasIndex("PatternId")
                        .HasDatabaseName("ix_member_agenda_exceptions_pattern_id");

                    b.HasIndex("FamilyId", "Date")
                        .HasDatabaseName("ix_member_agenda_exceptions_family_id_date");

                    b.HasIndex("FamilyMemberId", "Date", "PatternId")
                        .IsUnique()
                        .HasDatabaseName("ix_member_agenda_exceptions_family_member_id_date_pattern_id");

                    b.ToTable("member_agenda_exceptions", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.Agenda.MemberAgendaPattern", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<DateTimeOffset>("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");

                    b.Property<string>("CreatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("created_by");

                    b.Property<int>("DayOfWeek")
                        .HasColumnType("integer")
                        .HasColumnName("day_of_week");

                    b.Property<TimeOnly?>("EndTime")
                        .HasColumnType("time without time zone")
                        .HasColumnName("end_time");

                    b.Property<Guid>("FamilyId")
                        .HasColumnType("uuid")
                        .HasColumnName("family_id");

                    b.Property<Guid>("FamilyMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("family_member_id");

                    b.Property<bool>("IsActive")
                        .HasColumnType("boolean")
                        .HasColumnName("is_active");

                    b.Property<bool>("IsAway")
                        .HasColumnType("boolean")
                        .HasColumnName("is_away");

                    b.Property<string>("Label")
                        .IsRequired()
                        .HasMaxLength(120)
                        .HasColumnType("character varying(120)")
                        .HasColumnName("label");

                    b.Property<string>("Location")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("location");

                    b.Property<string>("Notes")
                        .HasMaxLength(500)
                        .HasColumnType("character varying(500)")
                        .HasColumnName("notes");

                    b.Property<TimeOnly?>("StartTime")
                        .HasColumnType("time without time zone")
                        .HasColumnName("start_time");

                    b.Property<int>("TransportMode")
                        .HasColumnType("integer")
                        .HasColumnName("transport_mode");

                    b.Property<DateTimeOffset?>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.Property<string>("UpdatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("updated_by");

                    b.HasKey("Id")
                        .HasName("pk_member_agenda_patterns");

                    b.HasIndex("FamilyId")
                        .HasDatabaseName("ix_member_agenda_patterns_family_id");

                    b.HasIndex("FamilyMemberId", "DayOfWeek")
                        .HasDatabaseName("ix_member_agenda_patterns_family_member_id_day_of_week");

                    b.ToTable("member_agenda_patterns", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.Calendar.CalendarEvent", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<DateTimeOffset>("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");

                    b.Property<string>("CreatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("created_by");

                    b.Property<string>("Description")
                        .HasColumnType("text")
                        .HasColumnName("description");

                    b.Property<DateTimeOffset>("EndAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("end_at");

                    b.Property<string>("ExternalEventId")
                        .IsRequired()
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("external_event_id");

                    b.Property<Guid>("FamilyId")
                        .HasColumnType("uuid")
                        .HasColumnName("family_id");

                    b.Property<string>("HtmlLink")
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("html_link");

                    b.Property<string>("IcalUid")
                        .HasMaxLength(1024)
                        .HasColumnType("character varying(1024)")
                        .HasColumnName("ical_uid");

                    b.Property<bool>("IsAllDay")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(false)
                        .HasColumnName("is_all_day");

                    b.Property<Guid>("LinkedCalendarId")
                        .HasColumnType("uuid")
                        .HasColumnName("linked_calendar_id");

                    b.Property<string>("Location")
                        .HasMaxLength(500)
                        .HasColumnType("character varying(500)")
                        .HasColumnName("location");

                    b.Property<string>("OriginalTimeZone")
                        .HasMaxLength(64)
                        .HasColumnType("character varying(64)")
                        .HasColumnName("original_time_zone");

                    b.Property<DateTimeOffset>("StartAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("start_at");

                    b.Property<string>("Title")
                        .IsRequired()
                        .HasMaxLength(500)
                        .HasColumnType("character varying(500)")
                        .HasColumnName("title");

                    b.Property<DateTimeOffset?>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.Property<string>("UpdatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("updated_by");

                    b.HasKey("Id")
                        .HasName("pk_calendar_events");

                    b.HasIndex("FamilyId", "EndAt")
                        .HasDatabaseName("ix_calendar_events_family_id_end_at");

                    b.HasIndex("FamilyId", "StartAt")
                        .HasDatabaseName("ix_calendar_events_family_id_start_at");

                    b.HasIndex("LinkedCalendarId", "ExternalEventId")
                        .IsUnique()
                        .HasDatabaseName("ix_calendar_events_linked_calendar_id_external_event_id");

                    b.ToTable("calendar_events", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.Calendar.GoogleAccount", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<DateTimeOffset>("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");

                    b.Property<string>("CreatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("created_by");

                    b.Property<string>("DisplayName")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("display_name");

                    b.Property<string>("Email")
                        .IsRequired()
                        .HasMaxLength(320)
                        .HasColumnType("character varying(320)")
                        .HasColumnName("email");

                    b.Property<string>("EncryptedRefreshToken")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("encrypted_refresh_token");

                    b.Property<Guid>("FamilyId")
                        .HasColumnType("uuid")
                        .HasColumnName("family_id");

                    b.Property<bool>("IsRevoked")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(false)
                        .HasColumnName("is_revoked");

                    b.Property<string>("LastError")
                        .HasMaxLength(2000)
                        .HasColumnType("character varying(2000)")
                        .HasColumnName("last_error");

                    b.Property<DateTimeOffset?>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.Property<string>("UpdatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("updated_by");

                    b.Property<Guid>("UserId")
                        .HasColumnType("uuid")
                        .HasColumnName("user_id");

                    b.HasKey("Id")
                        .HasName("pk_google_accounts");

                    b.HasIndex("FamilyId")
                        .HasDatabaseName("ix_google_accounts_family_id");

                    b.HasIndex("UserId", "Email")
                        .IsUnique()
                        .HasDatabaseName("ix_google_accounts_user_id_email");

                    b.ToTable("google_accounts", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.Calendar.LinkedCalendar", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<string>("ColorHex")
                        .HasMaxLength(7)
                        .HasColumnType("character varying(7)")
                        .HasColumnName("color_hex");

                    b.Property<DateTimeOffset>("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");

                    b.Property<string>("CreatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("created_by");

                    b.Property<string>("Description")
                        .HasMaxLength(2000)
                        .HasColumnType("character varying(2000)")
                        .HasColumnName("description");

                    b.Property<string>("ExternalCalendarId")
                        .IsRequired()
                        .HasMaxLength(320)
                        .HasColumnType("character varying(320)")
                        .HasColumnName("external_calendar_id");

                    b.Property<Guid?>("FamilyMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("family_member_id");

                    b.Property<Guid>("GoogleAccountId")
                        .HasColumnType("uuid")
                        .HasColumnName("google_account_id");

                    b.Property<bool>("IsImported")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(false)
                        .HasColumnName("is_imported");

                    b.Property<DateTimeOffset?>("LastSyncedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("last_synced_at");

                    b.Property<string>("Summary")
                        .IsRequired()
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("summary");

                    b.Property<string>("SyncToken")
                        .HasColumnType("text")
                        .HasColumnName("sync_token");

                    b.Property<DateTimeOffset?>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.Property<string>("UpdatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("updated_by");

                    b.HasKey("Id")
                        .HasName("pk_linked_calendars");

                    b.HasIndex("FamilyMemberId")
                        .HasDatabaseName("ix_linked_calendars_family_member_id");

                    b.HasIndex("GoogleAccountId", "ExternalCalendarId")
                        .IsUnique()
                        .HasDatabaseName("ix_linked_calendars_google_account_id_external_calendar_id");

                    b.HasIndex("GoogleAccountId", "IsImported")
                        .HasDatabaseName("ix_linked_calendars_google_account_id_is_imported");

                    b.ToTable("linked_calendars", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.Families.Family", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<DateTimeOffset>("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");

                    b.Property<string>("CreatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("created_by");

                    b.Property<double?>("Latitude")
                        .HasColumnType("double precision")
                        .HasColumnName("latitude");

                    b.Property<string>("Locale")
                        .IsRequired()
                        .HasMaxLength(16)
                        .HasColumnType("character varying(16)")
                        .HasColumnName("locale");

                    b.Property<string>("LocationLabel")
                        .HasMaxLength(120)
                        .HasColumnType("character varying(120)")
                        .HasColumnName("location_label");

                    b.Property<double?>("Longitude")
                        .HasColumnType("double precision")
                        .HasColumnName("longitude");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(120)
                        .HasColumnType("character varying(120)")
                        .HasColumnName("name");

                    b.Property<string>("TimeZone")
                        .IsRequired()
                        .HasMaxLength(64)
                        .HasColumnType("character varying(64)")
                        .HasColumnName("time_zone");

                    b.Property<DateTimeOffset?>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.Property<string>("UpdatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("updated_by");

                    b.HasKey("Id")
                        .HasName("pk_families");

                    b.ToTable("families", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.Families.FamilyMember", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<DateOnly?>("BirthDate")
                        .HasColumnType("date")
                        .HasColumnName("birth_date");

                    b.Property<string>("ColorHex")
                        .IsRequired()
                        .HasMaxLength(7)
                        .HasColumnType("character varying(7)")
                        .HasColumnName("color_hex");

                    b.Property<string>("ContactEmail")
                        .HasMaxLength(254)
                        .HasColumnType("character varying(254)")
                        .HasColumnName("contact_email");

                    b.Property<DateTimeOffset>("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");

                    b.Property<string>("CreatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("created_by");

                    b.Property<string>("DisplayName")
                        .IsRequired()
                        .HasMaxLength(120)
                        .HasColumnType("character varying(120)")
                        .HasColumnName("display_name");

                    b.Property<Guid>("FamilyId")
                        .HasColumnType("uuid")
                        .HasColumnName("family_id");

                    b.Property<bool>("IsActive")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(true)
                        .HasColumnName("is_active");

                    b.Property<string>("MemberType")
                        .IsRequired()
                        .HasMaxLength(16)
                        .HasColumnType("character varying(16)")
                        .HasColumnName("member_type");

                    b.Property<string>("PhotoPath")
                        .HasMaxLength(260)
                        .HasColumnType("character varying(260)")
                        .HasColumnName("photo_path");

                    b.Property<DateTimeOffset?>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.Property<string>("UpdatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("updated_by");

                    b.Property<Guid?>("UserId")
                        .HasColumnType("uuid")
                        .HasColumnName("user_id");

                    b.HasKey("Id")
                        .HasName("pk_family_members");

                    b.HasIndex("UserId")
                        .IsUnique()
                        .HasDatabaseName("ix_family_members_user_id")
                        .HasFilter("user_id IS NOT NULL");

                    b.HasIndex("FamilyId", "IsActive")
                        .HasDatabaseName("ix_family_members_family_id_is_active");

                    b.ToTable("family_members", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.Files.FileAsset", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<string>("ContentType")
                        .IsRequired()
                        .HasMaxLength(80)
                        .HasColumnType("character varying(80)")
                        .HasColumnName("content_type");

                    b.Property<DateTimeOffset>("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");

                    b.Property<string>("CreatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("created_by");

                    b.Property<Guid>("FamilyId")
                        .HasColumnType("uuid")
                        .HasColumnName("family_id");

                    b.Property<int?>("Height")
                        .HasColumnType("integer")
                        .HasColumnName("height");

                    b.Property<Guid>("OwnerMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("owner_member_id");

                    b.Property<string>("RelativePath")
                        .IsRequired()
                        .HasMaxLength(400)
                        .HasColumnType("character varying(400)")
                        .HasColumnName("relative_path");

                    b.Property<long>("SizeBytes")
                        .HasColumnType("bigint")
                        .HasColumnName("size_bytes");

                    b.Property<DateTimeOffset?>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.Property<string>("UpdatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("updated_by");

                    b.Property<int?>("Width")
                        .HasColumnType("integer")
                        .HasColumnName("width");

                    b.HasKey("Id")
                        .HasName("pk_file_assets");

                    b.HasIndex("FamilyId")
                        .HasDatabaseName("ix_file_assets_family_id");

                    b.HasIndex("OwnerMemberId")
                        .HasDatabaseName("ix_file_assets_owner_member_id");

                    b.HasIndex("RelativePath")
                        .IsUnique()
                        .HasDatabaseName("ix_file_assets_relative_path");

                    b.ToTable("file_assets", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.Health.HealthProfile", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<string>("Allergies")
                        .HasMaxLength(2000)
                        .HasColumnType("character varying(2000)")
                        .HasColumnName("allergies");

                    b.Property<string>("BloodType")
                        .HasMaxLength(8)
                        .HasColumnType("character varying(8)")
                        .HasColumnName("blood_type");

                    b.Property<string>("ChronicConditions")
                        .HasMaxLength(2000)
                        .HasColumnType("character varying(2000)")
                        .HasColumnName("chronic_conditions");

                    b.Property<DateTimeOffset>("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");

                    b.Property<string>("CreatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("created_by");

                    b.Property<Guid>("FamilyMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("family_member_id");

                    b.Property<string>("Notes")
                        .HasMaxLength(4000)
                        .HasColumnType("character varying(4000)")
                        .HasColumnName("notes");

                    b.Property<DateTimeOffset?>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.Property<string>("UpdatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("updated_by");

                    b.HasKey("Id")
                        .HasName("pk_health_profiles");

                    b.HasIndex("FamilyMemberId")
                        .IsUnique()
                        .HasDatabaseName("ix_health_profiles_family_member_id");

                    b.ToTable("health_profiles", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.Health.Medication", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<DateTimeOffset>("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");

                    b.Property<string>("CreatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("created_by");

                    b.Property<string>("Dose")
                        .HasMaxLength(80)
                        .HasColumnType("character varying(80)")
                        .HasColumnName("dose");

                    b.Property<DateOnly?>("EndDate")
                        .HasColumnType("date")
                        .HasColumnName("end_date");

                    b.Property<Guid>("FamilyMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("family_member_id");

                    b.Property<string>("Frequency")
                        .HasMaxLength(120)
                        .HasColumnType("character varying(120)")
                        .HasColumnName("frequency");

                    b.Property<string>("Instructions")
                        .HasMaxLength(2000)
                        .HasColumnType("character varying(2000)")
                        .HasColumnName("instructions");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(120)
                        .HasColumnType("character varying(120)")
                        .HasColumnName("name");

                    b.Property<DateOnly>("StartDate")
                        .HasColumnType("date")
                        .HasColumnName("start_date");

                    b.Property<DateTimeOffset?>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.Property<string>("UpdatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("updated_by");

                    b.HasKey("Id")
                        .HasName("pk_medications");

                    b.HasIndex("FamilyMemberId", "StartDate")
                        .HasDatabaseName("ix_medications_family_member_id_start_date");

                    b.ToTable("medications", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.Health.Vaccination", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<DateTimeOffset>("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");

                    b.Property<string>("CreatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("created_by");

                    b.Property<DateOnly>("Date")
                        .HasColumnType("date")
                        .HasColumnName("date");

                    b.Property<Guid>("FamilyMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("family_member_id");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(120)
                        .HasColumnType("character varying(120)")
                        .HasColumnName("name");

                    b.Property<DateOnly?>("NextDueDate")
                        .HasColumnType("date")
                        .HasColumnName("next_due_date");

                    b.Property<string>("Notes")
                        .HasMaxLength(2000)
                        .HasColumnType("character varying(2000)")
                        .HasColumnName("notes");

                    b.Property<DateTimeOffset?>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.Property<string>("UpdatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("updated_by");

                    b.HasKey("Id")
                        .HasName("pk_vaccinations");

                    b.HasIndex("FamilyMemberId", "Date")
                        .HasDatabaseName("ix_vaccinations_family_member_id_date");

                    b.ToTable("vaccinations", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.HouseholdTasks.HouseholdTask", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<string>("Category")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasMaxLength(40)
                        .HasColumnType("character varying(40)")
                        .HasDefaultValue("General")
                        .HasColumnName("category");

                    b.Property<DateTimeOffset>("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");

                    b.Property<string>("CreatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("created_by");

                    b.Property<Guid>("CreatedByMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("created_by_member_id");

                    b.Property<string>("Description")
                        .HasMaxLength(2000)
                        .HasColumnType("character varying(2000)")
                        .HasColumnName("description");

                    b.Property<DateOnly?>("DueDate")
                        .HasColumnType("date")
                        .HasColumnName("due_date");

                    b.Property<Guid>("FamilyId")
                        .HasColumnType("uuid")
                        .HasColumnName("family_id");

                    b.Property<bool>("IsArchived")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(false)
                        .HasColumnName("is_archived");

                    b.Property<bool>("IsFloating")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(false)
                        .HasColumnName("is_floating");

                    b.Property<int?>("MonthlyDay")
                        .HasColumnType("integer")
                        .HasColumnName("monthly_day");

                    b.Property<int>("Points")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasDefaultValue(5)
                        .HasColumnName("points");

                    b.Property<string>("Recurrence")
                        .IsRequired()
                        .HasMaxLength(16)
                        .HasColumnType("character varying(16)")
                        .HasColumnName("recurrence");

                    b.Property<Guid?>("ResponsibleMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("responsible_member_id");

                    b.Property<DateOnly>("StartDate")
                        .HasColumnType("date")
                        .HasColumnName("start_date");

                    b.Property<TimeOnly?>("TimeOfDay")
                        .HasColumnType("time without time zone")
                        .HasColumnName("time_of_day");

                    b.Property<string>("Title")
                        .IsRequired()
                        .HasMaxLength(120)
                        .HasColumnType("character varying(120)")
                        .HasColumnName("title");

                    b.Property<DateTimeOffset?>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.Property<string>("UpdatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("updated_by");

                    b.Property<short?>("WeeklyDays")
                        .HasColumnType("smallint")
                        .HasColumnName("weekly_days");

                    b.HasKey("Id")
                        .HasName("pk_household_tasks");

                    b.HasIndex("CreatedByMemberId")
                        .HasDatabaseName("ix_household_tasks_created_by_member_id");

                    b.HasIndex("FamilyId")
                        .HasDatabaseName("ix_household_tasks_family_id");

                    b.HasIndex("ResponsibleMemberId")
                        .HasDatabaseName("ix_household_tasks_responsible_member_id");

                    b.HasIndex("FamilyId", "IsArchived")
                        .HasDatabaseName("ix_household_tasks_family_id_is_archived");

                    b.ToTable("household_tasks", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.HouseholdTasks.TaskCompletion", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<DateTimeOffset>("CompletedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("completed_at");

                    b.Property<Guid?>("CompletedByMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("completed_by_member_id");

                    b.Property<string>("Note")
                        .HasMaxLength(500)
                        .HasColumnType("character varying(500)")
                        .HasColumnName("note");

                    b.Property<DateOnly>("OccurrenceDate")
                        .HasColumnType("date")
                        .HasColumnName("occurrence_date");

                    b.Property<Guid>("TaskId")
                        .HasColumnType("uuid")
                        .HasColumnName("task_id");

                    b.HasKey("Id")
                        .HasName("pk_task_completions");

                    b.HasIndex("CompletedByMemberId")
                        .HasDatabaseName("ix_task_completions_completed_by_member_id");

                    b.HasIndex("TaskId", "OccurrenceDate")
                        .IsUnique()
                        .HasDatabaseName("ix_task_completions_task_id_occurrence_date");

                    b.ToTable("task_completions", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.Identity.Invitation", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<DateTimeOffset?>("ConsumedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("consumed_at");

                    b.Property<Guid?>("ConsumedByUserId")
                        .HasColumnType("uuid")
                        .HasColumnName("consumed_by_user_id");

                    b.Property<DateTimeOffset>("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");

                    b.Property<string>("CreatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("created_by");

                    b.Property<string>("Email")
                        .IsRequired()
                        .HasMaxLength(254)
                        .HasColumnType("character varying(254)")
                        .HasColumnName("email");

                    b.Property<DateTimeOffset>("ExpiresAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("expires_at");

                    b.Property<Guid>("FamilyId")
                        .HasColumnType("uuid")
                        .HasColumnName("family_id");

                    b.Property<Guid>("FamilyMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("family_member_id");

                    b.Property<DateTimeOffset?>("RevokedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("revoked_at");

                    b.Property<string>("RoleOnAccept")
                        .IsRequired()
                        .HasMaxLength(16)
                        .HasColumnType("character varying(16)")
                        .HasColumnName("role_on_accept");

                    b.Property<byte[]>("TokenHash")
                        .IsRequired()
                        .HasColumnType("bytea")
                        .HasColumnName("token_hash");

                    b.Property<DateTimeOffset?>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.Property<string>("UpdatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("updated_by");

                    b.HasKey("Id")
                        .HasName("pk_invitations");

                    b.HasIndex("FamilyMemberId")
                        .HasDatabaseName("ix_invitations_family_member_id");

                    b.HasIndex("TokenHash")
                        .IsUnique()
                        .HasDatabaseName("ix_invitations_token_hash");

                    b.HasIndex("FamilyId", "ConsumedAt", "RevokedAt")
                        .HasDatabaseName("ix_invitations_family_id_consumed_at_revoked_at");

                    b.ToTable("invitations", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.Identity.User", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<DateTimeOffset>("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");

                    b.Property<string>("CreatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("created_by");

                    b.Property<string>("DisplayName")
                        .IsRequired()
                        .HasMaxLength(120)
                        .HasColumnType("character varying(120)")
                        .HasColumnName("display_name");

                    b.Property<string>("Email")
                        .IsRequired()
                        .HasMaxLength(254)
                        .HasColumnType("character varying(254)")
                        .HasColumnName("email");

                    b.Property<DateTimeOffset?>("LastLoginAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("last_login_at");

                    b.Property<DateTimeOffset?>("LastWallReadAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("last_wall_read_at");

                    b.Property<string>("PreferredLanguage")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasMaxLength(16)
                        .HasColumnType("character varying(16)")
                        .HasDefaultValue("es-ES")
                        .HasColumnName("preferred_language");

                    b.Property<string>("Role")
                        .IsRequired()
                        .HasMaxLength(16)
                        .HasColumnType("character varying(16)")
                        .HasColumnName("role");

                    b.Property<DateTimeOffset?>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.Property<string>("UpdatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("updated_by");

                    b.HasKey("Id")
                        .HasName("pk_users");

                    b.HasIndex("Email")
                        .IsUnique()
                        .HasDatabaseName("ix_users_email");

                    b.ToTable("users", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.Identity.UserCredential", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<DateTimeOffset>("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");

                    b.Property<string>("CreatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("created_by");

                    b.Property<DateTimeOffset?>("LastUsedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("last_used_at");

                    b.Property<string>("PasswordHash")
                        .HasMaxLength(512)
                        .HasColumnType("character varying(512)")
                        .HasColumnName("password_hash");

                    b.Property<int>("Provider")
                        .HasColumnType("integer")
                        .HasColumnName("provider");

                    b.Property<string>("ProviderKey")
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)")
                        .HasColumnName("provider_key");

                    b.Property<DateTimeOffset?>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.Property<string>("UpdatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("updated_by");

                    b.Property<Guid>("UserId")
                        .HasColumnType("uuid")
                        .HasColumnName("user_id");

                    b.HasKey("Id")
                        .HasName("pk_user_credentials");

                    b.HasIndex("UserId")
                        .HasDatabaseName("ix_user_credentials_user_id");

                    b.HasIndex("Provider", "ProviderKey")
                        .IsUnique()
                        .HasDatabaseName("ix_user_credentials_provider_provider_key")
                        .HasFilter("provider_key IS NOT NULL");

                    b.ToTable("user_credentials", null, t =>
                        {
                            t.HasCheckConstraint("ck_user_credentials_shape", "(provider = 0 AND provider_key IS NOT NULL AND password_hash IS NULL) OR (provider = 1 AND provider_key IS NULL AND password_hash IS NOT NULL)");
                        });
                });

            modelBuilder.Entity("FamilyNido.Domain.Integrations.IntegrationApiKey", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<Guid>("AuthorMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("author_member_id");

                    b.Property<DateTimeOffset>("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("text")
                        .HasColumnName("created_by");

                    b.Property<Guid>("FamilyId")
                        .HasColumnType("uuid")
                        .HasColumnName("family_id");

                    b.Property<DateTimeOffset?>("LastUsedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("last_used_at");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(80)
                        .HasColumnType("character varying(80)")
                        .HasColumnName("name");

                    b.Property<string>("Prefix")
                        .IsRequired()
                        .HasMaxLength(16)
                        .HasColumnType("character varying(16)")
                        .HasColumnName("prefix");

                    b.Property<DateTimeOffset?>("RevokedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("revoked_at");

                    b.Property<string>("TokenHash")
                        .IsRequired()
                        .HasMaxLength(64)
                        .HasColumnType("character varying(64)")
                        .HasColumnName("token_hash");

                    b.Property<DateTimeOffset?>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("text")
                        .HasColumnName("updated_by");

                    b.HasKey("Id")
                        .HasName("pk_integration_api_keys");

                    b.HasIndex("AuthorMemberId")
                        .HasDatabaseName("ix_integration_api_keys_author_member_id");

                    b.HasIndex("FamilyId")
                        .HasDatabaseName("ix_integration_api_keys_family_id");

                    b.HasIndex("TokenHash")
                        .IsUnique()
                        .HasDatabaseName("ix_integration_api_keys_token_hash");

                    b.ToTable("integration_api_keys", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.Meals.MealPlanSlot", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<DateTimeOffset>("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");

                    b.Property<string>("CreatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("created_by");

                    b.Property<DateOnly>("Date")
                        .HasColumnType("date")
                        .HasColumnName("date");

                    b.Property<Guid>("FamilyId")
                        .HasColumnType("uuid")
                        .HasColumnName("family_id");

                    b.Property<string>("FirstCourse")
                        .HasMaxLength(120)
                        .HasColumnType("character varying(120)")
                        .HasColumnName("first_course");

                    b.Property<string>("SecondCourse")
                        .HasMaxLength(120)
                        .HasColumnType("character varying(120)")
                        .HasColumnName("second_course");

                    b.Property<string>("Slot")
                        .IsRequired()
                        .HasMaxLength(16)
                        .HasColumnType("character varying(16)")
                        .HasColumnName("slot");

                    b.Property<DateTimeOffset?>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.Property<string>("UpdatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("updated_by");

                    b.HasKey("Id")
                        .HasName("pk_meal_plan_slots");

                    b.HasIndex("FamilyId", "FirstCourse")
                        .HasDatabaseName("ix_meal_plan_slots_family_id_first_course");

                    b.HasIndex("FamilyId", "SecondCourse")
                        .HasDatabaseName("ix_meal_plan_slots_family_id_second_course");

                    b.HasIndex("FamilyId", "Date", "Slot")
                        .IsUnique()
                        .HasDatabaseName("ix_meal_plan_slots_family_id_date_slot");

                    b.ToTable("meal_plan_slots", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.Notifications.EmailDigestRun", b =>
                {
                    b.Property<Guid>("UserId")
                        .HasColumnType("uuid")
                        .HasColumnName("user_id");

                    b.Property<DateOnly>("LocalDate")
                        .HasColumnType("date")
                        .HasColumnName("local_date");

                    b.Property<DateTimeOffset>("SentAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("sent_at");

                    b.HasKey("UserId", "LocalDate")
                        .HasName("pk_email_digest_runs");

                    b.ToTable("email_digest_runs", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.Notifications.UserDashboardPreferences", b =>
                {
                    b.Property<Guid>("UserId")
                        .HasColumnType("uuid")
                        .HasColumnName("user_id");

                    b.Property<string>("WidgetsJson")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("widgets_json");

                    b.HasKey("UserId")
                        .HasName("pk_user_dashboard_preferences");

                    b.ToTable("user_dashboard_preferences", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.Notifications.UserNotificationPreferences", b =>
                {
                    b.Property<Guid>("UserId")
                        .HasColumnType("uuid")
                        .HasColumnName("user_id");

                    b.Property<bool>("DigestEnabled")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(true)
                        .HasColumnName("digest_enabled");

                    b.Property<bool>("EmailEnabled")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(true)
                        .HasColumnName("email_enabled");

                    b.Property<bool>("TaskAssignedEnabled")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(true)
                        .HasColumnName("task_assigned_enabled");

                    b.Property<bool>("WallMentionEnabled")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(true)
                        .HasColumnName("wall_mention_enabled");

                    b.HasKey("UserId")
                        .HasName("pk_user_notification_preferences");

                    b.ToTable("user_notification_preferences", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.School.Extracurricular", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<string>("ContactPhone")
                        .HasMaxLength(40)
                        .HasColumnType("character varying(40)")
                        .HasColumnName("contact_phone");

                    b.Property<DateTimeOffset>("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");

                    b.Property<string>("CreatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("created_by");

                    b.Property<Guid?>("DefaultDropoffMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("default_dropoff_member_id");

                    b.Property<Guid?>("DefaultPickupMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("default_pickup_member_id");

                    b.Property<DateOnly?>("EndDate")
                        .HasColumnType("date")
                        .HasColumnName("end_date");

                    b.Property<TimeOnly>("EndTime")
                        .HasColumnType("time without time zone")
                        .HasColumnName("end_time");

                    b.Property<Guid>("FamilyId")
                        .HasColumnType("uuid")
                        .HasColumnName("family_id");

                    b.Property<Guid>("FamilyMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("family_member_id");

                    b.Property<bool>("IsArchived")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(false)
                        .HasColumnName("is_archived");

                    b.Property<string>("Location")
                        .HasMaxLength(160)
                        .HasColumnType("character varying(160)")
                        .HasColumnName("location");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(120)
                        .HasColumnType("character varying(120)")
                        .HasColumnName("name");

                    b.Property<string>("Notes")
                        .HasMaxLength(2000)
                        .HasColumnType("character varying(2000)")
                        .HasColumnName("notes");

                    b.Property<DateOnly>("StartDate")
                        .HasColumnType("date")
                        .HasColumnName("start_date");

                    b.Property<TimeOnly>("StartTime")
                        .HasColumnType("time without time zone")
                        .HasColumnName("start_time");

                    b.Property<DateTimeOffset?>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.Property<string>("UpdatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("updated_by");

                    b.Property<short>("WeeklyDays")
                        .HasColumnType("smallint")
                        .HasColumnName("weekly_days");

                    b.HasKey("Id")
                        .HasName("pk_extracurriculars");

                    b.HasIndex("DefaultDropoffMemberId")
                        .HasDatabaseName("ix_extracurriculars_default_dropoff_member_id");

                    b.HasIndex("DefaultPickupMemberId")
                        .HasDatabaseName("ix_extracurriculars_default_pickup_member_id");

                    b.HasIndex("FamilyMemberId")
                        .HasDatabaseName("ix_extracurriculars_family_member_id");

                    b.HasIndex("FamilyId", "IsArchived")
                        .HasDatabaseName("ix_extracurriculars_family_id_is_archived");

                    b.ToTable("extracurriculars", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.School.ExtracurricularException", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<DateTimeOffset>("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");

                    b.Property<string>("CreatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("created_by");

                    b.Property<DateOnly>("Date")
                        .HasColumnType("date")
                        .HasColumnName("date");

                    b.Property<Guid?>("DropoffMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("dropoff_member_id");

                    b.Property<Guid>("ExtracurricularId")
                        .HasColumnType("uuid")
                        .HasColumnName("extracurricular_id");

                    b.Property<bool>("IsCancelled")
                        .HasColumnType("boolean")
                        .HasColumnName("is_cancelled");

                    b.Property<string>("Notes")
                        .HasMaxLength(500)
                        .HasColumnType("character varying(500)")
                        .HasColumnName("notes");

                    b.Property<Guid?>("PickupMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("pickup_member_id");

                    b.Property<DateTimeOffset?>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.Property<string>("UpdatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("updated_by");

                    b.HasKey("Id")
                        .HasName("pk_extracurricular_exceptions");

                    b.HasIndex("DropoffMemberId")
                        .HasDatabaseName("ix_extracurricular_exceptions_dropoff_member_id");

                    b.HasIndex("PickupMemberId")
                        .HasDatabaseName("ix_extracurricular_exceptions_pickup_member_id");

                    b.HasIndex("ExtracurricularId", "Date")
                        .IsUnique()
                        .HasDatabaseName("ix_extracurricular_exceptions_extracurricular_id_date");

                    b.ToTable("extracurricular_exceptions", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.School.SchoolDayException", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<TimeOnly?>("AfternoonTime")
                        .HasColumnType("time without time zone")
                        .HasColumnName("afternoon_time");

                    b.Property<DateTimeOffset>("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");

                    b.Property<string>("CreatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("created_by");

                    b.Property<DateOnly>("Date")
                        .HasColumnType("date")
                        .HasColumnName("date");

                    b.Property<Guid?>("DropoffMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("dropoff_member_id");

                    b.Property<Guid>("FamilyId")
                        .HasColumnType("uuid")
                        .HasColumnName("family_id");

                    b.Property<Guid>("FamilyMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("family_member_id");

                    b.Property<bool>("IsCancelled")
                        .HasColumnType("boolean")
                        .HasColumnName("is_cancelled");

                    b.Property<TimeOnly?>("MorningTime")
                        .HasColumnType("time without time zone")
                        .HasColumnName("morning_time");

                    b.Property<string>("Notes")
                        .HasMaxLength(500)
                        .HasColumnType("character varying(500)")
                        .HasColumnName("notes");

                    b.Property<Guid?>("PickupMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("pickup_member_id");

                    b.Property<DateTimeOffset?>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.Property<string>("UpdatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("updated_by");

                    b.HasKey("Id")
                        .HasName("pk_school_day_exceptions");

                    b.HasIndex("DropoffMemberId")
                        .HasDatabaseName("ix_school_day_exceptions_dropoff_member_id");

                    b.HasIndex("PickupMemberId")
                        .HasDatabaseName("ix_school_day_exceptions_pickup_member_id");

                    b.HasIndex("FamilyId", "Date")
                        .HasDatabaseName("ix_school_day_exceptions_family_id_date");

                    b.HasIndex("FamilyMemberId", "Date")
                        .IsUnique()
                        .HasDatabaseName("ix_school_day_exceptions_family_member_id_date");

                    b.ToTable("school_day_exceptions", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.School.SchoolDaySchedule", b =>
                {
                    b.Property<Guid>("FamilyMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("family_member_id");

                    b.Property<int>("DayOfWeek")
                        .HasColumnType("integer")
                        .HasColumnName("day_of_week");

                    b.Property<Guid?>("DropoffMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("dropoff_member_id");

                    b.Property<Guid?>("PickupMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("pickup_member_id");

                    b.HasKey("FamilyMemberId", "DayOfWeek")
                        .HasName("pk_school_day_schedules");

                    b.HasIndex("DropoffMemberId")
                        .HasDatabaseName("ix_school_day_schedules_dropoff_member_id");

                    b.HasIndex("PickupMemberId")
                        .HasDatabaseName("ix_school_day_schedules_pickup_member_id");

                    b.ToTable("school_day_schedules", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.School.SchoolHoliday", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<DateTimeOffset>("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");

                    b.Property<string>("CreatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("created_by");

                    b.Property<DateOnly>("EndDate")
                        .HasColumnType("date")
                        .HasColumnName("end_date");

                    b.Property<Guid>("FamilyId")
                        .HasColumnType("uuid")
                        .HasColumnName("family_id");

                    b.Property<string>("Label")
                        .IsRequired()
                        .HasMaxLength(120)
                        .HasColumnType("character varying(120)")
                        .HasColumnName("label");

                    b.Property<DateOnly>("StartDate")
                        .HasColumnType("date")
                        .HasColumnName("start_date");

                    b.Property<DateTimeOffset?>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.Property<string>("UpdatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("updated_by");

                    b.HasKey("Id")
                        .HasName("pk_school_holidays");

                    b.HasIndex("FamilyId", "StartDate")
                        .HasDatabaseName("ix_school_holidays_family_id_start_date");

                    b.ToTable("school_holidays", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.School.SchoolProfile", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<TimeOnly?>("AfternoonTime")
                        .HasColumnType("time without time zone")
                        .HasColumnName("afternoon_time");

                    b.Property<DateTimeOffset>("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");

                    b.Property<string>("CreatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("created_by");

                    b.Property<Guid>("FamilyMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("family_member_id");

                    b.Property<string>("Grade")
                        .HasMaxLength(60)
                        .HasColumnType("character varying(60)")
                        .HasColumnName("grade");

                    b.Property<TimeOnly?>("MorningTime")
                        .HasColumnType("time without time zone")
                        .HasColumnName("morning_time");

                    b.Property<string>("Notes")
                        .HasMaxLength(2000)
                        .HasColumnType("character varying(2000)")
                        .HasColumnName("notes");

                    b.Property<string>("SchoolName")
                        .HasMaxLength(120)
                        .HasColumnType("character varying(120)")
                        .HasColumnName("school_name");

                    b.Property<string>("TransportMode")
                        .IsRequired()
                        .HasMaxLength(8)
                        .HasColumnType("character varying(8)")
                        .HasColumnName("transport_mode");

                    b.Property<string>("Tutor")
                        .HasMaxLength(120)
                        .HasColumnType("character varying(120)")
                        .HasColumnName("tutor");

                    b.Property<DateTimeOffset?>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.Property<string>("UpdatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("updated_by");

                    b.HasKey("Id")
                        .HasName("pk_school_profiles");

                    b.HasIndex("FamilyMemberId")
                        .IsUnique()
                        .HasDatabaseName("ix_school_profiles_family_member_id");

                    b.ToTable("school_profiles", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.Wall.WallComment", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<Guid>("AuthorMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("author_member_id");

                    b.Property<DateTimeOffset>("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");

                    b.Property<string>("CreatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("created_by");

                    b.Property<Guid>("MessageId")
                        .HasColumnType("uuid")
                        .HasColumnName("message_id");

                    b.Property<string>("Text")
                        .IsRequired()
                        .HasMaxLength(2000)
                        .HasColumnType("character varying(2000)")
                        .HasColumnName("text");

                    b.Property<string>("TextHtml")
                        .IsRequired()
                        .HasMaxLength(4000)
                        .HasColumnType("character varying(4000)")
                        .HasColumnName("text_html");

                    b.Property<DateTimeOffset?>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.Property<string>("UpdatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("updated_by");

                    b.HasKey("Id")
                        .HasName("pk_wall_comments");

                    b.HasIndex("AuthorMemberId")
                        .HasDatabaseName("ix_wall_comments_author_member_id");

                    b.HasIndex("MessageId", "CreatedAt")
                        .HasDatabaseName("ix_wall_comments_message_id_created_at");

                    b.ToTable("wall_comments", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.Wall.WallCommentMention", b =>
                {
                    b.Property<Guid>("CommentId")
                        .HasColumnType("uuid")
                        .HasColumnName("comment_id");

                    b.Property<Guid>("FamilyMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("family_member_id");

                    b.HasKey("CommentId", "FamilyMemberId")
                        .HasName("pk_wall_comment_mentions");

                    b.HasIndex("FamilyMemberId")
                        .HasDatabaseName("ix_wall_comment_mentions_family_member_id");

                    b.ToTable("wall_comment_mentions", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.Wall.WallMessage", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<Guid>("AuthorMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("author_member_id");

                    b.Property<DateTimeOffset>("CreatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at");

                    b.Property<string>("CreatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("created_by");

                    b.Property<Guid>("FamilyId")
                        .HasColumnType("uuid")
                        .HasColumnName("family_id");

                    b.Property<Guid?>("ImageFileId")
                        .HasColumnType("uuid")
                        .HasColumnName("image_file_id");

                    b.Property<bool>("IsPinned")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(false)
                        .HasColumnName("is_pinned");

                    b.Property<DateTimeOffset?>("PinnedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("pinned_at");

                    b.Property<string>("Text")
                        .IsRequired()
                        .HasMaxLength(4000)
                        .HasColumnType("character varying(4000)")
                        .HasColumnName("text");

                    b.Property<string>("TextHtml")
                        .IsRequired()
                        .HasMaxLength(8000)
                        .HasColumnType("character varying(8000)")
                        .HasColumnName("text_html");

                    b.Property<DateTimeOffset?>("UpdatedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at");

                    b.Property<string>("UpdatedBy")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("updated_by");

                    b.HasKey("Id")
                        .HasName("pk_wall_messages");

                    b.HasIndex("AuthorMemberId")
                        .HasDatabaseName("ix_wall_messages_author_member_id");

                    b.HasIndex("ImageFileId")
                        .HasDatabaseName("ix_wall_messages_image_file_id");

                    b.HasIndex("FamilyId", "CreatedAt")
                        .HasDatabaseName("ix_wall_messages_family_id_created_at");

                    b.HasIndex("FamilyId", "IsPinned", "PinnedAt")
                        .HasDatabaseName("ix_wall_messages_family_id_is_pinned_pinned_at");

                    b.ToTable("wall_messages", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.Wall.WallMessageMention", b =>
                {
                    b.Property<Guid>("MessageId")
                        .HasColumnType("uuid")
                        .HasColumnName("message_id");

                    b.Property<Guid>("FamilyMemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("family_member_id");

                    b.HasKey("MessageId", "FamilyMemberId")
                        .HasName("pk_wall_message_mentions");

                    b.HasIndex("FamilyMemberId")
                        .HasDatabaseName("ix_wall_message_mentions_family_member_id");

                    b.ToTable("wall_message_mentions", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.Wall.WallReaction", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<string>("Emoji")
                        .IsRequired()
                        .HasMaxLength(16)
                        .HasColumnType("character varying(16)")
                        .HasColumnName("emoji");

                    b.Property<Guid>("MemberId")
                        .HasColumnType("uuid")
                        .HasColumnName("member_id");

                    b.Property<Guid>("MessageId")
                        .HasColumnType("uuid")
                        .HasColumnName("message_id");

                    b.Property<DateTimeOffset>("ReactedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("reacted_at");

                    b.HasKey("Id")
                        .HasName("pk_wall_reactions");

                    b.HasIndex("MemberId")
                        .HasDatabaseName("ix_wall_reactions_member_id");

                    b.HasIndex("MessageId", "MemberId", "Emoji")
                        .IsUnique()
                        .HasDatabaseName("ix_wall_reactions_message_id_member_id_emoji");

                    b.ToTable("wall_reactions", (string)null);
                });

            modelBuilder.Entity("calendar_event_members", b =>
                {
                    b.Property<Guid>("calendar_event_id")
                        .HasColumnType("uuid")
                        .HasColumnName("calendar_event_id");

                    b.Property<Guid>("family_member_id")
                        .HasColumnType("uuid")
                        .HasColumnName("family_member_id");

                    b.HasKey("calendar_event_id", "family_member_id")
                        .HasName("pk_calendar_event_members");

                    b.HasIndex("family_member_id")
                        .HasDatabaseName("ix_calendar_event_members_family_member_id");

                    b.ToTable("calendar_event_members", (string)null);
                });

            modelBuilder.Entity("household_task_related_members", b =>
                {
                    b.Property<Guid>("task_id")
                        .HasColumnType("uuid")
                        .HasColumnName("task_id");

                    b.Property<Guid>("family_member_id")
                        .HasColumnType("uuid")
                        .HasColumnName("family_member_id");

                    b.HasKey("task_id", "family_member_id")
                        .HasName("pk_household_task_related_members");

                    b.HasIndex("family_member_id")
                        .HasDatabaseName("ix_household_task_related_members_family_member_id");

                    b.ToTable("household_task_related_members", (string)null);
                });

            modelBuilder.Entity("FamilyNido.Domain.Agenda.MemberAgendaException", b =>
                {
                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "FamilyMember")
                        .WithMany()
                        .HasForeignKey("FamilyMemberId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_member_agenda_exceptions_family_members_family_member_id");

                    b.HasOne("FamilyNido.Domain.Agenda.MemberAgendaPattern", "Pattern")
                        .WithMany()
                        .HasForeignKey("PatternId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .HasConstraintName("fk_member_agenda_exceptions_member_agenda_patterns_pattern_id");

                    b.Navigation("FamilyMember");

                    b.Navigation("Pattern");
                });

            modelBuilder.Entity("FamilyNido.Domain.Agenda.MemberAgendaPattern", b =>
                {
                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "FamilyMember")
                        .WithMany()
                        .HasForeignKey("FamilyMemberId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_member_agenda_patterns_family_members_family_member_id");

                    b.Navigation("FamilyMember");
                });

            modelBuilder.Entity("FamilyNido.Domain.Calendar.CalendarEvent", b =>
                {
                    b.HasOne("FamilyNido.Domain.Families.Family", "Family")
                        .WithMany()
                        .HasForeignKey("FamilyId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired()
                        .HasConstraintName("fk_calendar_events_families_family_id");

                    b.HasOne("FamilyNido.Domain.Calendar.LinkedCalendar", "LinkedCalendar")
                        .WithMany("Events")
                        .HasForeignKey("LinkedCalendarId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_calendar_events_linked_calendars_linked_calendar_id");

                    b.Navigation("Family");

                    b.Navigation("LinkedCalendar");
                });

            modelBuilder.Entity("FamilyNido.Domain.Calendar.GoogleAccount", b =>
                {
                    b.HasOne("FamilyNido.Domain.Families.Family", "Family")
                        .WithMany()
                        .HasForeignKey("FamilyId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired()
                        .HasConstraintName("fk_google_accounts_families_family_id");

                    b.HasOne("FamilyNido.Domain.Identity.User", "User")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_google_accounts_users_user_id");

                    b.Navigation("Family");

                    b.Navigation("User");
                });

            modelBuilder.Entity("FamilyNido.Domain.Calendar.LinkedCalendar", b =>
                {
                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "FamilyMember")
                        .WithMany()
                        .HasForeignKey("FamilyMemberId")
                        .OnDelete(DeleteBehavior.SetNull)
                        .HasConstraintName("fk_linked_calendars_family_members_family_member_id");

                    b.HasOne("FamilyNido.Domain.Calendar.GoogleAccount", "GoogleAccount")
                        .WithMany("Calendars")
                        .HasForeignKey("GoogleAccountId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_linked_calendars_google_accounts_google_account_id");

                    b.Navigation("FamilyMember");

                    b.Navigation("GoogleAccount");
                });

            modelBuilder.Entity("FamilyNido.Domain.Families.FamilyMember", b =>
                {
                    b.HasOne("FamilyNido.Domain.Families.Family", "Family")
                        .WithMany("Members")
                        .HasForeignKey("FamilyId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired()
                        .HasConstraintName("fk_family_members_families_family_id");

                    b.HasOne("FamilyNido.Domain.Identity.User", "User")
                        .WithOne("FamilyMember")
                        .HasForeignKey("FamilyNido.Domain.Families.FamilyMember", "UserId")
                        .OnDelete(DeleteBehavior.SetNull)
                        .HasConstraintName("fk_family_members_users_user_id");

                    b.Navigation("Family");

                    b.Navigation("User");
                });

            modelBuilder.Entity("FamilyNido.Domain.Files.FileAsset", b =>
                {
                    b.HasOne("FamilyNido.Domain.Families.Family", "Family")
                        .WithMany()
                        .HasForeignKey("FamilyId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired()
                        .HasConstraintName("fk_file_assets_families_family_id");

                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "OwnerMember")
                        .WithMany()
                        .HasForeignKey("OwnerMemberId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired()
                        .HasConstraintName("fk_file_assets_family_members_owner_member_id");

                    b.Navigation("Family");

                    b.Navigation("OwnerMember");
                });

            modelBuilder.Entity("FamilyNido.Domain.Health.HealthProfile", b =>
                {
                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "FamilyMember")
                        .WithOne()
                        .HasForeignKey("FamilyNido.Domain.Health.HealthProfile", "FamilyMemberId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_health_profiles_family_members_family_member_id");

                    b.Navigation("FamilyMember");
                });

            modelBuilder.Entity("FamilyNido.Domain.Health.Medication", b =>
                {
                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "FamilyMember")
                        .WithMany()
                        .HasForeignKey("FamilyMemberId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_medications_family_members_family_member_id");

                    b.Navigation("FamilyMember");
                });

            modelBuilder.Entity("FamilyNido.Domain.Health.Vaccination", b =>
                {
                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "FamilyMember")
                        .WithMany()
                        .HasForeignKey("FamilyMemberId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_vaccinations_family_members_family_member_id");

                    b.Navigation("FamilyMember");
                });

            modelBuilder.Entity("FamilyNido.Domain.HouseholdTasks.HouseholdTask", b =>
                {
                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "CreatedByMember")
                        .WithMany()
                        .HasForeignKey("CreatedByMemberId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired()
                        .HasConstraintName("fk_household_tasks_family_members_created_by_member_id");

                    b.HasOne("FamilyNido.Domain.Families.Family", "Family")
                        .WithMany()
                        .HasForeignKey("FamilyId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired()
                        .HasConstraintName("fk_household_tasks_families_family_id");

                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "ResponsibleMember")
                        .WithMany()
                        .HasForeignKey("ResponsibleMemberId")
                        .OnDelete(DeleteBehavior.SetNull)
                        .HasConstraintName("fk_household_tasks_family_members_responsible_member_id");

                    b.Navigation("CreatedByMember");

                    b.Navigation("Family");

                    b.Navigation("ResponsibleMember");
                });

            modelBuilder.Entity("FamilyNido.Domain.HouseholdTasks.TaskCompletion", b =>
                {
                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "CompletedBy")
                        .WithMany()
                        .HasForeignKey("CompletedByMemberId")
                        .OnDelete(DeleteBehavior.SetNull)
                        .HasConstraintName("fk_task_completions_family_members_completed_by_member_id");

                    b.HasOne("FamilyNido.Domain.HouseholdTasks.HouseholdTask", "Task")
                        .WithMany("Completions")
                        .HasForeignKey("TaskId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_task_completions_household_tasks_task_id");

                    b.Navigation("CompletedBy");

                    b.Navigation("Task");
                });

            modelBuilder.Entity("FamilyNido.Domain.Identity.Invitation", b =>
                {
                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "FamilyMember")
                        .WithMany()
                        .HasForeignKey("FamilyMemberId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired()
                        .HasConstraintName("fk_invitations_family_members_family_member_id");

                    b.Navigation("FamilyMember");
                });

            modelBuilder.Entity("FamilyNido.Domain.Identity.UserCredential", b =>
                {
                    b.HasOne("FamilyNido.Domain.Identity.User", "User")
                        .WithMany("Credentials")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_user_credentials_users_user_id");

                    b.Navigation("User");
                });

            modelBuilder.Entity("FamilyNido.Domain.Integrations.IntegrationApiKey", b =>
                {
                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "AuthorMember")
                        .WithMany()
                        .HasForeignKey("AuthorMemberId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired()
                        .HasConstraintName("fk_integration_api_keys_family_members_author_member_id");

                    b.HasOne("FamilyNido.Domain.Families.Family", "Family")
                        .WithMany()
                        .HasForeignKey("FamilyId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_integration_api_keys_families_family_id");

                    b.Navigation("AuthorMember");

                    b.Navigation("Family");
                });

            modelBuilder.Entity("FamilyNido.Domain.Meals.MealPlanSlot", b =>
                {
                    b.HasOne("FamilyNido.Domain.Families.Family", "Family")
                        .WithMany()
                        .HasForeignKey("FamilyId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired()
                        .HasConstraintName("fk_meal_plan_slots_families_family_id");

                    b.Navigation("Family");
                });

            modelBuilder.Entity("FamilyNido.Domain.Notifications.EmailDigestRun", b =>
                {
                    b.HasOne("FamilyNido.Domain.Identity.User", "User")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_email_digest_runs_users_user_id");

                    b.Navigation("User");
                });

            modelBuilder.Entity("FamilyNido.Domain.Notifications.UserDashboardPreferences", b =>
                {
                    b.HasOne("FamilyNido.Domain.Identity.User", "User")
                        .WithOne()
                        .HasForeignKey("FamilyNido.Domain.Notifications.UserDashboardPreferences", "UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_user_dashboard_preferences_users_user_id");

                    b.Navigation("User");
                });

            modelBuilder.Entity("FamilyNido.Domain.Notifications.UserNotificationPreferences", b =>
                {
                    b.HasOne("FamilyNido.Domain.Identity.User", "User")
                        .WithOne()
                        .HasForeignKey("FamilyNido.Domain.Notifications.UserNotificationPreferences", "UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_user_notification_preferences_users_user_id");

                    b.Navigation("User");
                });

            modelBuilder.Entity("FamilyNido.Domain.School.Extracurricular", b =>
                {
                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "DefaultDropoffMember")
                        .WithMany()
                        .HasForeignKey("DefaultDropoffMemberId")
                        .OnDelete(DeleteBehavior.SetNull)
                        .HasConstraintName("fk_extracurriculars_family_members_default_dropoff_member_id");

                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "DefaultPickupMember")
                        .WithMany()
                        .HasForeignKey("DefaultPickupMemberId")
                        .OnDelete(DeleteBehavior.SetNull)
                        .HasConstraintName("fk_extracurriculars_family_members_default_pickup_member_id");

                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "FamilyMember")
                        .WithMany()
                        .HasForeignKey("FamilyMemberId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_extracurriculars_family_members_family_member_id");

                    b.Navigation("DefaultDropoffMember");

                    b.Navigation("DefaultPickupMember");

                    b.Navigation("FamilyMember");
                });

            modelBuilder.Entity("FamilyNido.Domain.School.ExtracurricularException", b =>
                {
                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "DropoffMember")
                        .WithMany()
                        .HasForeignKey("DropoffMemberId")
                        .OnDelete(DeleteBehavior.SetNull)
                        .HasConstraintName("fk_extracurricular_exceptions_family_members_dropoff_member_id");

                    b.HasOne("FamilyNido.Domain.School.Extracurricular", "Extracurricular")
                        .WithMany("Exceptions")
                        .HasForeignKey("ExtracurricularId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_extracurricular_exceptions_extracurriculars_extracurricular");

                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "PickupMember")
                        .WithMany()
                        .HasForeignKey("PickupMemberId")
                        .OnDelete(DeleteBehavior.SetNull)
                        .HasConstraintName("fk_extracurricular_exceptions_family_members_pickup_member_id");

                    b.Navigation("DropoffMember");

                    b.Navigation("Extracurricular");

                    b.Navigation("PickupMember");
                });

            modelBuilder.Entity("FamilyNido.Domain.School.SchoolDayException", b =>
                {
                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "DropoffMember")
                        .WithMany()
                        .HasForeignKey("DropoffMemberId")
                        .OnDelete(DeleteBehavior.SetNull)
                        .HasConstraintName("fk_school_day_exceptions_family_members_dropoff_member_id");

                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "FamilyMember")
                        .WithMany()
                        .HasForeignKey("FamilyMemberId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_school_day_exceptions_family_members_family_member_id");

                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "PickupMember")
                        .WithMany()
                        .HasForeignKey("PickupMemberId")
                        .OnDelete(DeleteBehavior.SetNull)
                        .HasConstraintName("fk_school_day_exceptions_family_members_pickup_member_id");

                    b.Navigation("DropoffMember");

                    b.Navigation("FamilyMember");

                    b.Navigation("PickupMember");
                });

            modelBuilder.Entity("FamilyNido.Domain.School.SchoolDaySchedule", b =>
                {
                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "DropoffMember")
                        .WithMany()
                        .HasForeignKey("DropoffMemberId")
                        .OnDelete(DeleteBehavior.SetNull)
                        .HasConstraintName("fk_school_day_schedules_family_members_dropoff_member_id");

                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "FamilyMember")
                        .WithMany()
                        .HasForeignKey("FamilyMemberId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_school_day_schedules_family_members_family_member_id");

                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "PickupMember")
                        .WithMany()
                        .HasForeignKey("PickupMemberId")
                        .OnDelete(DeleteBehavior.SetNull)
                        .HasConstraintName("fk_school_day_schedules_family_members_pickup_member_id");

                    b.Navigation("DropoffMember");

                    b.Navigation("FamilyMember");

                    b.Navigation("PickupMember");
                });

            modelBuilder.Entity("FamilyNido.Domain.School.SchoolHoliday", b =>
                {
                    b.HasOne("FamilyNido.Domain.Families.Family", "Family")
                        .WithMany()
                        .HasForeignKey("FamilyId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_school_holidays_families_family_id");

                    b.Navigation("Family");
                });

            modelBuilder.Entity("FamilyNido.Domain.School.SchoolProfile", b =>
                {
                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "FamilyMember")
                        .WithOne()
                        .HasForeignKey("FamilyNido.Domain.School.SchoolProfile", "FamilyMemberId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_school_profiles_family_members_family_member_id");

                    b.Navigation("FamilyMember");
                });

            modelBuilder.Entity("FamilyNido.Domain.Wall.WallComment", b =>
                {
                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "AuthorMember")
                        .WithMany()
                        .HasForeignKey("AuthorMemberId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired()
                        .HasConstraintName("fk_wall_comments_family_members_author_member_id");

                    b.HasOne("FamilyNido.Domain.Wall.WallMessage", "Message")
                        .WithMany("Comments")
                        .HasForeignKey("MessageId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_wall_comments_wall_messages_message_id");

                    b.Navigation("AuthorMember");

                    b.Navigation("Message");
                });

            modelBuilder.Entity("FamilyNido.Domain.Wall.WallCommentMention", b =>
                {
                    b.HasOne("FamilyNido.Domain.Wall.WallComment", "Comment")
                        .WithMany("Mentions")
                        .HasForeignKey("CommentId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_wall_comment_mentions_wall_comments_comment_id");

                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "FamilyMember")
                        .WithMany()
                        .HasForeignKey("FamilyMemberId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_wall_comment_mentions_family_members_family_member_id");

                    b.Navigation("Comment");

                    b.Navigation("FamilyMember");
                });

            modelBuilder.Entity("FamilyNido.Domain.Wall.WallMessage", b =>
                {
                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "AuthorMember")
                        .WithMany()
                        .HasForeignKey("AuthorMemberId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired()
                        .HasConstraintName("fk_wall_messages_family_members_author_member_id");

                    b.HasOne("FamilyNido.Domain.Families.Family", "Family")
                        .WithMany()
                        .HasForeignKey("FamilyId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired()
                        .HasConstraintName("fk_wall_messages_families_family_id");

                    b.HasOne("FamilyNido.Domain.Files.FileAsset", "ImageFile")
                        .WithMany()
                        .HasForeignKey("ImageFileId")
                        .OnDelete(DeleteBehavior.SetNull)
                        .HasConstraintName("fk_wall_messages_file_assets_image_file_id");

                    b.Navigation("AuthorMember");

                    b.Navigation("Family");

                    b.Navigation("ImageFile");
                });

            modelBuilder.Entity("FamilyNido.Domain.Wall.WallMessageMention", b =>
                {
                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "FamilyMember")
                        .WithMany()
                        .HasForeignKey("FamilyMemberId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_wall_message_mentions_family_members_family_member_id");

                    b.HasOne("FamilyNido.Domain.Wall.WallMessage", "Message")
                        .WithMany("Mentions")
                        .HasForeignKey("MessageId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_wall_message_mentions_wall_messages_message_id");

                    b.Navigation("FamilyMember");

                    b.Navigation("Message");
                });

            modelBuilder.Entity("FamilyNido.Domain.Wall.WallReaction", b =>
                {
                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", "Member")
                        .WithMany()
                        .HasForeignKey("MemberId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_wall_reactions_family_members_member_id");

                    b.HasOne("FamilyNido.Domain.Wall.WallMessage", "Message")
                        .WithMany("Reactions")
                        .HasForeignKey("MessageId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_wall_reactions_wall_messages_message_id");

                    b.Navigation("Member");

                    b.Navigation("Message");
                });

            modelBuilder.Entity("calendar_event_members", b =>
                {
                    b.HasOne("FamilyNido.Domain.Calendar.CalendarEvent", null)
                        .WithMany()
                        .HasForeignKey("calendar_event_id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_calendar_event_members_calendar_events_calendar_event_id");

                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", null)
                        .WithMany()
                        .HasForeignKey("family_member_id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_calendar_event_members_family_members_family_member_id");
                });

            modelBuilder.Entity("household_task_related_members", b =>
                {
                    b.HasOne("FamilyNido.Domain.Families.FamilyMember", null)
                        .WithMany()
                        .HasForeignKey("family_member_id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_household_task_related_members_family_members_family_member");

                    b.HasOne("FamilyNido.Domain.HouseholdTasks.HouseholdTask", null)
                        .WithMany()
                        .HasForeignKey("task_id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_household_task_related_members_household_tasks_task_id");
                });

            modelBuilder.Entity("FamilyNido.Domain.Calendar.GoogleAccount", b =>
                {
                    b.Navigation("Calendars");
                });

            modelBuilder.Entity("FamilyNido.Domain.Calendar.LinkedCalendar", b =>
                {
                    b.Navigation("Events");
                });

            modelBuilder.Entity("FamilyNido.Domain.Families.Family", b =>
                {
                    b.Navigation("Members");
                });

            modelBuilder.Entity("FamilyNido.Domain.HouseholdTasks.HouseholdTask", b =>
                {
                    b.Navigation("Completions");
                });

            modelBuilder.Entity("FamilyNido.Domain.Identity.User", b =>
                {
                    b.Navigation("Credentials");

                    b.Navigation("FamilyMember");
                });

            modelBuilder.Entity("FamilyNido.Domain.School.Extracurricular", b =>
                {
                    b.Navigation("Exceptions");
                });

            modelBuilder.Entity("FamilyNido.Domain.Wall.WallComment", b =>
                {
                    b.Navigation("Mentions");
                });

            modelBuilder.Entity("FamilyNido.Domain.Wall.WallMessage", b =>
                {
                    b.Navigation("Comments");

                    b.Navigation("Mentions");

                    b.Navigation("Reactions");
                });
#pragma warning restore 612, 618
        }
    }
}
