2023-02-27 21:51:16 +04:00
|
|
|
|
// <auto-generated />
|
|
|
|
|
using System;
|
|
|
|
|
using FoodOrdersDatabaseImplement;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
|
|
|
|
|
|
|
|
#nullable disable
|
|
|
|
|
|
|
|
|
|
namespace FoodOrdersDatabaseImplement.Migrations
|
|
|
|
|
{
|
|
|
|
|
[DbContext(typeof(FoodOrdersDatabase))]
|
|
|
|
|
partial class FoodOrdersDatabaseModelSnapshot : ModelSnapshot
|
|
|
|
|
{
|
|
|
|
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
|
|
|
{
|
|
|
|
|
#pragma warning disable 612, 618
|
|
|
|
|
modelBuilder
|
2023-04-09 19:04:18 +04:00
|
|
|
|
.HasAnnotation("ProductVersion", "7.0.3")
|
2023-02-27 21:51:16 +04:00
|
|
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
|
|
|
|
|
|
|
|
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
|
|
|
|
|
2023-03-25 20:38:11 +04:00
|
|
|
|
modelBuilder.Entity("FoodOrdersDatabaseImplement.Models.Client", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<string>("ClientFIO")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Email")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Password")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
2023-03-25 21:14:39 +04:00
|
|
|
|
b.ToTable("Clients");
|
2023-03-25 20:38:11 +04:00
|
|
|
|
});
|
|
|
|
|
|
2023-02-27 21:51:16 +04:00
|
|
|
|
modelBuilder.Entity("FoodOrdersDatabaseImplement.Models.Component", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<string>("ComponentName")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.Property<double>("Cost")
|
|
|
|
|
.HasColumnType("float");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
2023-04-09 19:04:18 +04:00
|
|
|
|
b.ToTable("Components");
|
2023-02-27 21:51:16 +04:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("FoodOrdersDatabaseImplement.Models.Dish", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<string>("DishName")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.Property<double>("Price")
|
|
|
|
|
.HasColumnType("float");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
2023-04-09 19:04:18 +04:00
|
|
|
|
b.ToTable("Dishes");
|
2023-02-27 21:51:16 +04:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("FoodOrdersDatabaseImplement.Models.DishComponent", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<int>("ComponentId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("Count")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("DishId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("ComponentId");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("DishId");
|
|
|
|
|
|
2023-04-09 19:04:18 +04:00
|
|
|
|
b.ToTable("DishComponents");
|
2023-02-27 21:51:16 +04:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("FoodOrdersDatabaseImplement.Models.Order", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
2023-03-25 20:38:11 +04:00
|
|
|
|
b.Property<int>("ClientId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
2023-02-27 21:51:16 +04:00
|
|
|
|
b.Property<int>("Count")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<DateTime>("DateCreate")
|
|
|
|
|
.HasColumnType("datetime2");
|
|
|
|
|
|
|
|
|
|
b.Property<DateTime?>("DateImplement")
|
|
|
|
|
.HasColumnType("datetime2");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("DishId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("Status")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<double>("Sum")
|
|
|
|
|
.HasColumnType("float");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
2023-03-25 20:38:11 +04:00
|
|
|
|
b.HasIndex("ClientId");
|
|
|
|
|
|
2023-02-27 21:51:16 +04:00
|
|
|
|
b.HasIndex("DishId");
|
|
|
|
|
|
2023-04-09 19:04:18 +04:00
|
|
|
|
b.ToTable("Orders");
|
2023-02-27 21:51:16 +04:00
|
|
|
|
});
|
|
|
|
|
|
2023-03-24 00:40:30 +04:00
|
|
|
|
modelBuilder.Entity("FoodOrdersDatabaseImplement.Models.Shop", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Address")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("Capacity")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<DateTime>("DateOfOpening")
|
|
|
|
|
.HasColumnType("datetime2");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("ShopName")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Shops");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("FoodOrdersDatabaseImplement.Models.ShopDish", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<int>("Count")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("DishId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("ShopId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("DishId");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("ShopId");
|
|
|
|
|
|
|
|
|
|
b.ToTable("ShopDishes");
|
|
|
|
|
});
|
|
|
|
|
|
2023-02-27 21:51:16 +04:00
|
|
|
|
modelBuilder.Entity("FoodOrdersDatabaseImplement.Models.DishComponent", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("FoodOrdersDatabaseImplement.Models.Component", "Component")
|
|
|
|
|
.WithMany("DishComponents")
|
|
|
|
|
.HasForeignKey("ComponentId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.HasOne("FoodOrdersDatabaseImplement.Models.Dish", "Dish")
|
|
|
|
|
.WithMany("Components")
|
|
|
|
|
.HasForeignKey("DishId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("Component");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Dish");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("FoodOrdersDatabaseImplement.Models.Order", b =>
|
|
|
|
|
{
|
2023-03-25 20:38:11 +04:00
|
|
|
|
b.HasOne("FoodOrdersDatabaseImplement.Models.Client", "Client")
|
2023-03-31 15:16:35 +04:00
|
|
|
|
.WithMany("Orders")
|
2023-03-25 20:38:11 +04:00
|
|
|
|
.HasForeignKey("ClientId")
|
2023-02-27 21:51:16 +04:00
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
2023-03-24 00:40:30 +04:00
|
|
|
|
b.HasOne("FoodOrdersDatabaseImplement.Models.Dish", "Dish")
|
2023-03-31 15:16:35 +04:00
|
|
|
|
.WithMany("Orders")
|
2023-03-24 00:40:30 +04:00
|
|
|
|
.HasForeignKey("DishId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
2023-03-25 20:38:11 +04:00
|
|
|
|
b.Navigation("Client");
|
2023-03-24 00:40:30 +04:00
|
|
|
|
|
|
|
|
|
b.Navigation("Dish");
|
|
|
|
|
});
|
|
|
|
|
|
2023-04-09 20:02:45 +04:00
|
|
|
|
modelBuilder.Entity("FoodOrdersDatabaseImplement.Models.ShopDish", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("FoodOrdersDatabaseImplement.Models.Dish", "Dish")
|
|
|
|
|
.WithMany()
|
|
|
|
|
.HasForeignKey("DishId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.HasOne("FoodOrdersDatabaseImplement.Models.Shop", "Shop")
|
|
|
|
|
.WithMany("Dishes")
|
|
|
|
|
.HasForeignKey("ShopId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("Dish");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Shop");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("FoodOrdersDatabaseImplement.Models.Client", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Navigation("Orders");
|
|
|
|
|
});
|
|
|
|
|
|
2023-02-27 21:51:16 +04:00
|
|
|
|
modelBuilder.Entity("FoodOrdersDatabaseImplement.Models.Component", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Navigation("DishComponents");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("FoodOrdersDatabaseImplement.Models.Dish", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Navigation("Components");
|
2023-03-31 15:16:35 +04:00
|
|
|
|
|
|
|
|
|
b.Navigation("Orders");
|
2023-02-27 21:51:16 +04:00
|
|
|
|
});
|
2023-03-24 00:40:30 +04:00
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("FoodOrdersDatabaseImplement.Models.Shop", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Navigation("Dishes");
|
|
|
|
|
});
|
2023-02-27 21:51:16 +04:00
|
|
|
|
#pragma warning restore 612, 618
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|