//
using InventoryManagement.Components;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace InventoryManagement_MariaDB.Migrations
{
[DbContext(typeof(InventoryContext))]
[Migration("20231019083443_initialize")]
partial class initialize
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.12")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("InventoryManagement.Components.Accessary", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property("Description")
.HasColumnType("longtext");
b.Property("Name")
.IsRequired()
.HasColumnType("longtext");
b.Property("ProductId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("ProductId");
b.ToTable("Accessaries");
});
modelBuilder.Entity("InventoryManagement.Components.Product", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property("Name")
.IsRequired()
.HasColumnType("varchar(255)");
b.Property("Quantity")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique();
b.ToTable("Products");
});
modelBuilder.Entity("InventoryManagement.Components.Accessary", b =>
{
b.HasOne("InventoryManagement.Components.Product", "CompatibleProduct")
.WithMany("CompatibleAccessaries")
.HasForeignKey("ProductId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CompatibleProduct");
});
modelBuilder.Entity("InventoryManagement.Components.Product", b =>
{
b.Navigation("CompatibleAccessaries");
});
#pragma warning restore 612, 618
}
}
}