//
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))]
[Migration("20240507174252_InitMigration")]
partial class InitMigration
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.3")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Buyer", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("BuyerBirthDate")
.HasColumnType("timestamp without time zone");
b.Property("BuyerName")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Buyers");
});
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Cook", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("CookName")
.IsRequired()
.HasColumnType("text");
b.Property("CookSurname")
.IsRequired()
.HasColumnType("text");
b.Property("Experience")
.HasColumnType("integer");
b.Property("Passport")
.IsRequired()
.HasColumnType("text");
b.Property("PhoneNumber")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Cooks");
});
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Menu", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Description")
.IsRequired()
.HasColumnType("text");
b.Property("FoodName")
.IsRequired()
.HasColumnType("text");
b.Property("Price")
.HasColumnType("double precision");
b.HasKey("Id");
b.ToTable("Menus");
});
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Place", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("CountPlaces")
.HasColumnType("integer");
b.Property("PlaceNumber")
.HasColumnType("integer");
b.HasKey("Id");
b.ToTable("Places");
});
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Task", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("BuyerId")
.HasColumnType("integer");
b.Property("CookId")
.HasColumnType("integer");
b.Property("FullPrice")
.HasColumnType("double precision");
b.Property("PlaceId")
.HasColumnType("integer");
b.Property("Status")
.HasColumnType("integer");
b.Property("TaskDate")
.HasColumnType("timestamp without time zone");
b.HasKey("Id");
b.ToTable("Tasks");
});
modelBuilder.Entity("SushiBarDatabaseImplement.Models.TaskMenu", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Count")
.HasColumnType("integer");
b.Property("MenuId")
.HasColumnType("integer");
b.Property("TaskId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("MenuId");
b.HasIndex("TaskId");
b.ToTable("TaskMenus");
});
modelBuilder.Entity("SushiBarDatabaseImplement.Models.TaskMenu", b =>
{
b.HasOne("SushiBarDatabaseImplement.Models.Menu", "Menu")
.WithMany("TaskMenus")
.HasForeignKey("MenuId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("SushiBarDatabaseImplement.Models.Task", "Task")
.WithMany("Menus")
.HasForeignKey("TaskId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Menu");
b.Navigation("Task");
});
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Menu", b =>
{
b.Navigation("TaskMenus");
});
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Task", b =>
{
b.Navigation("Menus");
});
#pragma warning restore 612, 618
}
}
}