Files
PlantPal/SoilMoistureAPI/Migrations/SoilMoistureContextModelSnapshot.cs
programmingPug 0f190a3f26 Major rewrite
2025-01-14 14:47:10 -05:00

77 lines
2.4 KiB
C#

// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using SoilMoistureAPI.Data;
#nullable disable
namespace SoilMoistureAPI.Migrations
{
[DbContext(typeof(SoilMoistureContext))]
partial class SoilMoistureContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "9.0.0");
modelBuilder.Entity("SoilMoistureAPI.Models.Device", b =>
{
b.Property<string>("DeviceId")
.HasColumnType("TEXT");
b.Property<string>("Nickname")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.HasKey("DeviceId");
b.ToTable("Devices");
});
modelBuilder.Entity("SoilMoistureAPI.Models.SoilMoisture", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("DeviceId")
.IsRequired()
.HasColumnType("TEXT");
b.Property<float>("MoistureLevel")
.HasColumnType("REAL");
b.Property<DateTime>("Timestamp")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("DeviceId");
b.ToTable("SoilMoistures");
});
modelBuilder.Entity("SoilMoistureAPI.Models.SoilMoisture", b =>
{
b.HasOne("SoilMoistureAPI.Models.Device", "Device")
.WithMany("SoilMoistures")
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Device");
});
modelBuilder.Entity("SoilMoistureAPI.Models.Device", b =>
{
b.Navigation("SoilMoistures");
});
#pragma warning restore 612, 618
}
}
}