// using System; using ConfectioneryDatabaseImplement; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; #nullable disable namespace ConfectioneryDatabaseImplement.Migrations { [DbContext(typeof(ConfectioneryDatabase))] [Migration("20240621080649_InitialCreate")] partial class InitialCreate { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "7.0.17") .HasAnnotation("Relational:MaxIdentifierLength", 128); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.Component", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("ComponentName") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("Cost") .HasColumnType("float"); b.HasKey("Id"); b.ToTable("Components"); }); modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.Order", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("Count") .HasColumnType("int"); b.Property("DateCreate") .HasColumnType("datetime2"); b.Property("DateImplement") .HasColumnType("datetime2"); b.Property("PastryId") .HasColumnType("int"); b.Property("Status") .HasColumnType("int"); b.Property("Sum") .HasColumnType("float"); b.HasKey("Id"); b.HasIndex("PastryId"); b.ToTable("Orders"); }); modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.Pastry", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("PastryName") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("Price") .HasColumnType("float"); b.HasKey("Id"); b.ToTable("Pastries"); }); modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.PastryComponent", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("ComponentId") .HasColumnType("int"); b.Property("Count") .HasColumnType("int"); b.Property("PastryId") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("ComponentId"); b.HasIndex("PastryId"); b.ToTable("PastryComponents"); }); modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.Shop", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("Address") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("DateOpening") .HasColumnType("datetime2"); b.Property("PastriesMaximum") .HasColumnType("int"); b.Property("ShopName") .IsRequired() .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.ToTable("Shops"); }); modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.ShopPastry", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("Count") .HasColumnType("int"); b.Property("PastryId") .HasColumnType("int"); b.Property("ShopId") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("PastryId"); b.HasIndex("ShopId"); b.ToTable("ShopPastries"); }); modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.Order", b => { b.HasOne("ConfectioneryDatabaseImplement.Models.Pastry", "Pastry") .WithMany("Orders") .HasForeignKey("PastryId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Pastry"); }); modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.PastryComponent", b => { b.HasOne("ConfectioneryDatabaseImplement.Models.Component", "Component") .WithMany("ProductComponents") .HasForeignKey("ComponentId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("ConfectioneryDatabaseImplement.Models.Pastry", "Pastry") .WithMany("Components") .HasForeignKey("PastryId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Component"); b.Navigation("Pastry"); }); modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.ShopPastry", b => { b.HasOne("ConfectioneryDatabaseImplement.Models.Pastry", "Pastry") .WithMany() .HasForeignKey("PastryId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("ConfectioneryDatabaseImplement.Models.Shop", "Shop") .WithMany("Pastries") .HasForeignKey("ShopId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Pastry"); b.Navigation("Shop"); }); modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.Component", b => { b.Navigation("ProductComponents"); }); modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.Pastry", b => { b.Navigation("Components"); b.Navigation("Orders"); }); modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.Shop", b => { b.Navigation("Pastries"); }); #pragma warning restore 612, 618 } } }