// using Cloud; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace Cloud.Migrations { [DbContext(typeof(ApplicationContext))] [Migration("20241030111034_front")] partial class front { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "6.0.14") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("Cloud.Models.Farm", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Name") .IsRequired() .HasColumnType("text"); b.Property("RaspberryMacAddr") .IsRequired() .HasColumnType("text"); b.Property("UserId") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("UserId"); b.ToTable("Farms"); }); modelBuilder.Entity("Cloud.Models.User", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Email") .IsRequired() .HasColumnType("text"); b.Property("Name") .IsRequired() .HasColumnType("text"); b.Property("Password") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.ToTable("Users"); }); modelBuilder.Entity("Cloud.Models.Farm", b => { b.HasOne("Cloud.Models.User", "User") .WithMany("Farms") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("User"); }); modelBuilder.Entity("Cloud.Models.User", b => { b.Navigation("Farms"); }); #pragma warning restore 612, 618 } } }