636 lines
23 KiB
C#
636 lines
23 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 PSTW_CentralSystem.DBContext;
|
|
|
|
#nullable disable
|
|
|
|
namespace PSTW_CentralSystem.Migrations
|
|
{
|
|
[DbContext(typeof(AuthDBContext))]
|
|
[Migration("20241125051125_UpdateManifacturerModel")]
|
|
partial class UpdateManifacturerModel
|
|
{
|
|
/// <inheritdoc />
|
|
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<int>", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("ClaimType")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("ClaimValue")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<int>("RoleId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("RoleId");
|
|
|
|
b.ToTable("AspNetRoleClaims", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("ClaimType")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("ClaimValue")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<int>("UserId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.ToTable("AspNetUserClaims", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
|
|
{
|
|
b.Property<string>("LoginProvider")
|
|
.HasColumnType("varchar(255)");
|
|
|
|
b.Property<string>("ProviderKey")
|
|
.HasColumnType("varchar(255)");
|
|
|
|
b.Property<string>("ProviderDisplayName")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<int>("UserId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("LoginProvider", "ProviderKey");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.ToTable("AspNetUserLogins", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<int>", b =>
|
|
{
|
|
b.Property<int>("UserId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("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<int>", b =>
|
|
{
|
|
b.Property<int>("UserId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("LoginProvider")
|
|
.HasColumnType("varchar(255)");
|
|
|
|
b.Property<string>("Name")
|
|
.HasColumnType("varchar(255)");
|
|
|
|
b.Property<string>("Value")
|
|
.HasColumnType("longtext");
|
|
|
|
b.HasKey("UserId", "LoginProvider", "Name");
|
|
|
|
b.ToTable("AspNetUserTokens", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.CompanyModel", b =>
|
|
{
|
|
b.Property<int>("CompanyId")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("CompanyId"));
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.HasKey("CompanyId");
|
|
|
|
b.ToTable("Companies");
|
|
});
|
|
|
|
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.DepartmentModel", b =>
|
|
{
|
|
b.Property<int>("DepartmentId")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("DepartmentId"));
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.HasKey("DepartmentId");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.ToTable("Departments");
|
|
});
|
|
|
|
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.ItemModel", b =>
|
|
{
|
|
b.Property<string>("ItemID")
|
|
.HasColumnType("varchar(255)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<float>("ConvertPrice")
|
|
.HasColumnType("float");
|
|
|
|
b.Property<string>("Currency")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<float>("CurrencyRate")
|
|
.HasColumnType("float");
|
|
|
|
b.Property<DateTime>("DODate")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<int>("DepartmentId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("EndWDate")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<DateTime>("InvoiceDate")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("PONo")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<float>("PriceInRM")
|
|
.HasColumnType("float");
|
|
|
|
b.Property<int>("ProductId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("PurchaseDate")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<int>("Quantity")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("SerialNumber")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("Supplier")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<int>("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<int>("ManufacturesId")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("ManufacturesId"));
|
|
|
|
b.Property<string>("ManufacturesName")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.HasKey("ManufacturesId");
|
|
|
|
b.ToTable("Manifacturers");
|
|
});
|
|
|
|
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.ProductModel", b =>
|
|
{
|
|
b.Property<int>("ProductId")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("ProductId"));
|
|
|
|
b.Property<string>("Category")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ImageProduct")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("Manufacturer")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("ModelNo")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("ProductName")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<int>("QuantityProduct")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("ProductId");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.ToTable("Products");
|
|
});
|
|
|
|
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.SupplierModel", b =>
|
|
{
|
|
b.Property<int>("SupplierId")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("SupplierId"));
|
|
|
|
b.Property<string>("SupplierEmail")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("SupplierGender")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("SupplierName")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("SupplierPhoneNo")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.HasKey("SupplierId");
|
|
|
|
b.ToTable("Suppliers");
|
|
});
|
|
|
|
modelBuilder.Entity("PSTW_CentralSystem.Models.ModuleSettingModel", b =>
|
|
{
|
|
b.Property<int>("SettingId")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("SettingId"));
|
|
|
|
b.Property<string>("AllowedUserType")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("Description")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("MethodAllowedUserType")
|
|
.HasColumnType("json");
|
|
|
|
b.Property<string>("ModuleName")
|
|
.IsRequired()
|
|
.HasMaxLength(50)
|
|
.HasColumnType("varchar(50)");
|
|
|
|
b.Property<int>("ModuleStatus")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("SettingId");
|
|
|
|
b.ToTable("ModuleSettings");
|
|
});
|
|
|
|
modelBuilder.Entity("PSTW_CentralSystem.Models.RoleModel", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("ConcurrencyStamp")
|
|
.IsConcurrencyToken()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("Description")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("Name")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("varchar(256)");
|
|
|
|
b.Property<string>("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<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("AccessFailedCount")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ConcurrencyStamp")
|
|
.IsConcurrencyToken()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("Email")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("varchar(256)");
|
|
|
|
b.Property<bool>("EmailConfirmed")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<string>("FullName")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<bool>("LockoutEnabled")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<DateTimeOffset?>("LockoutEnd")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("NormalizedEmail")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("varchar(256)");
|
|
|
|
b.Property<string>("NormalizedUserName")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("varchar(256)");
|
|
|
|
b.Property<string>("PasswordHash")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("PhoneNumber")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<bool>("PhoneNumberConfirmed")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<string>("SecurityStamp")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<bool>("TwoFactorEnabled")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<string>("UserName")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("varchar(256)");
|
|
|
|
b.Property<int?>("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 = "0b144c73-eac3-46ed-b04c-0109e958043c",
|
|
Email = "admin@pstw.com.my",
|
|
EmailConfirmed = true,
|
|
FullName = "MAAdmin",
|
|
LockoutEnabled = false,
|
|
NormalizedEmail = "ADMIN@PSTW.COM.MY",
|
|
NormalizedUserName = "ADMIN@PSTW.COM.MY",
|
|
PasswordHash = "AQAAAAIAAYagAAAAECyQRTu2SEHsnq6Qoyo4OEB8hwfTI97hruTOOWK6/DrCrOEH5th2DpYu2Bq7yUUEaQ==",
|
|
PhoneNumberConfirmed = false,
|
|
SecurityStamp = "6b2ac3ea-069b-4064-a1e5-856e6d183681",
|
|
TwoFactorEnabled = false,
|
|
UserName = "admin@pstw.com.my"
|
|
},
|
|
new
|
|
{
|
|
Id = 2,
|
|
AccessFailedCount = 0,
|
|
ConcurrencyStamp = "4f9d5d52-9123-4715-9453-08607b43fc68",
|
|
Email = "sysadmin@pstw.com.my",
|
|
EmailConfirmed = true,
|
|
FullName = "SysAdmin",
|
|
LockoutEnabled = false,
|
|
NormalizedEmail = "SYSADMIN@PSTW.COM.MY",
|
|
NormalizedUserName = "SYSADMIN@PSTW.COM.MY",
|
|
PasswordHash = "AQAAAAIAAYagAAAAEHhYutnublAEWEf49O5TXjZpXptCyJdu5sD2wVoqRbEdn0COmIYlc5IKFTfCMuDRtQ==",
|
|
PhoneNumberConfirmed = false,
|
|
SecurityStamp = "314fdbc4-826d-4ee9-8296-a90bb6fe19f5",
|
|
TwoFactorEnabled = false,
|
|
UserName = "sysadmin@pstw.com.my"
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
|
|
{
|
|
b.HasOne("PSTW_CentralSystem.Models.RoleModel", null)
|
|
.WithMany()
|
|
.HasForeignKey("RoleId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
|
|
{
|
|
b.HasOne("PSTW_CentralSystem.Models.UserModel", null)
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
|
|
{
|
|
b.HasOne("PSTW_CentralSystem.Models.UserModel", null)
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<int>", 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<int>", 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.CompanyModel", "Company")
|
|
.WithMany()
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Company");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|