PIbd-21_BatylkinaAO_MusoevD.../Canteen/CanteenDatabaseImplement/Migrations/20230519185610_Init.Designer.cs

630 lines
21 KiB
C#
Raw Normal View History

2023-04-09 00:34:25 +04:00
// <auto-generated />
using System;
using CanteenDatabaseImplement;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace CanteenDatabaseImplement.Migrations
{
[DbContext(typeof(CanteenDatabase))]
2023-05-20 00:18:48 +04:00
[Migration("20230519185610_Init")]
2023-05-19 03:39:58 +04:00
partial class Init
2023-04-09 00:34:25 +04:00
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.4")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("CanteenDatabaseImplement.Models.Cook", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("FIO")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("ManagerId")
.HasColumnType("int");
b.Property<string>("Position")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("ManagerId");
b.ToTable("Cooks");
});
modelBuilder.Entity("CanteenDatabaseImplement.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<int>("ManagerId")
.HasColumnType("int");
b.Property<double>("Price")
.HasColumnType("float");
b.HasKey("Id");
b.HasIndex("ManagerId");
b.ToTable("Dishes");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.DishProduct", b =>
{
2023-05-19 03:39:58 +04:00
b.Property<int>("Id")
.ValueGeneratedOnAdd()
2023-04-09 00:34:25 +04:00
.HasColumnType("int");
2023-05-19 03:39:58 +04:00
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
2023-04-09 00:34:25 +04:00
b.Property<int>("CountProducts")
.HasColumnType("int");
2023-05-19 03:39:58 +04:00
b.Property<int>("DishId")
.HasColumnType("int");
b.Property<int>("ProductId")
2023-04-09 00:34:25 +04:00
.HasColumnType("int");
2023-05-19 03:39:58 +04:00
b.HasKey("Id");
b.HasIndex("DishId");
2023-04-09 00:34:25 +04:00
b.HasIndex("ProductId");
b.ToTable("DishProduct");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Lunch", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("DateCreate")
.HasColumnType("datetime2");
b.Property<DateTime?>("DateImplement")
.HasColumnType("datetime2");
b.Property<string>("LunchName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<double>("Sum")
.HasColumnType("float");
b.Property<int>("VisitorId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("VisitorId");
b.ToTable("Lunches");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.LunchOrder", b =>
{
2023-05-19 03:39:58 +04:00
b.Property<int>("Id")
.ValueGeneratedOnAdd()
2023-04-09 00:34:25 +04:00
.HasColumnType("int");
2023-05-19 03:39:58 +04:00
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
2023-04-09 00:34:25 +04:00
2023-05-19 03:39:58 +04:00
b.Property<int>("LunchId")
2023-04-09 00:34:25 +04:00
.HasColumnType("int");
2023-05-19 03:39:58 +04:00
b.Property<int>("OrderId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("LunchId");
2023-04-09 00:34:25 +04:00
b.HasIndex("OrderId");
b.ToTable("LunchOrder");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.LunchProduct", b =>
{
2023-05-19 03:39:58 +04:00
b.Property<int>("Id")
.ValueGeneratedOnAdd()
2023-04-09 00:34:25 +04:00
.HasColumnType("int");
2023-05-19 03:39:58 +04:00
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
2023-04-09 00:34:25 +04:00
b.Property<int>("CountProducts")
.HasColumnType("int");
2023-05-19 03:39:58 +04:00
b.Property<int>("LunchId")
2023-04-09 00:34:25 +04:00
.HasColumnType("int");
2023-05-19 03:39:58 +04:00
b.Property<int>("ProductId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("LunchId");
2023-04-09 00:34:25 +04:00
b.HasIndex("ProductId");
b.ToTable("LunchProduct");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Manager", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("FIO")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Login")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PhoneNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Managers");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Order", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("VisitorId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("VisitorId");
b.ToTable("Orders");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.OrderCook", b =>
{
2023-05-19 03:39:58 +04:00
b.Property<int>("Id")
.ValueGeneratedOnAdd()
2023-04-09 00:34:25 +04:00
.HasColumnType("int");
2023-05-19 03:39:58 +04:00
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
2023-04-09 00:34:25 +04:00
b.Property<int>("CookId")
.HasColumnType("int");
2023-05-19 03:39:58 +04:00
b.Property<int>("OrderId")
2023-04-09 00:34:25 +04:00
.HasColumnType("int");
2023-05-19 03:39:58 +04:00
b.HasKey("Id");
2023-04-09 00:34:25 +04:00
b.HasIndex("CookId");
2023-05-19 03:39:58 +04:00
b.HasIndex("OrderId");
2023-04-09 00:34:25 +04:00
b.ToTable("OrderCook");
});
2023-05-19 03:39:58 +04:00
modelBuilder.Entity("CanteenDatabaseImplement.Models.OrderTableware", b =>
2023-04-09 00:34:25 +04:00
{
2023-05-19 03:39:58 +04:00
b.Property<int>("Id")
.ValueGeneratedOnAdd()
2023-04-09 00:34:25 +04:00
.HasColumnType("int");
2023-05-19 03:39:58 +04:00
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CountTablewares")
2023-04-09 00:34:25 +04:00
.HasColumnType("int");
2023-05-19 03:39:58 +04:00
b.Property<int>("OrderId")
2023-04-09 00:34:25 +04:00
.HasColumnType("int");
2023-05-19 03:39:58 +04:00
b.Property<int>("TablewareId")
2023-04-09 00:34:25 +04:00
.HasColumnType("int");
2023-05-19 03:39:58 +04:00
b.HasKey("Id");
2023-04-09 00:34:25 +04:00
2023-05-19 03:39:58 +04:00
b.HasIndex("OrderId");
b.HasIndex("TablewareId");
2023-04-09 00:34:25 +04:00
2023-05-19 03:39:58 +04:00
b.ToTable("OrderTableware");
2023-04-09 00:34:25 +04:00
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Product", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("ManagerId")
.HasColumnType("int");
b.Property<double>("Price")
.HasColumnType("float");
b.Property<string>("ProductName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("ManagerId");
b.ToTable("Products");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.ProductCook", b =>
{
2023-05-19 03:39:58 +04:00
b.Property<int>("Id")
.ValueGeneratedOnAdd()
2023-04-09 00:34:25 +04:00
.HasColumnType("int");
2023-05-19 03:39:58 +04:00
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
2023-04-09 00:34:25 +04:00
b.Property<int>("CookId")
.HasColumnType("int");
2023-05-19 03:39:58 +04:00
b.Property<int>("ProductId")
2023-04-09 00:34:25 +04:00
.HasColumnType("int");
2023-05-19 03:39:58 +04:00
b.HasKey("Id");
2023-04-09 00:34:25 +04:00
b.HasIndex("CookId");
2023-05-19 03:39:58 +04:00
b.HasIndex("ProductId");
2023-04-09 00:34:25 +04:00
b.ToTable("ProductCook");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Tableware", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("TablewareName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("VisitorId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("VisitorId");
b.ToTable("Tablewares");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Visitor", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("FIO")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Login")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PhoneNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Visitors");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Cook", b =>
{
b.HasOne("CanteenDatabaseImplement.Models.Manager", "Manager")
.WithMany("Cooks")
.HasForeignKey("ManagerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Manager");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Dish", b =>
{
b.HasOne("CanteenDatabaseImplement.Models.Manager", "Manager")
.WithMany("Dishes")
.HasForeignKey("ManagerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Manager");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.DishProduct", b =>
{
b.HasOne("CanteenDatabaseImplement.Models.Dish", "Dish")
.WithMany("Products")
.HasForeignKey("DishId")
2023-05-20 00:18:48 +04:00
.OnDelete(DeleteBehavior.Restrict)
2023-04-09 00:34:25 +04:00
.IsRequired();
b.HasOne("CanteenDatabaseImplement.Models.Product", "Product")
.WithMany("Dishes")
.HasForeignKey("ProductId")
2023-05-20 00:18:48 +04:00
.OnDelete(DeleteBehavior.Restrict)
2023-04-09 00:34:25 +04:00
.IsRequired();
b.Navigation("Dish");
b.Navigation("Product");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Lunch", b =>
{
b.HasOne("CanteenDatabaseImplement.Models.Visitor", "Visitor")
.WithMany("Lunches")
.HasForeignKey("VisitorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Visitor");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.LunchOrder", b =>
{
b.HasOne("CanteenDatabaseImplement.Models.Lunch", "Lunch")
.WithMany("Orders")
.HasForeignKey("LunchId")
2023-05-20 00:18:48 +04:00
.OnDelete(DeleteBehavior.Restrict)
2023-04-09 00:34:25 +04:00
.IsRequired();
b.HasOne("CanteenDatabaseImplement.Models.Order", "Order")
.WithMany("Lunches")
.HasForeignKey("OrderId")
2023-05-20 00:18:48 +04:00
.OnDelete(DeleteBehavior.Restrict)
2023-04-09 00:34:25 +04:00
.IsRequired();
b.Navigation("Lunch");
b.Navigation("Order");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.LunchProduct", b =>
{
b.HasOne("CanteenDatabaseImplement.Models.Lunch", "Lunch")
.WithMany("Products")
.HasForeignKey("LunchId")
2023-05-20 00:18:48 +04:00
.OnDelete(DeleteBehavior.Restrict)
2023-04-09 00:34:25 +04:00
.IsRequired();
b.HasOne("CanteenDatabaseImplement.Models.Product", "Product")
.WithMany("Lunches")
.HasForeignKey("ProductId")
2023-05-20 00:18:48 +04:00
.OnDelete(DeleteBehavior.Restrict)
2023-04-09 00:34:25 +04:00
.IsRequired();
b.Navigation("Lunch");
b.Navigation("Product");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Order", b =>
{
b.HasOne("CanteenDatabaseImplement.Models.Visitor", "Visitor")
.WithMany("Orders")
.HasForeignKey("VisitorId")
2023-05-20 00:18:48 +04:00
.OnDelete(DeleteBehavior.Cascade)
2023-04-09 00:34:25 +04:00
.IsRequired();
b.Navigation("Visitor");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.OrderCook", b =>
{
b.HasOne("CanteenDatabaseImplement.Models.Cook", "Cook")
.WithMany("Orders")
.HasForeignKey("CookId")
2023-05-20 00:18:48 +04:00
.OnDelete(DeleteBehavior.Restrict)
2023-04-09 00:34:25 +04:00
.IsRequired();
b.HasOne("CanteenDatabaseImplement.Models.Order", "Order")
.WithMany("Cooks")
.HasForeignKey("OrderId")
2023-05-20 00:18:48 +04:00
.OnDelete(DeleteBehavior.Restrict)
2023-04-09 00:34:25 +04:00
.IsRequired();
b.Navigation("Cook");
b.Navigation("Order");
});
2023-05-19 03:39:58 +04:00
modelBuilder.Entity("CanteenDatabaseImplement.Models.OrderTableware", b =>
2023-04-09 00:34:25 +04:00
{
b.HasOne("CanteenDatabaseImplement.Models.Order", "Order")
2023-05-19 03:39:58 +04:00
.WithMany("Tablewares")
2023-04-09 00:34:25 +04:00
.HasForeignKey("OrderId")
2023-05-20 00:18:48 +04:00
.OnDelete(DeleteBehavior.Restrict)
2023-04-09 00:34:25 +04:00
.IsRequired();
2023-05-19 03:39:58 +04:00
b.HasOne("CanteenDatabaseImplement.Models.Tableware", "Tableware")
.WithMany("Orders")
.HasForeignKey("TablewareId")
2023-05-20 00:18:48 +04:00
.OnDelete(DeleteBehavior.Restrict)
2023-05-19 03:39:58 +04:00
.IsRequired();
2023-04-09 00:34:25 +04:00
b.Navigation("Order");
2023-05-19 03:39:58 +04:00
b.Navigation("Tableware");
2023-04-09 00:34:25 +04:00
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Product", b =>
{
b.HasOne("CanteenDatabaseImplement.Models.Manager", "Manager")
.WithMany("Products")
.HasForeignKey("ManagerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Manager");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.ProductCook", b =>
{
b.HasOne("CanteenDatabaseImplement.Models.Cook", "Cook")
.WithMany("Products")
.HasForeignKey("CookId")
2023-05-20 00:18:48 +04:00
.OnDelete(DeleteBehavior.Restrict)
2023-04-09 00:34:25 +04:00
.IsRequired();
b.HasOne("CanteenDatabaseImplement.Models.Product", "Product")
.WithMany("Cooks")
.HasForeignKey("ProductId")
2023-05-20 00:18:48 +04:00
.OnDelete(DeleteBehavior.Restrict)
2023-04-09 00:34:25 +04:00
.IsRequired();
b.Navigation("Cook");
b.Navigation("Product");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Tableware", b =>
{
b.HasOne("CanteenDatabaseImplement.Models.Visitor", "Visitor")
.WithMany("Tablewares")
.HasForeignKey("VisitorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Visitor");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Cook", b =>
{
b.Navigation("Orders");
b.Navigation("Products");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Dish", b =>
{
b.Navigation("Products");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Lunch", b =>
{
b.Navigation("Orders");
b.Navigation("Products");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Manager", b =>
{
b.Navigation("Cooks");
b.Navigation("Dishes");
b.Navigation("Products");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Order", b =>
{
b.Navigation("Cooks");
b.Navigation("Lunches");
2023-05-19 03:39:58 +04:00
b.Navigation("Tablewares");
2023-04-09 00:34:25 +04:00
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Product", b =>
{
b.Navigation("Cooks");
b.Navigation("Dishes");
b.Navigation("Lunches");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Tableware", b =>
{
b.Navigation("Orders");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Visitor", b =>
{
b.Navigation("Lunches");
b.Navigation("Orders");
b.Navigation("Tablewares");
});
#pragma warning restore 612, 618
}
}
}