2022-05-09 17:07:59 -07:00
|
|
|
|
// <auto-generated />
|
2022-05-09 18:31:09 -07:00
|
|
|
|
using Infrastructure.Data;
|
2022-05-09 17:07:59 -07:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
|
|
|
|
|
|
|
|
#nullable disable
|
|
|
|
|
|
|
|
|
|
namespace Infrastructure.Data.Migrations
|
|
|
|
|
{
|
|
|
|
|
[DbContext(typeof(StoreContext))]
|
2022-05-09 22:38:14 -07:00
|
|
|
|
[Migration("20220510050050_InitialCreate")]
|
2022-05-09 17:07:59 -07:00
|
|
|
|
partial class InitialCreate
|
|
|
|
|
{
|
|
|
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
|
|
|
{
|
|
|
|
|
#pragma warning disable 612, 618
|
|
|
|
|
modelBuilder.HasAnnotation("ProductVersion", "6.0.4");
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("Core.Entities.Product", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("INTEGER");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Description")
|
2022-05-09 22:38:14 -07:00
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasMaxLength(256)
|
2022-05-09 17:07:59 -07:00
|
|
|
|
.HasColumnType("TEXT");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Name")
|
2022-05-09 22:38:14 -07:00
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasMaxLength(100)
|
2022-05-09 17:07:59 -07:00
|
|
|
|
.HasColumnType("TEXT");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("PictureUrl")
|
2022-05-09 22:38:14 -07:00
|
|
|
|
.IsRequired()
|
2022-05-09 17:07:59 -07:00
|
|
|
|
.HasColumnType("TEXT");
|
|
|
|
|
|
|
|
|
|
b.Property<decimal>("Price")
|
2022-05-09 22:38:14 -07:00
|
|
|
|
.HasColumnType("decimal(18,2)");
|
2022-05-09 17:07:59 -07:00
|
|
|
|
|
|
|
|
|
b.Property<int>("ProductBrandId")
|
|
|
|
|
.HasColumnType("INTEGER");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("ProductTypeId")
|
|
|
|
|
.HasColumnType("INTEGER");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("ProductBrandId");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("ProductTypeId");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Products");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("Core.Entities.ProductBrand", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("INTEGER");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Name")
|
|
|
|
|
.HasColumnType("TEXT");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.ToTable("ProductBrands");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("Core.Entities.ProductType", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("INTEGER");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Name")
|
|
|
|
|
.HasColumnType("TEXT");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.ToTable("ProductTypes");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("Core.Entities.Product", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("Core.Entities.ProductBrand", "ProductBrand")
|
|
|
|
|
.WithMany()
|
|
|
|
|
.HasForeignKey("ProductBrandId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.HasOne("Core.Entities.ProductType", "ProductType")
|
|
|
|
|
.WithMany()
|
|
|
|
|
.HasForeignKey("ProductTypeId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("ProductBrand");
|
|
|
|
|
|
|
|
|
|
b.Navigation("ProductType");
|
|
|
|
|
});
|
|
|
|
|
#pragma warning restore 612, 618
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|