domBudg/back/Infrastructure/Migrations/DatabaseContextModelSnapshot.cs

175 lines
5.7 KiB
C#

// <auto-generated />
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<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTime>("ChangedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid?>("SpendingGroupId")
.HasColumnType("uuid");
b.Property<decimal>("Sum")
.HasColumnType("numeric");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("SpendingGroupId");
b.HasIndex("UserId");
b.ToTable("ChangeRecords");
});
modelBuilder.Entity("Infrastructure.Models.SpendingGroup", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("SpendingGroups");
});
modelBuilder.Entity("Infrastructure.Models.SpendingPlan", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTime>("EndAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("SpendingGroupId")
.HasColumnType("uuid");
b.Property<DateTime>("StartAt")
.HasColumnType("timestamp with time zone");
b.Property<decimal>("Sum")
.HasColumnType("numeric");
b.HasKey("Id");
b.HasIndex("SpendingGroupId");
b.ToTable("SpendingPlans");
});
modelBuilder.Entity("Infrastructure.Models.User", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<decimal>("Balance")
.HasColumnType("numeric");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Users");
});
modelBuilder.Entity("Infrastructure.Models.ChangeRecord", b =>
{
b.HasOne("Infrastructure.Models.SpendingGroup", "SpendingGroup")
.WithMany("ChangeRecords")
.HasForeignKey("SpendingGroupId");
b.HasOne("Infrastructure.Models.User", "User")
.WithMany("ChangeRecords")
.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.SpendingPlan", b =>
{
b.HasOne("Infrastructure.Models.SpendingGroup", "SpendingGroup")
.WithMany("SpendingPlans")
.HasForeignKey("SpendingGroupId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("SpendingGroup");
});
modelBuilder.Entity("Infrastructure.Models.SpendingGroup", b =>
{
b.Navigation("ChangeRecords");
b.Navigation("SpendingPlans");
});
modelBuilder.Entity("Infrastructure.Models.User", b =>
{
b.Navigation("ChangeRecords");
b.Navigation("SpendingGroups");
});
#pragma warning restore 612, 618
}
}
}