207 lines
7.0 KiB
C#
207 lines
7.0 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Project.Infrastructure;
|
|
|
|
#nullable disable
|
|
|
|
namespace Project.Web.Migrations
|
|
{
|
|
[DbContext(typeof(ApplicationDbContext))]
|
|
[Migration("20240625110321_zwote")]
|
|
partial class zwote
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "8.0.6")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
|
|
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("Project.Domain.Entities.Category", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int")
|
|
.HasColumnName("ID");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<DateTime>("CreationDate")
|
|
.HasColumnType("datetime")
|
|
.HasColumnName("CREATION_DATE");
|
|
|
|
b.Property<int>("Name")
|
|
.HasColumnType("int")
|
|
.HasColumnName("CATEGORY_NAME");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("CATEGORY", "dbo");
|
|
});
|
|
|
|
modelBuilder.Entity("Project.Domain.Entities.CategoryRole", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int")
|
|
.HasColumnName("ID");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("CategoryId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("RoleId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CategoryId");
|
|
|
|
b.HasIndex("RoleId");
|
|
|
|
b.ToTable("CATEGORY_ROLE", "dbo");
|
|
});
|
|
|
|
modelBuilder.Entity("Project.Domain.Entities.Product", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int")
|
|
.HasColumnName("ID");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("CategoryId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)")
|
|
.HasColumnName("PRODUCT_NAME");
|
|
|
|
b.Property<decimal>("Price")
|
|
.HasColumnType("decimal(18,2)")
|
|
.HasColumnName("PRICE");
|
|
|
|
b.Property<int>("Quantity")
|
|
.HasColumnType("int")
|
|
.HasColumnName("QUANTITY");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CategoryId");
|
|
|
|
b.ToTable("PRODUCT", "dbo");
|
|
});
|
|
|
|
modelBuilder.Entity("Project.Domain.Entities.Role", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int")
|
|
.HasColumnName("ID");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<DateTime>("CreationDate")
|
|
.HasColumnType("datetime")
|
|
.HasColumnName("CREATION_DATE");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)")
|
|
.HasColumnName("ROLE");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("ROLE", "dbo");
|
|
});
|
|
|
|
modelBuilder.Entity("Project.Domain.Entities.User", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int")
|
|
.HasColumnName("ID");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("FirstName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)")
|
|
.HasColumnName("FIRST_NAME");
|
|
|
|
b.Property<string>("LastName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)")
|
|
.HasColumnName("LAST_NAME");
|
|
|
|
b.Property<int>("RoleId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("UserName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)")
|
|
.HasColumnName("USER_NAME");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("RoleId");
|
|
|
|
b.ToTable("USER", "dbo");
|
|
});
|
|
|
|
modelBuilder.Entity("Project.Domain.Entities.CategoryRole", b =>
|
|
{
|
|
b.HasOne("Project.Domain.Entities.Category", "Category")
|
|
.WithMany()
|
|
.HasForeignKey("CategoryId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Project.Domain.Entities.Role", "Role")
|
|
.WithMany()
|
|
.HasForeignKey("RoleId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Category");
|
|
|
|
b.Navigation("Role");
|
|
});
|
|
|
|
modelBuilder.Entity("Project.Domain.Entities.Product", b =>
|
|
{
|
|
b.HasOne("Project.Domain.Entities.Category", "Category")
|
|
.WithMany()
|
|
.HasForeignKey("CategoryId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Category");
|
|
});
|
|
|
|
modelBuilder.Entity("Project.Domain.Entities.User", b =>
|
|
{
|
|
b.HasOne("Project.Domain.Entities.Role", "Role")
|
|
.WithMany()
|
|
.HasForeignKey("RoleId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Role");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|