2024-05-15 21:14:04 +04:00
|
|
|
|
// <auto-generated />
|
|
|
|
|
using System;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
|
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
|
using SushiBarDatabaseImplement;
|
|
|
|
|
|
|
|
|
|
#nullable disable
|
|
|
|
|
|
|
|
|
|
namespace SushiBarDatabaseImplement.Migrations
|
|
|
|
|
{
|
|
|
|
|
[DbContext(typeof(SushiBarDatabase))]
|
2024-05-15 21:15:39 +04:00
|
|
|
|
[Migration("20240515171525_Initial")]
|
2024-05-15 21:14:04 +04:00
|
|
|
|
partial class Initial
|
|
|
|
|
{
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
|
|
|
{
|
|
|
|
|
#pragma warning disable 612, 618
|
|
|
|
|
modelBuilder
|
|
|
|
|
.HasAnnotation("ProductVersion", "7.0.19")
|
|
|
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
|
|
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Cheque", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("integer");
|
|
|
|
|
|
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<int?>("CustomerId")
|
|
|
|
|
.HasColumnType("integer");
|
|
|
|
|
|
|
|
|
|
b.Property<DateTime>("OrderDate")
|
|
|
|
|
.HasColumnType("timestamp without time zone");
|
|
|
|
|
|
|
|
|
|
b.Property<int?>("PromotionId")
|
|
|
|
|
.HasColumnType("integer");
|
|
|
|
|
|
|
|
|
|
b.Property<double>("TotalSum")
|
|
|
|
|
.HasColumnType("double precision");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("CustomerId");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("PromotionId");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Cheques");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("SushiBarDatabaseImplement.Models.ChequeItem", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("integer");
|
|
|
|
|
|
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<int>("ChequeId")
|
|
|
|
|
.HasColumnType("integer");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("CookId")
|
|
|
|
|
.HasColumnType("integer");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("Count")
|
|
|
|
|
.HasColumnType("integer");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("DishId")
|
|
|
|
|
.HasColumnType("integer");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("ChequeId");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("CookId");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("DishId");
|
|
|
|
|
|
|
|
|
|
b.ToTable("ChequeItems");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Cook", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("integer");
|
|
|
|
|
|
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<DateTime>("EmploymentDate")
|
|
|
|
|
.HasColumnType("timestamp without time zone");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Fio")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Cooks");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Customer", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("integer");
|
|
|
|
|
|
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
|
|
2024-05-15 21:15:39 +04:00
|
|
|
|
b.Property<DateTime?>("BirthdayDate")
|
2024-05-15 21:14:04 +04:00
|
|
|
|
.HasColumnType("timestamp without time zone");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Fio")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text");
|
|
|
|
|
|
|
|
|
|
b.Property<double>("SumOfAllOrders")
|
|
|
|
|
.HasColumnType("double precision");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Customers");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Dish", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("integer");
|
|
|
|
|
|
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Category")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("DishName")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Dishes");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("SushiBarDatabaseImplement.Models.DishIngredient", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("integer");
|
|
|
|
|
|
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<int>("Count")
|
|
|
|
|
.HasColumnType("integer");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("DishId")
|
|
|
|
|
.HasColumnType("integer");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("IngredientId")
|
|
|
|
|
.HasColumnType("integer");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("DishId");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("IngredientId");
|
|
|
|
|
|
|
|
|
|
b.ToTable("DishIngredients");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Ingredient", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("integer");
|
|
|
|
|
|
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<double>("Cost")
|
|
|
|
|
.HasColumnType("double precision");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("IngredientName")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Unit")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Ingredients");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Promotion", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("integer");
|
|
|
|
|
|
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<float>("Discount")
|
|
|
|
|
.HasColumnType("real");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("PromotionName")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text");
|
|
|
|
|
|
|
|
|
|
b.Property<double>("TriggeringSum")
|
|
|
|
|
.HasColumnType("double precision");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Promotions");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Cheque", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("SushiBarDatabaseImplement.Models.Customer", "Customer")
|
|
|
|
|
.WithMany("Cheques")
|
|
|
|
|
.HasForeignKey("CustomerId");
|
|
|
|
|
|
|
|
|
|
b.HasOne("SushiBarDatabaseImplement.Models.Promotion", "Promotion")
|
|
|
|
|
.WithMany("Cheques")
|
|
|
|
|
.HasForeignKey("PromotionId");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Customer");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Promotion");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("SushiBarDatabaseImplement.Models.ChequeItem", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("SushiBarDatabaseImplement.Models.Cheque", "Cheque")
|
|
|
|
|
.WithMany("ChequeItems")
|
|
|
|
|
.HasForeignKey("ChequeId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.HasOne("SushiBarDatabaseImplement.Models.Cook", "Cook")
|
|
|
|
|
.WithMany("ChequeItems")
|
|
|
|
|
.HasForeignKey("CookId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.HasOne("SushiBarDatabaseImplement.Models.Dish", "Dish")
|
|
|
|
|
.WithMany("ChequeItems")
|
|
|
|
|
.HasForeignKey("DishId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("Cheque");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Cook");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Dish");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("SushiBarDatabaseImplement.Models.DishIngredient", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("SushiBarDatabaseImplement.Models.Dish", "Dish")
|
|
|
|
|
.WithMany("DishIngredients")
|
|
|
|
|
.HasForeignKey("DishId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.HasOne("SushiBarDatabaseImplement.Models.Ingredient", "Ingredient")
|
|
|
|
|
.WithMany("DishIngredients")
|
|
|
|
|
.HasForeignKey("IngredientId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("Dish");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Ingredient");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Cheque", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Navigation("ChequeItems");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Cook", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Navigation("ChequeItems");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Customer", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Navigation("Cheques");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Dish", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Navigation("ChequeItems");
|
|
|
|
|
|
|
|
|
|
b.Navigation("DishIngredients");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Ingredient", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Navigation("DishIngredients");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Promotion", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Navigation("Cheques");
|
|
|
|
|
});
|
|
|
|
|
#pragma warning restore 612, 618
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|