//
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using MyDarling.Models;
#nullable disable
namespace MyDarling.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20230603040054_Initial")]
partial class Initial
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "7.0.2");
modelBuilder.Entity("MyDarling.Models.Figure", b =>
{
b.Property("Id")
.HasColumnType("TEXT");
b.Property("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property("ProductId")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("ProductId");
b.ToTable("Figures");
});
modelBuilder.Entity("MyDarling.Models.Product", b =>
{
b.Property("Id")
.HasColumnType("TEXT");
b.Property("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Price")
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Products");
});
modelBuilder.Entity("MyDarling.Models.Figure", b =>
{
b.HasOne("MyDarling.Models.Product", null)
.WithMany("Figures")
.HasForeignKey("ProductId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("MyDarling.Models.Product", b =>
{
b.Navigation("Figures");
});
#pragma warning restore 612, 618
}
}
}