250 lines
8.3 KiB
C#
250 lines
8.3 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using BookShopDataBaseImplement;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
|
|
#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", 128);
|
|
|
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("BookShopDataBaseImplement.Models.Author", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("AuthorName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("AuthorPatronymic")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("AuthorSurname")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Authors");
|
|
});
|
|
|
|
modelBuilder.Entity("BookShopDataBaseImplement.Models.Book", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("BookName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<double>("Cost")
|
|
.HasColumnType("float");
|
|
|
|
b.Property<int>("GenreId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("GenreId");
|
|
|
|
b.ToTable("Books");
|
|
});
|
|
|
|
modelBuilder.Entity("BookShopDataBaseImplement.Models.BookAuthor", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("AuthorId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("BookId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AuthorId");
|
|
|
|
b.HasIndex("BookId");
|
|
|
|
b.ToTable("BookAuthors");
|
|
});
|
|
|
|
modelBuilder.Entity("BookShopDataBaseImplement.Models.Client", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("ClientName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("ClientPatronymic")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("ClientSurname")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Email")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Clients");
|
|
});
|
|
|
|
modelBuilder.Entity("BookShopDataBaseImplement.Models.Genre", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("GenreName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Genres");
|
|
});
|
|
|
|
modelBuilder.Entity("BookShopDataBaseImplement.Models.Order", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("BookId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("ClientId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("Count")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("DateCreate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<double>("Sum")
|
|
.HasColumnType("float");
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|