// using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using PSTW_CentralSystem.DBContext; #nullable disable namespace PSTW_CentralSystem.Migrations.InventoryDB { [DbContext(typeof(InventoryDBContext))] [Migration("20241206071642_Initiate")] partial class Initiate { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "8.0.11") .HasAnnotation("Relational:MaxIdentifierLength", 64); MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.ItemModel", b => { b.Property("ItemID") .ValueGeneratedOnAdd() .HasColumnType("int"); MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ItemID")); b.Property("CompanyId") .HasColumnType("int"); b.Property("ConvertPrice") .HasColumnType("float"); b.Property("CreatedByUserId") .HasColumnType("int"); b.Property("Currency") .IsRequired() .HasColumnType("longtext"); b.Property("CurrencyRate") .HasColumnType("float"); b.Property("DODate") .HasColumnType("datetime(6)"); b.Property("DONo") .HasColumnType("longtext"); b.Property("DepartmentId") .HasColumnType("int"); b.Property("EndWDate") .HasColumnType("datetime(6)"); b.Property("InvoiceDate") .HasColumnType("datetime(6)"); b.Property("InvoiceNo") .HasColumnType("longtext"); b.Property("ItemLocation") .IsRequired() .HasColumnType("longtext"); b.Property("ItemStatus") .HasColumnType("int") .HasComment("1 = In stock; 2 = Item Moving; 3 = Item Out; 4 = Item Broken; 5 = Item Lost; 6 = Item Stolen; 7 = Item Damaged; 8 = Item Discarded; 9 = Item Destroyed; 10 = Item Finished;"); b.Property("PONo") .IsRequired() .HasColumnType("longtext"); b.Property("PriceInRM") .HasColumnType("float"); b.Property("ProductId") .HasColumnType("int"); b.Property("PurchaseDate") .HasColumnType("datetime(6)"); b.Property("Quantity") .HasColumnType("int"); b.Property("SerialNumber") .HasColumnType("longtext"); b.Property("Supplier") .IsRequired() .HasColumnType("longtext"); b.Property("TeamType") .HasColumnType("longtext"); b.Property("UniqueID") .IsRequired() .HasColumnType("longtext"); b.Property("Warranty") .HasColumnType("int"); b.HasKey("ItemID"); b.HasIndex("CompanyId"); b.HasIndex("CreatedByUserId"); b.HasIndex("DepartmentId"); b.HasIndex("ProductId"); b.ToTable("Items"); }); modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.ManufacturerModel", b => { b.Property("ManufacturerId") .ValueGeneratedOnAdd() .HasColumnType("int"); MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ManufacturerId")); b.Property("ManufacturerName") .IsRequired() .HasColumnType("longtext"); b.HasKey("ManufacturerId"); b.ToTable("Manufacturers"); }); modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.ProductModel", b => { b.Property("ProductId") .ValueGeneratedOnAdd() .HasColumnType("int"); MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ProductId")); b.Property("Category") .IsRequired() .HasColumnType("longtext"); b.Property("ImageProduct") .IsRequired() .HasColumnType("longtext"); b.Property("ManufacturerId") .HasColumnType("int"); b.Property("ModelNo") .IsRequired() .HasColumnType("longtext"); b.Property("ProductName") .IsRequired() .HasColumnType("longtext"); b.Property("QuantityProduct") .HasColumnType("int"); b.HasKey("ProductId"); b.HasIndex("ManufacturerId"); b.ToTable("Products"); }); modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.SupplierModel", b => { b.Property("SupplierId") .ValueGeneratedOnAdd() .HasColumnType("int"); MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("SupplierId")); b.Property("SupplierEmail") .IsRequired() .HasColumnType("longtext"); b.Property("SupplierGender") .IsRequired() .HasColumnType("longtext"); b.Property("SupplierName") .IsRequired() .HasColumnType("longtext"); b.Property("SupplierPhoneNo") .IsRequired() .HasColumnType("longtext"); b.HasKey("SupplierId"); b.ToTable("Suppliers"); }); modelBuilder.Entity("PSTW_CentralSystem.Models.CompanyModel", b => { b.Property("CompanyId") .ValueGeneratedOnAdd() .HasColumnType("int"); MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CompanyId")); b.Property("CompanyName") .IsRequired() .HasColumnType("longtext"); b.HasKey("CompanyId"); b.ToTable("CompanyModel"); }); modelBuilder.Entity("PSTW_CentralSystem.Models.DepartmentModel", b => { b.Property("DepartmentId") .ValueGeneratedOnAdd() .HasColumnType("int"); MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("DepartmentId")); b.Property("CompanyId") .HasColumnType("int"); b.Property("DepartmentCode") .IsRequired() .HasColumnType("longtext"); b.Property("DepartmentName") .IsRequired() .HasColumnType("longtext"); b.HasKey("DepartmentId"); b.HasIndex("CompanyId"); b.ToTable("DepartmentModel"); }); modelBuilder.Entity("PSTW_CentralSystem.Models.UserModel", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AccessFailedCount") .HasColumnType("int"); b.Property("ConcurrencyStamp") .HasColumnType("longtext"); b.Property("Email") .HasColumnType("longtext"); b.Property("EmailConfirmed") .HasColumnType("tinyint(1)"); b.Property("FullName") .HasColumnType("longtext"); b.Property("LockoutEnabled") .HasColumnType("tinyint(1)"); b.Property("LockoutEnd") .HasColumnType("datetime(6)"); b.Property("NormalizedEmail") .HasColumnType("longtext"); b.Property("NormalizedUserName") .HasColumnType("longtext"); b.Property("PasswordHash") .HasColumnType("longtext"); b.Property("PhoneNumber") .HasColumnType("longtext"); b.Property("PhoneNumberConfirmed") .HasColumnType("tinyint(1)"); b.Property("SecurityStamp") .HasColumnType("longtext"); b.Property("TwoFactorEnabled") .HasColumnType("tinyint(1)"); b.Property("UserName") .HasColumnType("longtext"); b.Property("UserInfoStatus") .HasColumnType("int"); b.Property("departmentId") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("departmentId"); b.ToTable("UserModel"); }); modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.ItemModel", b => { b.HasOne("PSTW_CentralSystem.Models.CompanyModel", "Company") .WithMany() .HasForeignKey("CompanyId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("PSTW_CentralSystem.Models.UserModel", "CreatedBy") .WithMany() .HasForeignKey("CreatedByUserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("PSTW_CentralSystem.Models.DepartmentModel", "Department") .WithMany() .HasForeignKey("DepartmentId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("PSTW_CentralSystem.Areas.Inventory.Models.ProductModel", "Product") .WithMany("Items") .HasForeignKey("ProductId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Company"); b.Navigation("CreatedBy"); b.Navigation("Department"); b.Navigation("Product"); }); modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.ProductModel", b => { b.HasOne("PSTW_CentralSystem.Areas.Inventory.Models.ManufacturerModel", "Manufacturer") .WithMany() .HasForeignKey("ManufacturerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Manufacturer"); }); modelBuilder.Entity("PSTW_CentralSystem.Models.DepartmentModel", b => { b.HasOne("PSTW_CentralSystem.Models.CompanyModel", "Company") .WithMany("Departments") .HasForeignKey("CompanyId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Company"); }); modelBuilder.Entity("PSTW_CentralSystem.Models.UserModel", b => { b.HasOne("PSTW_CentralSystem.Models.DepartmentModel", "Department") .WithMany() .HasForeignKey("departmentId"); b.Navigation("Department"); }); modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.ProductModel", b => { b.Navigation("Items"); }); modelBuilder.Entity("PSTW_CentralSystem.Models.CompanyModel", b => { b.Navigation("Departments"); }); #pragma warning restore 612, 618 } } }