PIbd-23_Sergunov_M.A._SUBD/BookShop/BookShopDataBaseImplement/Migrations/BookShopDatabaseModelSnapshot.cs
2023-05-12 12:35:01 +04:00

253 lines
8.5 KiB
C#

// <auto-generated />
using System;
using BookShopDataBaseImplement;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace BookShopDataBaseImplement.Migrations
{
[DbContext(typeof(BookShopDatabase))]
partial class BookShopDatabaseModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.5")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("BookShopDataBaseImplement.Models.Author", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("AuthorName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("AuthorPatronymic")
.IsRequired()
.HasColumnType("text");
b.Property<string>("AuthorSurname")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Authors");
});
modelBuilder.Entity("BookShopDataBaseImplement.Models.Book", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("BookName")
.IsRequired()
.HasColumnType("text");
b.Property<double>("Cost")
.HasColumnType("double precision");
b.Property<int>("Count")
.HasColumnType("integer");
b.Property<int>("GenreId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("GenreId");
b.ToTable("Books");
});
modelBuilder.Entity("BookShopDataBaseImplement.Models.BookAuthor", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("AuthorId")
.HasColumnType("integer");
b.Property<int>("BookId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("AuthorId");
b.HasIndex("BookId");
b.ToTable("BookAuthors");
});
modelBuilder.Entity("BookShopDataBaseImplement.Models.Client", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ClientName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("ClientPatronymic")
.IsRequired()
.HasColumnType("text");
b.Property<string>("ClientSurname")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Clients");
});
modelBuilder.Entity("BookShopDataBaseImplement.Models.Genre", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("GenreName")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Genres");
});
modelBuilder.Entity("BookShopDataBaseImplement.Models.Order", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("BookId")
.HasColumnType("integer");
b.Property<int>("ClientId")
.HasColumnType("integer");
b.Property<int>("Count")
.HasColumnType("integer");
b.Property<DateTime>("DateCreate")
.HasColumnType("timestamp with time zone");
b.Property<double>("Sum")
.HasColumnType("double precision");
b.HasKey("Id");
b.HasIndex("BookId");
b.HasIndex("ClientId");
b.ToTable("Orders");
});
modelBuilder.Entity("BookShopDataBaseImplement.Models.Book", b =>
{
b.HasOne("BookShopDataBaseImplement.Models.Genre", "Genre")
.WithMany("Books")
.HasForeignKey("GenreId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Genre");
});
modelBuilder.Entity("BookShopDataBaseImplement.Models.BookAuthor", b =>
{
b.HasOne("BookShopDataBaseImplement.Models.Author", "Author")
.WithMany("BookAuthors")
.HasForeignKey("AuthorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BookShopDataBaseImplement.Models.Book", "Book")
.WithMany("Authors")
.HasForeignKey("BookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Author");
b.Navigation("Book");
});
modelBuilder.Entity("BookShopDataBaseImplement.Models.Order", b =>
{
b.HasOne("BookShopDataBaseImplement.Models.Book", "Book")
.WithMany("Orders")
.HasForeignKey("BookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BookShopDataBaseImplement.Models.Client", "Client")
.WithMany("Orders")
.HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Book");
b.Navigation("Client");
});
modelBuilder.Entity("BookShopDataBaseImplement.Models.Author", b =>
{
b.Navigation("BookAuthors");
});
modelBuilder.Entity("BookShopDataBaseImplement.Models.Book", b =>
{
b.Navigation("Authors");
b.Navigation("Orders");
});
modelBuilder.Entity("BookShopDataBaseImplement.Models.Client", b =>
{
b.Navigation("Orders");
});
modelBuilder.Entity("BookShopDataBaseImplement.Models.Genre", b =>
{
b.Navigation("Books");
});
#pragma warning restore 612, 618
}
}
}