320 lines
11 KiB
C#
320 lines
11 KiB
C#
// <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 RestaurantDatabaseImplement;
|
|
|
|
#nullable disable
|
|
|
|
namespace RestaurantDatabaseImplement.Migrations
|
|
{
|
|
[DbContext(typeof(RestaurantDatabase))]
|
|
[Migration("20230506075636_migr1")]
|
|
partial class migr1
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "7.0.5")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("RestaurantDatabaseImplement.Models.Client", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("FirstName")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("LastName")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Number")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Clients");
|
|
});
|
|
|
|
modelBuilder.Entity("RestaurantDatabaseImplement.Models.Component", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("Count")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("Price")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Components");
|
|
});
|
|
|
|
modelBuilder.Entity("RestaurantDatabaseImplement.Models.ComponentProvider", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("ComponentId")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("Count")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTime>("Date")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<int>("ProviderId")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ComponentId");
|
|
|
|
b.HasIndex("ProviderId");
|
|
|
|
b.ToTable("ComponentProviders");
|
|
});
|
|
|
|
modelBuilder.Entity("RestaurantDatabaseImplement.Models.Order", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("ClientId")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTime>("Date")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<int>("Price")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ClientId");
|
|
|
|
b.ToTable("Orders");
|
|
});
|
|
|
|
modelBuilder.Entity("RestaurantDatabaseImplement.Models.OrderProduct", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("Count")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("OrderId")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("ProductId")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("OrderId");
|
|
|
|
b.HasIndex("ProductId");
|
|
|
|
b.ToTable("OrderProducts");
|
|
});
|
|
|
|
modelBuilder.Entity("RestaurantDatabaseImplement.Models.Product", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("Count")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("Price")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("Type")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Products");
|
|
});
|
|
|
|
modelBuilder.Entity("RestaurantDatabaseImplement.Models.ProductComponent", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("ComponentId")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("Count")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("ProductId")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ComponentId");
|
|
|
|
b.HasIndex("ProductId");
|
|
|
|
b.ToTable("ProductComponents");
|
|
});
|
|
|
|
modelBuilder.Entity("RestaurantDatabaseImplement.Models.Provider", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("Address")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Providers");
|
|
});
|
|
|
|
modelBuilder.Entity("RestaurantDatabaseImplement.Models.ComponentProvider", b =>
|
|
{
|
|
b.HasOne("RestaurantDatabaseImplement.Models.Component", "Component")
|
|
.WithMany("Providers")
|
|
.HasForeignKey("ComponentId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("RestaurantDatabaseImplement.Models.Provider", "Provider")
|
|
.WithMany("ComponentProviders")
|
|
.HasForeignKey("ProviderId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Component");
|
|
|
|
b.Navigation("Provider");
|
|
});
|
|
|
|
modelBuilder.Entity("RestaurantDatabaseImplement.Models.Order", b =>
|
|
{
|
|
b.HasOne("RestaurantDatabaseImplement.Models.Client", "Client")
|
|
.WithMany()
|
|
.HasForeignKey("ClientId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Client");
|
|
});
|
|
|
|
modelBuilder.Entity("RestaurantDatabaseImplement.Models.OrderProduct", b =>
|
|
{
|
|
b.HasOne("RestaurantDatabaseImplement.Models.Order", "Order")
|
|
.WithMany("Products")
|
|
.HasForeignKey("OrderId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("RestaurantDatabaseImplement.Models.Product", "Product")
|
|
.WithMany("OrderProducts")
|
|
.HasForeignKey("ProductId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Order");
|
|
|
|
b.Navigation("Product");
|
|
});
|
|
|
|
modelBuilder.Entity("RestaurantDatabaseImplement.Models.ProductComponent", b =>
|
|
{
|
|
b.HasOne("RestaurantDatabaseImplement.Models.Component", "Component")
|
|
.WithMany("ProductComponents")
|
|
.HasForeignKey("ComponentId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("RestaurantDatabaseImplement.Models.Product", "Product")
|
|
.WithMany("Components")
|
|
.HasForeignKey("ProductId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Component");
|
|
|
|
b.Navigation("Product");
|
|
});
|
|
|
|
modelBuilder.Entity("RestaurantDatabaseImplement.Models.Component", b =>
|
|
{
|
|
b.Navigation("ProductComponents");
|
|
|
|
b.Navigation("Providers");
|
|
});
|
|
|
|
modelBuilder.Entity("RestaurantDatabaseImplement.Models.Order", b =>
|
|
{
|
|
b.Navigation("Products");
|
|
});
|
|
|
|
modelBuilder.Entity("RestaurantDatabaseImplement.Models.Product", b =>
|
|
{
|
|
b.Navigation("Components");
|
|
|
|
b.Navigation("OrderProducts");
|
|
});
|
|
|
|
modelBuilder.Entity("RestaurantDatabaseImplement.Models.Provider", b =>
|
|
{
|
|
b.Navigation("ComponentProviders");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|