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

namespace MeteoWebApp.Migrations
{
    [DbContext(typeof(MeteoDbContext))]
    [Migration("20220401141515_Initial")]
    partial class Initial
    {
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("Relational:MaxIdentifierLength", 64)
                .HasAnnotation("ProductVersion", "5.0.11");

            modelBuilder.Entity("MeteoWebApp.Models.Measurement", b =>
                {
                    b.Property<int>("MeasurementId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<float>("BatteryVoltage")
                        .HasColumnType("float");

                    b.Property<float>("DewPoint")
                        .HasColumnType("float");

                    b.Property<float>("Humidity")
                        .HasColumnType("float");

                    b.Property<float>("Pressure")
                        .HasColumnType("float");

                    b.Property<float>("RainAmount")
                        .HasColumnType("float");

                    b.Property<float>("SeaLevelPressure")
                        .HasColumnType("float");

                    b.Property<float>("SoilMoisture1")
                        .HasColumnType("float");

                    b.Property<float>("SoilMoisture2")
                        .HasColumnType("float");

                    b.Property<float>("SoilMoisture3")
                        .HasColumnType("float");

                    b.Property<string>("SoilMoistureDepth1")
                        .HasMaxLength(16)
                        .HasColumnType("varchar(16)");

                    b.Property<string>("SoilMoistureDepth2")
                        .HasMaxLength(16)
                        .HasColumnType("varchar(16)");

                    b.Property<string>("SoilMoistureDepth3")
                        .HasMaxLength(16)
                        .HasColumnType("varchar(16)");

                    b.Property<float>("SoilTemp1")
                        .HasColumnType("float");

                    b.Property<float>("SoilTemp2")
                        .HasColumnType("float");

                    b.Property<float>("SoilTemp3")
                        .HasColumnType("float");

                    b.Property<string>("SoilTempDepth1")
                        .HasMaxLength(16)
                        .HasColumnType("varchar(16)");

                    b.Property<string>("SoilTempDepth2")
                        .HasMaxLength(16)
                        .HasColumnType("varchar(16)");

                    b.Property<string>("SoilTempDepth3")
                        .HasMaxLength(16)
                        .HasColumnType("varchar(16)");

                    b.Property<int>("StationId")
                        .HasColumnType("int");

                    b.Property<float>("Temperature")
                        .HasColumnType("float");

                    b.Property<float>("TemperatureFeelsLike")
                        .HasColumnType("float");

                    b.Property<DateTime>("Timestamp")
                        .HasColumnType("datetime");

                    b.Property<float>("UvIndex")
                        .HasColumnType("float");

                    b.Property<float>("WindAngle")
                        .HasColumnType("float");

                    b.Property<string>("WindAngleStr")
                        .HasMaxLength(3)
                        .HasColumnType("varchar(3)");

                    b.Property<float>("WindSpeed")
                        .HasColumnType("float");

                    b.HasKey("MeasurementId");

                    b.HasIndex("StationId");

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

            modelBuilder.Entity("MeteoWebApp.Models.Station", b =>
                {
                    b.Property<int>("StationId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<byte[]>("ApiKey")
                        .IsRequired()
                        .HasColumnType("varbinary(16)");

                    b.Property<float>("GpsLatitude")
                        .HasColumnType("float");

                    b.Property<float>("GpsLongitude")
                        .HasColumnType("float");

                    b.Property<string>("Name")
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)");

                    b.HasKey("StationId");

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

            modelBuilder.Entity("MeteoWebApp.Models.Measurement", b =>
                {
                    b.HasOne("MeteoWebApp.Models.Station", "Station")
                        .WithMany("Measurements")
                        .HasForeignKey("StationId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("MeteoWebApp.Models.Station", b =>
                {
                    b.Navigation("Measurements");
                });
#pragma warning restore 612, 618
        }
    }
}
