988 lines
36 KiB
C#
988 lines
36 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(CentralSystemContext))]
|
|
[Migration("20250220015910_UpdateDatabaseChanges")]
|
|
partial class UpdateDatabaseChanges
|
|
{
|
|
/// <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
|
|
},
|
|
new
|
|
{
|
|
UserId = 2,
|
|
RoleId = 2
|
|
});
|
|
});
|
|
|
|
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.InventoryMasterModel", b =>
|
|
{
|
|
b.Property<int>("StoreId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("UserId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("StoreId");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.ToTable("InventoryMasters");
|
|
});
|
|
|
|
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.ItemModel", b =>
|
|
{
|
|
b.Property<int>("ItemID")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("ItemID"));
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<float>("ConvertPrice")
|
|
.HasColumnType("float");
|
|
|
|
b.Property<int>("CreatedByUserId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Currency")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<float>("CurrencyRate")
|
|
.HasColumnType("float");
|
|
|
|
b.Property<DateTime?>("DODate")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("DONo")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<float>("DefaultPrice")
|
|
.HasColumnType("float");
|
|
|
|
b.Property<int>("DepartmentId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("EndWDate")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<DateTime?>("InvoiceDate")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("InvoiceNo")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<int>("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<int?>("MovementId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("PONo")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("PartNumber")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<int>("ProductId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("PurchaseDate")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<int>("Quantity")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("SerialNumber")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("Supplier")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("TeamType")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("UniqueID")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<int>("Warranty")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("ItemID");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.HasIndex("CreatedByUserId");
|
|
|
|
b.HasIndex("DepartmentId");
|
|
|
|
b.HasIndex("MovementId")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("ProductId");
|
|
|
|
b.ToTable("Items");
|
|
});
|
|
|
|
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.ItemMovementModel", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("Action")
|
|
.HasColumnType("longtext")
|
|
.HasComment("Register, StockIn, Stock Out");
|
|
|
|
b.Property<string>("ConsignmentNote")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<DateTime>("Date")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<int>("ItemId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("LastStation")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("LastStore")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("LastUser")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("LatestStatus")
|
|
.HasColumnType("longtext")
|
|
.HasComment("Repair, Calibration, Faulty, Ready To Deploy, On Delivery");
|
|
|
|
b.Property<bool>("MovementComplete")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<int?>("Quantity")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Remark")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("ToOther")
|
|
.HasColumnType("longtext")
|
|
.HasComment("Repair, Calibration, Faulty, Ready To Deploy, On Delivery");
|
|
|
|
b.Property<int?>("ToStation")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("ToStore")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("ToUser")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("LastStation");
|
|
|
|
b.HasIndex("LastStore");
|
|
|
|
b.HasIndex("LastUser");
|
|
|
|
b.HasIndex("ToStation");
|
|
|
|
b.HasIndex("ToStore");
|
|
|
|
b.HasIndex("ToUser");
|
|
|
|
b.ToTable("ItemMovements");
|
|
});
|
|
|
|
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.ManufacturerModel", b =>
|
|
{
|
|
b.Property<int>("ManufacturerId")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("ManufacturerId"));
|
|
|
|
b.Property<string>("ManufacturerName")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.HasKey("ManufacturerId");
|
|
|
|
b.ToTable("Manufacturers");
|
|
});
|
|
|
|
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<string>("ImageProduct")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<int>("ManufacturerId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ModelNo")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("ProductName")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("ProductShortName")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<int?>("QuantityProduct")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("ProductId");
|
|
|
|
b.HasIndex("ManufacturerId");
|
|
|
|
b.ToTable("Products");
|
|
});
|
|
|
|
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.RequestModel", b =>
|
|
{
|
|
b.Property<int>("requestId")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("requestId"));
|
|
|
|
b.Property<DateTime>("approvalDate")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("remark")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<DateTime>("requestDate")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("status")
|
|
.HasColumnType("longtext");
|
|
|
|
b.HasKey("requestId");
|
|
|
|
b.ToTable("Request");
|
|
});
|
|
|
|
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.StationModel", b =>
|
|
{
|
|
b.Property<int>("StationId")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("StationId"));
|
|
|
|
b.Property<int>("DepartmentId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("StationName")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<int>("StationPicID")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("StationId");
|
|
|
|
b.HasIndex("DepartmentId");
|
|
|
|
b.HasIndex("StationPicID");
|
|
|
|
b.ToTable("Stations");
|
|
});
|
|
|
|
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.StoreModel", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("StoreName")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.ToTable("Stores");
|
|
});
|
|
|
|
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>("SupplierAddress")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("SupplierCompName")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("SupplierEmail")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("SupplierPIC")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("SupplierPhoneNo")
|
|
.HasColumnType("longtext");
|
|
|
|
b.HasKey("SupplierId");
|
|
|
|
b.ToTable("Suppliers");
|
|
});
|
|
|
|
modelBuilder.Entity("PSTW_CentralSystem.Models.CompanyModel", b =>
|
|
{
|
|
b.Property<int>("CompanyId")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("CompanyId"));
|
|
|
|
b.Property<string>("CompanyName")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.HasKey("CompanyId");
|
|
|
|
b.ToTable("Companies");
|
|
});
|
|
|
|
modelBuilder.Entity("PSTW_CentralSystem.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>("DepartmentCode")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("DepartmentName")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.HasKey("DepartmentId");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.ToTable("Departments");
|
|
});
|
|
|
|
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"
|
|
},
|
|
new
|
|
{
|
|
Id = 5,
|
|
Description = "Handle inventory module",
|
|
Name = "Inventory Master",
|
|
NormalizedName = "INVENTORY MASTER"
|
|
},
|
|
new
|
|
{
|
|
Id = 6,
|
|
Description = "Involve in inventory transaction",
|
|
Name = "Finance",
|
|
NormalizedName = "FINANCE"
|
|
});
|
|
});
|
|
|
|
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<int?>("UserInfoStatus")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("UserName")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("varchar(256)");
|
|
|
|
b.Property<int?>("departmentId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("NormalizedEmail")
|
|
.HasDatabaseName("EmailIndex");
|
|
|
|
b.HasIndex("NormalizedUserName")
|
|
.IsUnique()
|
|
.HasDatabaseName("UserNameIndex");
|
|
|
|
b.HasIndex("departmentId");
|
|
|
|
b.ToTable("AspNetUsers", (string)null);
|
|
|
|
b.HasData(
|
|
new
|
|
{
|
|
Id = 1,
|
|
AccessFailedCount = 0,
|
|
ConcurrencyStamp = "6b8e8dbd-4380-4e8c-aa0b-1c1fffc3059c",
|
|
Email = "admin@pstw.com.my",
|
|
EmailConfirmed = true,
|
|
FullName = "MAAdmin",
|
|
LockoutEnabled = false,
|
|
NormalizedEmail = "ADMIN@PSTW.COM.MY",
|
|
NormalizedUserName = "ADMIN@PSTW.COM.MY",
|
|
PasswordHash = "AQAAAAIAAYagAAAAEFKtr2LZjKgfLzY44m8cVW4qpdwci45lnh/t3ioymIh6Ib6c85ne3QGfnUAyERwMWg==",
|
|
PhoneNumberConfirmed = false,
|
|
SecurityStamp = "79e606c8-032b-426b-8fb2-7727b93823eb",
|
|
TwoFactorEnabled = false,
|
|
UserInfoStatus = 1,
|
|
UserName = "admin@pstw.com.my"
|
|
},
|
|
new
|
|
{
|
|
Id = 2,
|
|
AccessFailedCount = 0,
|
|
ConcurrencyStamp = "8bf46c63-d7df-4ac5-bab2-fc15fe881302",
|
|
Email = "sysadmin@pstw.com.my",
|
|
EmailConfirmed = true,
|
|
FullName = "SysAdmin",
|
|
LockoutEnabled = false,
|
|
NormalizedEmail = "SYSADMIN@PSTW.COM.MY",
|
|
NormalizedUserName = "SYSADMIN@PSTW.COM.MY",
|
|
PasswordHash = "AQAAAAIAAYagAAAAEB/4JzIPKQK76gM4+Ddc948BoBumC8oa2Ya4odgM4r6P+LNaWRaLOaFG4bp0Iya9Sg==",
|
|
PhoneNumberConfirmed = false,
|
|
SecurityStamp = "5ac5ec31-c25f-4a7a-8057-664ecdf76108",
|
|
TwoFactorEnabled = false,
|
|
UserInfoStatus = 1,
|
|
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.InventoryMasterModel", b =>
|
|
{
|
|
b.HasOne("PSTW_CentralSystem.Areas.Inventory.Models.StoreModel", "Store")
|
|
.WithMany()
|
|
.HasForeignKey("StoreId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PSTW_CentralSystem.Models.UserModel", "User")
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Store");
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
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.ItemMovementModel", "Movement")
|
|
.WithOne("Item")
|
|
.HasForeignKey("PSTW_CentralSystem.Areas.Inventory.Models.ItemModel", "MovementId");
|
|
|
|
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("Movement");
|
|
|
|
b.Navigation("Product");
|
|
});
|
|
|
|
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.ItemMovementModel", b =>
|
|
{
|
|
b.HasOne("PSTW_CentralSystem.Areas.Inventory.Models.StationModel", "FromStation")
|
|
.WithMany()
|
|
.HasForeignKey("LastStation");
|
|
|
|
b.HasOne("PSTW_CentralSystem.Areas.Inventory.Models.StoreModel", "FromStore")
|
|
.WithMany()
|
|
.HasForeignKey("LastStore");
|
|
|
|
b.HasOne("PSTW_CentralSystem.Models.UserModel", "FromUser")
|
|
.WithMany()
|
|
.HasForeignKey("LastUser");
|
|
|
|
b.HasOne("PSTW_CentralSystem.Areas.Inventory.Models.StationModel", "NextStation")
|
|
.WithMany()
|
|
.HasForeignKey("ToStation");
|
|
|
|
b.HasOne("PSTW_CentralSystem.Areas.Inventory.Models.StoreModel", "NextStore")
|
|
.WithMany()
|
|
.HasForeignKey("ToStore");
|
|
|
|
b.HasOne("PSTW_CentralSystem.Models.UserModel", "NextUser")
|
|
.WithMany()
|
|
.HasForeignKey("ToUser");
|
|
|
|
b.Navigation("FromStation");
|
|
|
|
b.Navigation("FromStore");
|
|
|
|
b.Navigation("FromUser");
|
|
|
|
b.Navigation("NextStation");
|
|
|
|
b.Navigation("NextStore");
|
|
|
|
b.Navigation("NextUser");
|
|
});
|
|
|
|
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.Areas.Inventory.Models.StationModel", b =>
|
|
{
|
|
b.HasOne("PSTW_CentralSystem.Models.DepartmentModel", "Department")
|
|
.WithMany()
|
|
.HasForeignKey("DepartmentId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PSTW_CentralSystem.Models.UserModel", "StationPic")
|
|
.WithMany()
|
|
.HasForeignKey("StationPicID")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Department");
|
|
|
|
b.Navigation("StationPic");
|
|
});
|
|
|
|
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.StoreModel", b =>
|
|
{
|
|
b.HasOne("PSTW_CentralSystem.Models.CompanyModel", "Company")
|
|
.WithMany()
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Company");
|
|
});
|
|
|
|
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.ItemMovementModel", b =>
|
|
{
|
|
b.Navigation("Item");
|
|
});
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|