// 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 { [DbContext(typeof(AuthDBContext))] [Migration("20241126071458_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("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("ClaimType") .HasColumnType("longtext"); b.Property("ClaimValue") .HasColumnType("longtext"); b.Property("RoleId") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("RoleId"); b.ToTable("AspNetRoleClaims", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("ClaimType") .HasColumnType("longtext"); b.Property("ClaimValue") .HasColumnType("longtext"); b.Property("UserId") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("UserId"); b.ToTable("AspNetUserClaims", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { b.Property("LoginProvider") .HasColumnType("varchar(255)"); b.Property("ProviderKey") .HasColumnType("varchar(255)"); b.Property("ProviderDisplayName") .HasColumnType("longtext"); b.Property("UserId") .HasColumnType("int"); b.HasKey("LoginProvider", "ProviderKey"); b.HasIndex("UserId"); b.ToTable("AspNetUserLogins", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => { b.Property("UserId") .HasColumnType("int"); b.Property("RoleId") .HasColumnType("int"); b.HasKey("UserId", "RoleId"); b.HasIndex("RoleId"); b.ToTable("AspNetUserRoles", (string)null); b.HasData( new { UserId = 1, RoleId = 1 }); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { b.Property("UserId") .HasColumnType("int"); b.Property("LoginProvider") .HasColumnType("varchar(255)"); b.Property("Name") .HasColumnType("varchar(255)"); b.Property("Value") .HasColumnType("longtext"); b.HasKey("UserId", "LoginProvider", "Name"); b.ToTable("AspNetUserTokens", (string)null); }); modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.CompanyModel", b => { b.Property("CompanyId") .ValueGeneratedOnAdd() .HasColumnType("int"); MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CompanyId")); b.Property("Name") .IsRequired() .HasColumnType("longtext"); b.HasKey("CompanyId"); b.ToTable("Companies"); }); modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.DepartmentModel", b => { b.Property("DepartmentId") .ValueGeneratedOnAdd() .HasColumnType("int"); MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("DepartmentId")); b.Property("CompanyId") .HasColumnType("int"); b.Property("Name") .IsRequired() .HasColumnType("longtext"); b.HasKey("DepartmentId"); b.HasIndex("CompanyId"); b.ToTable("Departments"); }); modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.ItemModel", b => { b.Property("ItemID") .HasColumnType("varchar(255)"); b.Property("CompanyId") .HasColumnType("int"); b.Property("ConvertPrice") .HasColumnType("float"); b.Property("Currency") .IsRequired() .HasColumnType("longtext"); b.Property("CurrencyRate") .HasColumnType("float"); b.Property("DODate") .HasColumnType("datetime(6)"); b.Property("DepartmentId") .HasColumnType("int"); b.Property("EndWDate") .HasColumnType("datetime(6)"); b.Property("InvoiceDate") .HasColumnType("datetime(6)"); 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") .IsRequired() .HasColumnType("longtext"); b.Property("Supplier") .IsRequired() .HasColumnType("longtext"); b.Property("Warranty") .HasColumnType("int"); b.HasKey("ItemID"); b.HasIndex("CompanyId"); 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.ModuleSettingModel", b => { b.Property("SettingId") .ValueGeneratedOnAdd() .HasColumnType("int"); MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("SettingId")); b.Property("AllowedUserType") .HasColumnType("longtext"); b.Property("Description") .HasColumnType("longtext"); b.Property("MethodAllowedUserType") .HasColumnType("json"); b.Property("ModuleName") .IsRequired() .HasMaxLength(50) .HasColumnType("varchar(50)"); b.Property("ModuleStatus") .HasColumnType("int"); b.HasKey("SettingId"); b.ToTable("ModuleSettings"); }); modelBuilder.Entity("PSTW_CentralSystem.Models.RoleModel", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnType("longtext"); b.Property("Description") .HasColumnType("longtext"); b.Property("Name") .HasMaxLength(256) .HasColumnType("varchar(256)"); b.Property("NormalizedName") .HasMaxLength(256) .HasColumnType("varchar(256)"); b.HasKey("Id"); b.HasIndex("NormalizedName") .IsUnique() .HasDatabaseName("RoleNameIndex"); b.ToTable("AspNetRoles", (string)null); b.HasData( new { Id = 1, Description = "Can access all pages", Name = "SuperAdmin", NormalizedName = "SUPERADMIN" }, new { Id = 2, Description = "Can access some admin pages", Name = "SystemAdmin", NormalizedName = "SYSTEMADMIN" }, new { Id = 3, Description = "Can access operation pages", Name = "Engineer", NormalizedName = "ENGINEER" }, new { Id = 4, Description = "Can access data viewer pages", Name = "Observer", NormalizedName = "OBSERVER" }); }); 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") .IsConcurrencyToken() .HasColumnType("longtext"); b.Property("Email") .HasMaxLength(256) .HasColumnType("varchar(256)"); 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") .HasMaxLength(256) .HasColumnType("varchar(256)"); b.Property("NormalizedUserName") .HasMaxLength(256) .HasColumnType("varchar(256)"); 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") .HasMaxLength(256) .HasColumnType("varchar(256)"); b.Property("UserStatus") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("NormalizedEmail") .HasDatabaseName("EmailIndex"); b.HasIndex("NormalizedUserName") .IsUnique() .HasDatabaseName("UserNameIndex"); b.ToTable("AspNetUsers", (string)null); b.HasData( new { Id = 1, AccessFailedCount = 0, ConcurrencyStamp = "dde44c98-793e-452c-8123-5252dc03d655", Email = "admin@pstw.com.my", EmailConfirmed = true, FullName = "MAAdmin", LockoutEnabled = false, NormalizedEmail = "ADMIN@PSTW.COM.MY", NormalizedUserName = "ADMIN@PSTW.COM.MY", PasswordHash = "AQAAAAIAAYagAAAAEF/vIsmJIWgsCX1cyJiM/miWN66l6UKVbXIY07eBwo/kOy6xL5olLByKrgW7MdbadQ==", PhoneNumberConfirmed = false, SecurityStamp = "1e63fa4d-6a8a-4738-9036-7b51d02e1eaf", TwoFactorEnabled = false, UserName = "admin@pstw.com.my" }, new { Id = 2, AccessFailedCount = 0, ConcurrencyStamp = "b529f4f9-3426-4a74-b048-d8995fe3e647", Email = "sysadmin@pstw.com.my", EmailConfirmed = true, FullName = "SysAdmin", LockoutEnabled = false, NormalizedEmail = "SYSADMIN@PSTW.COM.MY", NormalizedUserName = "SYSADMIN@PSTW.COM.MY", PasswordHash = "AQAAAAIAAYagAAAAEIEYpwwMbS9j2l6V3fpUQONaKxCMJN3pV8rVeN3eo0iva0Bu9Jj1NIdkS4GnzvpDVw==", PhoneNumberConfirmed = false, SecurityStamp = "065ee938-093c-4816-ad28-f2e0831a7550", TwoFactorEnabled = false, UserName = "sysadmin@pstw.com.my" }); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.HasOne("PSTW_CentralSystem.Models.RoleModel", null) .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { b.HasOne("PSTW_CentralSystem.Models.UserModel", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { b.HasOne("PSTW_CentralSystem.Models.UserModel", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => { b.HasOne("PSTW_CentralSystem.Models.RoleModel", null) .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("PSTW_CentralSystem.Models.UserModel", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { b.HasOne("PSTW_CentralSystem.Models.UserModel", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.DepartmentModel", b => { b.HasOne("PSTW_CentralSystem.Areas.Inventory.Models.CompanyModel", "Company") .WithMany() .HasForeignKey("CompanyId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Company"); }); modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.ItemModel", b => { b.HasOne("PSTW_CentralSystem.Areas.Inventory.Models.CompanyModel", "Company") .WithMany() .HasForeignKey("CompanyId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("PSTW_CentralSystem.Areas.Inventory.Models.DepartmentModel", "Department") .WithMany() .HasForeignKey("DepartmentId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("PSTW_CentralSystem.Areas.Inventory.Models.ProductModel", "Product") .WithMany() .HasForeignKey("ProductId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Company"); 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"); }); #pragma warning restore 612, 618 } } }