// using System; using Infrastructure; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace Infrastructure.Migrations { [DbContext(typeof(DatabaseContext))] partial class DatabaseContextModelSnapshot : ModelSnapshot { protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "9.0.0") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("Infrastructure.Models.ChangeRecord", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("ChangedAt") .HasColumnType("timestamp with time zone"); b.Property("SpendingGroupId") .HasColumnType("uuid"); b.Property("Sum") .HasColumnType("numeric"); b.Property("UserId") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("SpendingGroupId"); b.HasIndex("UserId"); b.ToTable("ChangeRecords"); }); modelBuilder.Entity("Infrastructure.Models.SpendingGroup", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("Name") .IsRequired() .HasColumnType("text"); b.Property("UserId") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("UserId"); b.ToTable("SpendingGroups"); }); modelBuilder.Entity("Infrastructure.Models.User", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("Balance") .HasColumnType("numeric"); b.Property("Name") .IsRequired() .HasColumnType("text"); b.Property("Password") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.ToTable("Users"); }); modelBuilder.Entity("Infrastructure.Models.ChangeRecord", b => { b.HasOne("Infrastructure.Models.SpendingGroup", "SpendingGroup") .WithMany() .HasForeignKey("SpendingGroupId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Infrastructure.Models.User", "User") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("SpendingGroup"); b.Navigation("User"); }); modelBuilder.Entity("Infrastructure.Models.SpendingGroup", b => { b.HasOne("Infrastructure.Models.User", "User") .WithMany("SpendingGroups") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("User"); }); modelBuilder.Entity("Infrastructure.Models.User", b => { b.Navigation("SpendingGroups"); }); #pragma warning restore 612, 618 } } }