// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using SmartAquaViewer.DataAnalisys;

#nullable disable

namespace SmartAquaViewer.Migrations
{
    [DbContext(typeof(AppDbContext))]
    [Migration("20250812043735_AddWaterQualityTable")]
    partial class AddWaterQualityTable
    {
        /// <inheritdoc />
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "8.0.1")
                .HasAnnotation("Relational:MaxIdentifierLength", 64);

            modelBuilder.Entity("SmartAquaViewer.DataAnalysis.WaterQualityVO", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<DateTime>("RecordedTime")
                        .HasColumnType("datetime(6)")
                        .HasColumnName("recorded_time");

                    b.HasKey("Id");

                    b.ToTable("water_quality");
                });

            modelBuilder.Entity("SmartAquaViewer.DataAnalysis.WaterQualityVO", b =>
                {
                    b.OwnsOne("SmartAquaViewer.DataAnalysis.FilteringSystem", "Filtering", b1 =>
                        {
                            b1.Property<int>("WaterQualityVOId")
                                .HasColumnType("int");

                            b1.Property<bool>("AirBlowerPower")
                                .HasColumnType("tinyint(1)")
                                .HasColumnName("filter_air_blower_power");

                            b1.Property<bool>("CirculationPumpPower")
                                .HasColumnType("tinyint(1)")
                                .HasColumnName("filter_circulation_pump_power");

                            b1.Property<double>("FlowRate")
                                .HasColumnType("double")
                                .HasColumnName("filter_flow_rate");

                            b1.Property<bool>("HeatPumpPower")
                                .HasColumnType("tinyint(1)")
                                .HasColumnName("filter_heat_pump_power");

                            b1.Property<double>("HeatPumpTemperature")
                                .HasColumnType("double")
                                .HasColumnName("filter_heat_pump_temperature");

                            b1.Property<string>("InverterControllerStatus")
                                .HasColumnType("longtext")
                                .HasColumnName("filter_inverter_status");

                            b1.Property<bool>("SandFilterPower")
                                .HasColumnType("tinyint(1)")
                                .HasColumnName("filter_sand_filter_power");

                            b1.Property<double>("SumpFlowRate")
                                .HasColumnType("double")
                                .HasColumnName("filter_sump_flow_rate");

                            b1.Property<double>("SumpORP")
                                .HasColumnType("double")
                                .HasColumnName("filter_sump_orp");

                            b1.Property<double>("SumpPH")
                                .HasColumnType("double")
                                .HasColumnName("filter_sump_ph");

                            b1.Property<double>("SumpTemperature")
                                .HasColumnType("double")
                                .HasColumnName("filter_sump_temperature");

                            b1.Property<double>("SumpWaterLevel")
                                .HasColumnType("double")
                                .HasColumnName("filter_sump_water_level");

                            b1.HasKey("WaterQualityVOId");

                            b1.ToTable("water_quality");

                            b1.WithOwner()
                                .HasForeignKey("WaterQualityVOId");
                        });

                    b.OwnsOne("SmartAquaViewer.DataAnalysis.SterilizingSystem", "Sterilizing", b1 =>
                        {
                            b1.Property<int>("WaterQualityVOId")
                                .HasColumnType("int");

                            b1.Property<bool>("ExcessOzoneDestroyerPower")
                                .HasColumnType("tinyint(1)")
                                .HasColumnName("ster_excess_ozone_destroyer_power");

                            b1.Property<bool>("OzoneDissolverPower")
                                .HasColumnType("tinyint(1)")
                                .HasColumnName("ster_ozone_dissolver_power");

                            b1.Property<double>("OzoneDissolverPressure")
                                .HasColumnType("double")
                                .HasColumnName("ster_ozone_dissolver_pressure");

                            b1.Property<bool>("OzoneGeneratorPower")
                                .HasColumnType("tinyint(1)")
                                .HasColumnName("ster_ozone_generator_power");

                            b1.Property<string>("UVSterilizerId")
                                .IsRequired()
                                .HasColumnType("longtext")
                                .HasColumnName("ster_uv_sterilizer_id");

                            b1.Property<bool>("UVSterilizerPower")
                                .HasColumnType("tinyint(1)")
                                .HasColumnName("ster_uv_sterilizer_power");

                            b1.HasKey("WaterQualityVOId");

                            b1.ToTable("water_quality");

                            b1.WithOwner()
                                .HasForeignKey("WaterQualityVOId");
                        });

                    b.OwnsOne("SmartAquaViewer.DataAnalysis.WaterTank", "Tank", b1 =>
                        {
                            b1.Property<int>("WaterQualityVOId")
                                .HasColumnType("int");

                            b1.Property<double>("DOValue")
                                .HasColumnType("double")
                                .HasColumnName("tank_do_value");

                            b1.Property<double>("FlowRate")
                                .HasColumnType("double")
                                .HasColumnName("tank_flow_rate");

                            b1.Property<int>("Number")
                                .HasColumnType("int")
                                .HasColumnName("tank_number");

                            b1.Property<double>("ORP")
                                .HasColumnType("double")
                                .HasColumnName("tank_orp");

                            b1.Property<double>("PH")
                                .HasColumnType("double")
                                .HasColumnName("tank_ph");

                            b1.Property<double>("Temperature")
                                .HasColumnType("double")
                                .HasColumnName("tank_temperature");

                            b1.HasKey("WaterQualityVOId");

                            b1.ToTable("water_quality");

                            b1.WithOwner()
                                .HasForeignKey("WaterQualityVOId");
                        });

                    b.Navigation("Filtering")
                        .IsRequired();

                    b.Navigation("Sterilizing")
                        .IsRequired();

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