// <auto-generated />
using System;
using CocktailWeb.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;

#nullable disable

namespace CocktailWeb.Migrations
{
    [DbContext(typeof(DbDataContext))]
    [Migration("20240131184613_CreateFillerTable")]
    partial class CreateFillerTable
    {
        /// <inheritdoc />
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder.HasAnnotation("ProductVersion", "8.0.1");

            modelBuilder.Entity("CocktailWeb.Data.Cocktail", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<string>("ImageURL")
                        .HasColumnType("TEXT");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.ToTable("Cocktails");
                });

            modelBuilder.Entity("CocktailWeb.Data.CocktailFlasche", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<int>("CocktailID")
                        .HasColumnType("INTEGER");

                    b.Property<int>("FlascheID")
                        .HasColumnType("INTEGER");

                    b.Property<int>("Menge")
                        .HasColumnType("INTEGER");

                    b.Property<int>("Reihenfolge")
                        .HasColumnType("INTEGER");

                    b.HasKey("Id");

                    b.HasIndex("CocktailID");

                    b.HasIndex("FlascheID");

                    b.ToTable("CocktailFlaschen");
                });

            modelBuilder.Entity("CocktailWeb.Data.Filler", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<int?>("FlascheId")
                        .HasColumnType("INTEGER");

                    b.Property<int>("Pos")
                        .HasColumnType("INTEGER");

                    b.Property<int>("Type")
                        .HasColumnType("INTEGER");

                    b.HasKey("Id");

                    b.HasIndex("FlascheId");

                    b.ToTable("Fillers");
                });

            modelBuilder.Entity("CocktailWeb.Data.Flasche", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.ToTable("Flaschen", (string)null);

                    b.HasData(
                        new
                        {
                            Id = 1,
                            Name = "Jägermeister"
                        },
                        new
                        {
                            Id = 2,
                            Name = "Wodka"
                        });
                });

            modelBuilder.Entity("CocktailWeb.Data.CocktailFlasche", b =>
                {
                    b.HasOne("CocktailWeb.Data.Cocktail", "Cocktail")
                        .WithMany("Cocktailflaschen")
                        .HasForeignKey("CocktailID")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("CocktailWeb.Data.Flasche", "Flasche")
                        .WithMany()
                        .HasForeignKey("FlascheID")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Cocktail");

                    b.Navigation("Flasche");
                });

            modelBuilder.Entity("CocktailWeb.Data.Filler", b =>
                {
                    b.HasOne("CocktailWeb.Data.Flasche", "Flasche")
                        .WithMany()
                        .HasForeignKey("FlascheId");

                    b.Navigation("Flasche");
                });

            modelBuilder.Entity("CocktailWeb.Data.Cocktail", b =>
                {
                    b.Navigation("Cocktailflaschen");
                });
#pragma warning restore 612, 618
        }
    }
}
