using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace BusinessERP.Migrations { public partial class InitialCreate : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "AspNetRoles", columns: table => new { Id = table.Column(type: "nvarchar(450)", nullable: false), Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), NormalizedName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), ConcurrencyStamp = table.Column(type: "nvarchar(max)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_AspNetRoles", x => x.Id); }); migrationBuilder.CreateTable( name: "AspNetUsers", columns: table => new { Id = table.Column(type: "nvarchar(450)", nullable: false), UserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), NormalizedUserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), Email = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), NormalizedEmail = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), EmailConfirmed = table.Column(type: "bit", nullable: false), PasswordHash = table.Column(type: "nvarchar(max)", nullable: true), SecurityStamp = table.Column(type: "nvarchar(max)", nullable: true), ConcurrencyStamp = table.Column(type: "nvarchar(max)", nullable: true), PhoneNumber = table.Column(type: "nvarchar(max)", nullable: true), PhoneNumberConfirmed = table.Column(type: "bit", nullable: false), TwoFactorEnabled = table.Column(type: "bit", nullable: false), LockoutEnd = table.Column(type: "datetimeoffset", nullable: true), LockoutEnabled = table.Column(type: "bit", nullable: false), AccessFailedCount = table.Column(type: "int", nullable: false) }, constraints: table => { table.PrimaryKey("PK_AspNetUsers", x => x.Id); }); migrationBuilder.CreateTable( name: "Attendance", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), EmployeeId = table.Column(type: "bigint", nullable: false), CheckIn = table.Column(type: "datetime2", nullable: false), CheckOut = table.Column(type: "datetime2", nullable: false), StayTime = table.Column(type: "time", nullable: false), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Attendance", x => x.Id); }); migrationBuilder.CreateTable( name: "AuditLogs", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), UserId = table.Column(type: "nvarchar(max)", nullable: true), Type = table.Column(type: "nvarchar(max)", nullable: true), TableName = table.Column(type: "nvarchar(max)", nullable: true), DateTime = table.Column(type: "datetime2", nullable: false), OldValues = table.Column(type: "nvarchar(max)", nullable: true), NewValues = table.Column(type: "nvarchar(max)", nullable: true), AffectedColumns = table.Column(type: "nvarchar(max)", nullable: true), PrimaryKey = table.Column(type: "nvarchar(max)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_AuditLogs", x => x.Id); }); migrationBuilder.CreateTable( name: "Branch", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(max)", nullable: true), ContactPerson = table.Column(type: "nvarchar(max)", nullable: true), PhoneNumber = table.Column(type: "nvarchar(max)", nullable: true), Address = table.Column(type: "nvarchar(max)", nullable: true), ShortDescription = table.Column(type: "nvarchar(max)", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Branch", x => x.Id); }); migrationBuilder.CreateTable( name: "Categories", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(max)", nullable: true), Description = table.Column(type: "nvarchar(max)", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Categories", x => x.Id); }); migrationBuilder.CreateTable( name: "CompanyInfo", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(max)", nullable: true), Logo = table.Column(type: "nvarchar(max)", nullable: true), InvoiceNoPrefix = table.Column(type: "nvarchar(max)", nullable: true), QuoteNoPrefix = table.Column(type: "nvarchar(max)", nullable: true), Address = table.Column(type: "nvarchar(max)", nullable: true), City = table.Column(type: "nvarchar(max)", nullable: true), Country = table.Column(type: "nvarchar(max)", nullable: true), Phone = table.Column(type: "nvarchar(max)", nullable: true), Email = table.Column(type: "nvarchar(max)", nullable: true), Fax = table.Column(type: "nvarchar(max)", nullable: true), Website = table.Column(type: "nvarchar(max)", nullable: true), ShopNo = table.Column(type: "nvarchar(max)", nullable: true), StreetName = table.Column(type: "nvarchar(max)", nullable: true), PostCode = table.Column(type: "nvarchar(max)", nullable: true), Office = table.Column(type: "nvarchar(max)", nullable: true), Mobile = table.Column(type: "nvarchar(max)", nullable: true), Password = table.Column(type: "nvarchar(max)", nullable: true), HostName = table.Column(type: "nvarchar(max)", nullable: true), TermsAndCondition = table.Column(type: "nvarchar(max)", nullable: true), TermsAndConditionItemSale = table.Column(type: "nvarchar(max)", nullable: true), CompanyNumber = table.Column(type: "nvarchar(max)", nullable: true), VatNumber = table.Column(type: "nvarchar(max)", nullable: true), CardPercentage = table.Column(type: "nvarchar(max)", nullable: true), IsVat = table.Column(type: "bit", nullable: false), WhitelistIP = table.Column(type: "nvarchar(max)", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_CompanyInfo", x => x.Id); }); migrationBuilder.CreateTable( name: "Currency", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(max)", nullable: true), Code = table.Column(type: "nvarchar(max)", nullable: true), Symbol = table.Column(type: "nvarchar(max)", nullable: true), Country = table.Column(type: "nvarchar(max)", nullable: true), Description = table.Column(type: "nvarchar(max)", nullable: true), IsDefault = table.Column(type: "bit", nullable: false), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Currency", x => x.Id); }); migrationBuilder.CreateTable( name: "CustomerInfo", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(max)", nullable: true), CompanyName = table.Column(type: "nvarchar(max)", nullable: true), Type = table.Column(type: "bigint", nullable: false), Phone = table.Column(type: "nvarchar(max)", nullable: true), Email = table.Column(type: "nvarchar(max)", nullable: true), AccountNo = table.Column(type: "nvarchar(max)", nullable: true), Notes = table.Column(type: "nvarchar(max)", nullable: true), Address = table.Column(type: "nvarchar(max)", nullable: true), AddressPostcode = table.Column(type: "nvarchar(max)", nullable: true), BillingAddress = table.Column(type: "nvarchar(max)", nullable: true), BillingAddressPostcode = table.Column(type: "nvarchar(max)", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_CustomerInfo", x => x.Id); }); migrationBuilder.CreateTable( name: "CustomerType", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(max)", nullable: true), Description = table.Column(type: "nvarchar(max)", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_CustomerType", x => x.Id); }); migrationBuilder.CreateTable( name: "DamageItemDeatils", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), ItemId = table.Column(type: "bigint", nullable: false), TotalDamageItem = table.Column(type: "int", nullable: false), ReasonOfDamage = table.Column(type: "nvarchar(max)", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_DamageItemDeatils", x => x.Id); }); migrationBuilder.CreateTable( name: "DefaultIdentityOptions", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), PasswordRequireDigit = table.Column(type: "bit", nullable: false), PasswordRequiredLength = table.Column(type: "int", nullable: false), PasswordRequireNonAlphanumeric = table.Column(type: "bit", nullable: false), PasswordRequireUppercase = table.Column(type: "bit", nullable: false), PasswordRequireLowercase = table.Column(type: "bit", nullable: false), PasswordRequiredUniqueChars = table.Column(type: "int", nullable: false), LockoutDefaultLockoutTimeSpanInMinutes = table.Column(type: "float", nullable: false), LockoutMaxFailedAccessAttempts = table.Column(type: "int", nullable: false), LockoutAllowedForNewUsers = table.Column(type: "bit", nullable: false), UserRequireUniqueEmail = table.Column(type: "bit", nullable: false), SignInRequireConfirmedEmail = table.Column(type: "bit", nullable: false), CookieHttpOnly = table.Column(type: "bit", nullable: false), CookieExpiration = table.Column(type: "float", nullable: false), CookieExpireTimeSpan = table.Column(type: "float", nullable: false), LoginPath = table.Column(type: "nvarchar(max)", nullable: true), LogoutPath = table.Column(type: "nvarchar(max)", nullable: true), AccessDeniedPath = table.Column(type: "nvarchar(max)", nullable: true), SlidingExpiration = table.Column(type: "bit", nullable: false), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_DefaultIdentityOptions", x => x.Id); }); migrationBuilder.CreateTable( name: "Department", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(max)", nullable: true), Description = table.Column(type: "nvarchar(max)", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Department", x => x.Id); }); migrationBuilder.CreateTable( name: "Designation", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(max)", nullable: true), Description = table.Column(type: "nvarchar(max)", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Designation", x => x.Id); }); migrationBuilder.CreateTable( name: "EmailConfig", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Email = table.Column(type: "nvarchar(max)", nullable: true), Password = table.Column(type: "nvarchar(max)", nullable: true), Hostname = table.Column(type: "nvarchar(max)", nullable: true), Port = table.Column(type: "int", nullable: false), SSLEnabled = table.Column(type: "bit", nullable: false), SenderFullName = table.Column(type: "nvarchar(max)", nullable: true), IsDefault = table.Column(type: "bit", nullable: false), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_EmailConfig", x => x.Id); }); migrationBuilder.CreateTable( name: "Employee", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), EmployeeId = table.Column(type: "nvarchar(max)", nullable: true), FirstName = table.Column(type: "nvarchar(max)", nullable: true), LastName = table.Column(type: "nvarchar(max)", nullable: true), DateOfBirth = table.Column(type: "datetime2", nullable: false), Designation = table.Column(type: "int", nullable: false), Department = table.Column(type: "int", nullable: false), SubDepartment = table.Column(type: "int", nullable: true), JoiningDate = table.Column(type: "datetime2", nullable: false), LeavingDate = table.Column(type: "datetime2", nullable: false), Phone = table.Column(type: "nvarchar(max)", nullable: true), Email = table.Column(type: "nvarchar(max)", nullable: true), Address = table.Column(type: "nvarchar(max)", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Employee", x => x.Id); }); migrationBuilder.CreateTable( name: "ExpenseDetails", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), ExpenseSummaryId = table.Column(type: "bigint", nullable: false), ExpenseTypeId = table.Column(type: "bigint", nullable: false), ExpenseType = table.Column(type: "nvarchar(max)", nullable: true), Description = table.Column(type: "nvarchar(max)", nullable: true), Quantity = table.Column(type: "int", nullable: false), UnitPrice = table.Column(type: "float", nullable: false), TotalPrice = table.Column(type: "float", nullable: false), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ExpenseDetails", x => x.Id); }); migrationBuilder.CreateTable( name: "ExpenseSummary", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Title = table.Column(type: "nvarchar(max)", nullable: true), GrandTotal = table.Column(type: "float", nullable: false), PaidAmount = table.Column(type: "float", nullable: false), DueAmount = table.Column(type: "float", nullable: false), ChangeAmount = table.Column(type: "float", nullable: false), CurrencyCode = table.Column(type: "bigint", nullable: false), BranchId = table.Column(type: "bigint", nullable: false), Action = table.Column(type: "int", nullable: false), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ExpenseSummary", x => x.Id); }); migrationBuilder.CreateTable( name: "ExpenseType", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(max)", nullable: true), Description = table.Column(type: "nvarchar(max)", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ExpenseType", x => x.Id); }); migrationBuilder.CreateTable( name: "ItemDropdownListViewModel", columns: table => new { Id = table.Column(type: "bigint", nullable: false), Name = table.Column(type: "nvarchar(max)", nullable: true) }, constraints: table => { }); migrationBuilder.CreateTable( name: "ItemGridViewModel", columns: table => new { Id = table.Column(type: "bigint", nullable: true), Code = table.Column(type: "nvarchar(max)", nullable: true), Name = table.Column(type: "nvarchar(max)", nullable: true), SupplierName = table.Column(type: "nvarchar(max)", nullable: true), MeasureName = table.Column(type: "nvarchar(max)", nullable: true), StockKeepingUnit = table.Column(type: "nvarchar(max)", nullable: true), CostPrice = table.Column(type: "float", nullable: false), NormalPrice = table.Column(type: "float", nullable: false), Quantity = table.Column(type: "int", nullable: true), TotalSold = table.Column(type: "int", nullable: true), TotalEarned = table.Column(type: "float", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: false), ImageURL = table.Column(type: "nvarchar(max)", nullable: true) }, constraints: table => { }); migrationBuilder.CreateTable( name: "Items", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Code = table.Column(type: "nvarchar(max)", nullable: true), Name = table.Column(type: "nvarchar(max)", nullable: true), OldUnitPrice = table.Column(type: "float", nullable: false), OldSellPrice = table.Column(type: "float", nullable: false), Quantity = table.Column(type: "int", nullable: false), CategoriesId = table.Column(type: "bigint", nullable: true), WarehouseId = table.Column(type: "bigint", nullable: true), SupplierId = table.Column(type: "bigint", nullable: true), MeasureId = table.Column(type: "bigint", nullable: true), MeasureValue = table.Column(type: "float", nullable: true), Note = table.Column(type: "nvarchar(max)", nullable: true), UpdateQntType = table.Column(type: "nvarchar(max)", nullable: true), UpdateQntNote = table.Column(type: "nvarchar(max)", nullable: true), StockKeepingUnit = table.Column(type: "nvarchar(max)", nullable: true), ManufactureDate = table.Column(type: "datetime2", nullable: false), ExpirationDate = table.Column(type: "datetime2", nullable: false), Barcode = table.Column(type: "nvarchar(max)", nullable: true), ProductLevel = table.Column(type: "nvarchar(max)", nullable: true), CostPrice = table.Column(type: "float", nullable: false), NormalPrice = table.Column(type: "float", nullable: false), TradePrice = table.Column(type: "float", nullable: true), PremiumPrice = table.Column(type: "float", nullable: true), OtherPrice = table.Column(type: "float", nullable: true), CostVAT = table.Column(type: "float", nullable: true), NormalVAT = table.Column(type: "float", nullable: true), PremiumVAT = table.Column(type: "float", nullable: true), TradeVAT = table.Column(type: "float", nullable: true), OtherVAT = table.Column(type: "float", nullable: true), VatPercentage = table.Column(type: "float", nullable: false), ImageURL = table.Column(type: "nvarchar(max)", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Items", x => x.Id); }); migrationBuilder.CreateTable( name: "ItemSerialNumber", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), PaymentDetailId = table.Column(type: "bigint", nullable: false), SerialNumber = table.Column(type: "nvarchar(max)", nullable: true), Note = table.Column(type: "nvarchar(max)", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ItemSerialNumber", x => x.Id); }); migrationBuilder.CreateTable( name: "ItemsHistory", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), ItemId = table.Column(type: "bigint", nullable: false), CostPrice = table.Column(type: "float", nullable: false), NormalPrice = table.Column(type: "float", nullable: false), OldUnitPrice = table.Column(type: "float", nullable: false), OldSellPrice = table.Column(type: "float", nullable: false), OldQuantity = table.Column(type: "int", nullable: false), NewQuantity = table.Column(type: "int", nullable: false), TranQuantity = table.Column(type: "int", nullable: false), Action = table.Column(type: "nvarchar(max)", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ItemsHistory", x => x.Id); }); migrationBuilder.CreateTable( name: "LoginHistory", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), UserName = table.Column(type: "nvarchar(max)", nullable: true), LoginTime = table.Column(type: "datetime2", nullable: false), LogoutTime = table.Column(type: "datetime2", nullable: true), Duration = table.Column(type: "float", nullable: false), PublicIP = table.Column(type: "nvarchar(max)", nullable: true), Latitude = table.Column(type: "nvarchar(max)", nullable: true), Longitude = table.Column(type: "nvarchar(max)", nullable: true), Browser = table.Column(type: "nvarchar(max)", nullable: true), OperatingSystem = table.Column(type: "nvarchar(max)", nullable: true), Device = table.Column(type: "nvarchar(max)", nullable: true), Action = table.Column(type: "nvarchar(max)", nullable: true), ActionStatus = table.Column(type: "nvarchar(max)", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_LoginHistory", x => x.Id); }); migrationBuilder.CreateTable( name: "Payment", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), CustomerId = table.Column(type: "bigint", nullable: false), InvoiceNo = table.Column(type: "nvarchar(max)", nullable: true), QuoteNo = table.Column(type: "nvarchar(max)", nullable: true), CommonCharge = table.Column(type: "float", nullable: false), Discount = table.Column(type: "float", nullable: false), DiscountAmount = table.Column(type: "float", nullable: false), VAT = table.Column(type: "float", nullable: false), VATAmount = table.Column(type: "float", nullable: false), SubTotal = table.Column(type: "float", nullable: false), GrandTotal = table.Column(type: "float", nullable: true), PaidAmount = table.Column(type: "float", nullable: false), DueAmount = table.Column(type: "float", nullable: false), ChangedAmount = table.Column(type: "float", nullable: false), CurrencyId = table.Column(type: "bigint", nullable: false), BranchId = table.Column(type: "bigint", nullable: false), PaymentStatus = table.Column(type: "bigint", nullable: false), Category = table.Column(type: "int", nullable: false), PurchaseOrderNumber = table.Column(type: "nvarchar(max)", nullable: true), CustomerNote = table.Column(type: "nvarchar(max)", nullable: true), PrivateNote = table.Column(type: "nvarchar(max)", nullable: true), ReturnType = table.Column(type: "int", nullable: false), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Payment", x => x.Id); }); migrationBuilder.CreateTable( name: "PaymentDetail", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), PaymentId = table.Column(type: "bigint", nullable: false), ItemId = table.Column(type: "bigint", nullable: false), ItemName = table.Column(type: "nvarchar(max)", nullable: true), Quantity = table.Column(type: "int", nullable: false), UnitPrice = table.Column(type: "float", nullable: true), ItemVAT = table.Column(type: "float", nullable: true), ItemVATAmount = table.Column(type: "float", nullable: true), ItemDiscount = table.Column(type: "float", nullable: true), ItemDiscountAmount = table.Column(type: "float", nullable: true), TotalAmount = table.Column(type: "float", nullable: true), IsReturn = table.Column(type: "bit", nullable: false), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_PaymentDetail", x => x.Id); }); migrationBuilder.CreateTable( name: "PaymentModeHistory", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), PaymentId = table.Column(type: "bigint", nullable: false), PaymentType = table.Column(type: "int", nullable: false), ModeOfPayment = table.Column(type: "nvarchar(max)", nullable: true), Amount = table.Column(type: "float", nullable: true), ReferenceNo = table.Column(type: "nvarchar(max)", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_PaymentModeHistory", x => x.Id); }); migrationBuilder.CreateTable( name: "PaymentStatus", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(max)", nullable: true), Description = table.Column(type: "nvarchar(max)", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_PaymentStatus", x => x.Id); }); migrationBuilder.CreateTable( name: "PaymentType", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(max)", nullable: true), Description = table.Column(type: "nvarchar(max)", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_PaymentType", x => x.Id); }); migrationBuilder.CreateTable( name: "PurchasesPayment", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), SupplierId = table.Column(type: "bigint", nullable: false), InvoiceNo = table.Column(type: "nvarchar(max)", nullable: true), QuoteNo = table.Column(type: "nvarchar(max)", nullable: true), CommonCharge = table.Column(type: "float", nullable: false), Discount = table.Column(type: "float", nullable: false), DiscountAmount = table.Column(type: "float", nullable: false), VAT = table.Column(type: "float", nullable: false), VATAmount = table.Column(type: "float", nullable: false), SubTotal = table.Column(type: "float", nullable: false), GrandTotal = table.Column(type: "float", nullable: true), PaidAmount = table.Column(type: "float", nullable: false), DueAmount = table.Column(type: "float", nullable: false), ChangedAmount = table.Column(type: "float", nullable: false), CurrencyId = table.Column(type: "bigint", nullable: false), BranchId = table.Column(type: "bigint", nullable: false), PaymentStatus = table.Column(type: "bigint", nullable: false), Category = table.Column(type: "int", nullable: false), PurchaseOrderNumber = table.Column(type: "nvarchar(max)", nullable: true), CustomerNote = table.Column(type: "nvarchar(max)", nullable: true), PrivateNote = table.Column(type: "nvarchar(max)", nullable: true), ReturnType = table.Column(type: "int", nullable: false), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_PurchasesPayment", x => x.Id); }); migrationBuilder.CreateTable( name: "PurchasesPaymentDetail", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), PaymentId = table.Column(type: "bigint", nullable: false), ItemId = table.Column(type: "bigint", nullable: false), ItemName = table.Column(type: "nvarchar(max)", nullable: true), Quantity = table.Column(type: "int", nullable: false), UnitPrice = table.Column(type: "float", nullable: true), ItemVAT = table.Column(type: "float", nullable: true), ItemVATAmount = table.Column(type: "float", nullable: true), ItemDiscount = table.Column(type: "float", nullable: true), ItemDiscountAmount = table.Column(type: "float", nullable: true), TotalAmount = table.Column(type: "float", nullable: true), IsReturn = table.Column(type: "bit", nullable: false), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_PurchasesPaymentDetail", x => x.Id); }); migrationBuilder.CreateTable( name: "RefreshToken", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), UserId = table.Column(type: "nvarchar(max)", nullable: true), Token = table.Column(type: "nvarchar(max)", nullable: true), JwtId = table.Column(type: "nvarchar(max)", nullable: true), IsUsed = table.Column(type: "bit", nullable: false), IsRevorked = table.Column(type: "bit", nullable: false), AddedDate = table.Column(type: "datetime2", nullable: false), ExpiryDate = table.Column(type: "datetime2", nullable: false), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_RefreshToken", x => x.Id); }); migrationBuilder.CreateTable( name: "ReturnLog", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), RefId = table.Column(type: "bigint", nullable: false), InvoiceNo = table.Column(type: "nvarchar(max)", nullable: true), CustomerId = table.Column(type: "bigint", nullable: false), TranType = table.Column(type: "nvarchar(max)", nullable: true), Note = table.Column(type: "nvarchar(max)", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ReturnLog", x => x.Id); }); migrationBuilder.CreateTable( name: "SendEmailHistory", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), InvoiceId = table.Column(type: "bigint", nullable: false), SenderEmail = table.Column(type: "nvarchar(max)", nullable: true), ReceiverEmail = table.Column(type: "nvarchar(max)", nullable: true), Result = table.Column(type: "nvarchar(max)", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_SendEmailHistory", x => x.Id); }); migrationBuilder.CreateTable( name: "SendGridSetting", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), SendGridUser = table.Column(type: "nvarchar(max)", nullable: true), SendGridKey = table.Column(type: "nvarchar(max)", nullable: true), FromEmail = table.Column(type: "nvarchar(max)", nullable: true), FromFullName = table.Column(type: "nvarchar(max)", nullable: true), IsDefault = table.Column(type: "bit", nullable: false), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_SendGridSetting", x => x.Id); }); migrationBuilder.CreateTable( name: "SMTPEmailSetting", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), UserName = table.Column(type: "nvarchar(max)", nullable: true), Password = table.Column(type: "nvarchar(max)", nullable: true), Host = table.Column(type: "nvarchar(max)", nullable: true), Port = table.Column(type: "int", nullable: false), IsSSL = table.Column(type: "bit", nullable: false), FromEmail = table.Column(type: "nvarchar(max)", nullable: true), FromFullName = table.Column(type: "nvarchar(max)", nullable: true), IsDefault = table.Column(type: "bit", nullable: false), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_SMTPEmailSetting", x => x.Id); }); migrationBuilder.CreateTable( name: "SubDepartment", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), DepartmentId = table.Column(type: "bigint", nullable: false), Name = table.Column(type: "nvarchar(max)", nullable: true), Description = table.Column(type: "nvarchar(max)", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_SubDepartment", x => x.Id); }); migrationBuilder.CreateTable( name: "Supplier", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(max)", nullable: true), ContactPerson = table.Column(type: "nvarchar(max)", nullable: true), Email = table.Column(type: "nvarchar(max)", nullable: true), Phone = table.Column(type: "nvarchar(max)", nullable: true), Address = table.Column(type: "nvarchar(max)", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Supplier", x => x.Id); }); migrationBuilder.CreateTable( name: "UnitsofMeasure", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(max)", nullable: true), Description = table.Column(type: "nvarchar(max)", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_UnitsofMeasure", x => x.Id); }); migrationBuilder.CreateTable( name: "UserInfoFromBrowser", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), BrowserUniqueID = table.Column(type: "nvarchar(max)", nullable: true), Lat = table.Column(type: "nvarchar(max)", nullable: true), Long = table.Column(type: "nvarchar(max)", nullable: true), TimeZone = table.Column(type: "nvarchar(max)", nullable: true), BrowserMajor = table.Column(type: "nvarchar(max)", nullable: true), BrowserName = table.Column(type: "nvarchar(max)", nullable: true), BrowserVersion = table.Column(type: "nvarchar(max)", nullable: true), CPUArchitecture = table.Column(type: "nvarchar(max)", nullable: true), DeviceModel = table.Column(type: "nvarchar(max)", nullable: true), DeviceType = table.Column(type: "nvarchar(max)", nullable: true), DeviceVendor = table.Column(type: "nvarchar(max)", nullable: true), EngineName = table.Column(type: "nvarchar(max)", nullable: true), EngineVersion = table.Column(type: "nvarchar(max)", nullable: true), OSName = table.Column(type: "nvarchar(max)", nullable: true), OSVersion = table.Column(type: "nvarchar(max)", nullable: true), UA = table.Column(type: "nvarchar(max)", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_UserInfoFromBrowser", x => x.Id); }); migrationBuilder.CreateTable( name: "UserProfile", columns: table => new { UserProfileId = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), ApplicationUserId = table.Column(type: "nvarchar(max)", nullable: true), FirstName = table.Column(type: "nvarchar(max)", nullable: true), LastName = table.Column(type: "nvarchar(max)", nullable: true), PhoneNumber = table.Column(type: "nvarchar(max)", nullable: true), Email = table.Column(type: "nvarchar(max)", nullable: true), Address = table.Column(type: "nvarchar(max)", nullable: true), Country = table.Column(type: "nvarchar(max)", nullable: true), PasswordHash = table.Column(type: "nvarchar(max)", nullable: true), ConfirmPassword = table.Column(type: "nvarchar(max)", nullable: true), OldPassword = table.Column(type: "nvarchar(max)", nullable: true), ProfilePicture = table.Column(type: "nvarchar(max)", nullable: true), BranchId = table.Column(type: "bigint", nullable: false), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_UserProfile", x => x.UserProfileId); }); migrationBuilder.CreateTable( name: "VatPercentage", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(max)", nullable: true), Percentage = table.Column(type: "float", nullable: false), IsDefault = table.Column(type: "bit", nullable: false), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_VatPercentage", x => x.Id); }); migrationBuilder.CreateTable( name: "Warehouse", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(max)", nullable: true), Description = table.Column(type: "nvarchar(max)", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), Cancelled = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Warehouse", x => x.Id); }); migrationBuilder.CreateTable( name: "AspNetRoleClaims", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), RoleId = table.Column(type: "nvarchar(450)", nullable: false), ClaimType = table.Column(type: "nvarchar(max)", nullable: true), ClaimValue = table.Column(type: "nvarchar(max)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id); table.ForeignKey( name: "FK_AspNetRoleClaims_AspNetRoles_RoleId", column: x => x.RoleId, principalTable: "AspNetRoles", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "AspNetUserClaims", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), UserId = table.Column(type: "nvarchar(450)", nullable: false), ClaimType = table.Column(type: "nvarchar(max)", nullable: true), ClaimValue = table.Column(type: "nvarchar(max)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_AspNetUserClaims", x => x.Id); table.ForeignKey( name: "FK_AspNetUserClaims_AspNetUsers_UserId", column: x => x.UserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "AspNetUserLogins", columns: table => new { LoginProvider = table.Column(type: "nvarchar(450)", nullable: false), ProviderKey = table.Column(type: "nvarchar(450)", nullable: false), ProviderDisplayName = table.Column(type: "nvarchar(max)", nullable: true), UserId = table.Column(type: "nvarchar(450)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey }); table.ForeignKey( name: "FK_AspNetUserLogins_AspNetUsers_UserId", column: x => x.UserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "AspNetUserRoles", columns: table => new { UserId = table.Column(type: "nvarchar(450)", nullable: false), RoleId = table.Column(type: "nvarchar(450)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId }); table.ForeignKey( name: "FK_AspNetUserRoles_AspNetRoles_RoleId", column: x => x.RoleId, principalTable: "AspNetRoles", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_AspNetUserRoles_AspNetUsers_UserId", column: x => x.UserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "AspNetUserTokens", columns: table => new { UserId = table.Column(type: "nvarchar(450)", nullable: false), LoginProvider = table.Column(type: "nvarchar(450)", nullable: false), Name = table.Column(type: "nvarchar(450)", nullable: false), Value = table.Column(type: "nvarchar(max)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); table.ForeignKey( name: "FK_AspNetUserTokens_AspNetUsers_UserId", column: x => x.UserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_AspNetRoleClaims_RoleId", table: "AspNetRoleClaims", column: "RoleId"); migrationBuilder.CreateIndex( name: "RoleNameIndex", table: "AspNetRoles", column: "NormalizedName", unique: true, filter: "[NormalizedName] IS NOT NULL"); migrationBuilder.CreateIndex( name: "IX_AspNetUserClaims_UserId", table: "AspNetUserClaims", column: "UserId"); migrationBuilder.CreateIndex( name: "IX_AspNetUserLogins_UserId", table: "AspNetUserLogins", column: "UserId"); migrationBuilder.CreateIndex( name: "IX_AspNetUserRoles_RoleId", table: "AspNetUserRoles", column: "RoleId"); migrationBuilder.CreateIndex( name: "EmailIndex", table: "AspNetUsers", column: "NormalizedEmail"); migrationBuilder.CreateIndex( name: "UserNameIndex", table: "AspNetUsers", column: "NormalizedUserName", unique: true, filter: "[NormalizedUserName] IS NOT NULL"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "AspNetRoleClaims"); migrationBuilder.DropTable( name: "AspNetUserClaims"); migrationBuilder.DropTable( name: "AspNetUserLogins"); migrationBuilder.DropTable( name: "AspNetUserRoles"); migrationBuilder.DropTable( name: "AspNetUserTokens"); migrationBuilder.DropTable( name: "Attendance"); migrationBuilder.DropTable( name: "AuditLogs"); migrationBuilder.DropTable( name: "Branch"); migrationBuilder.DropTable( name: "Categories"); migrationBuilder.DropTable( name: "CompanyInfo"); migrationBuilder.DropTable( name: "Currency"); migrationBuilder.DropTable( name: "CustomerInfo"); migrationBuilder.DropTable( name: "CustomerType"); migrationBuilder.DropTable( name: "DamageItemDeatils"); migrationBuilder.DropTable( name: "DefaultIdentityOptions"); migrationBuilder.DropTable( name: "Department"); migrationBuilder.DropTable( name: "Designation"); migrationBuilder.DropTable( name: "EmailConfig"); migrationBuilder.DropTable( name: "Employee"); migrationBuilder.DropTable( name: "ExpenseDetails"); migrationBuilder.DropTable( name: "ExpenseSummary"); migrationBuilder.DropTable( name: "ExpenseType"); migrationBuilder.DropTable( name: "ItemDropdownListViewModel"); migrationBuilder.DropTable( name: "ItemGridViewModel"); migrationBuilder.DropTable( name: "Items"); migrationBuilder.DropTable( name: "ItemSerialNumber"); migrationBuilder.DropTable( name: "ItemsHistory"); migrationBuilder.DropTable( name: "LoginHistory"); migrationBuilder.DropTable( name: "Payment"); migrationBuilder.DropTable( name: "PaymentDetail"); migrationBuilder.DropTable( name: "PaymentModeHistory"); migrationBuilder.DropTable( name: "PaymentStatus"); migrationBuilder.DropTable( name: "PaymentType"); migrationBuilder.DropTable( name: "PurchasesPayment"); migrationBuilder.DropTable( name: "PurchasesPaymentDetail"); migrationBuilder.DropTable( name: "RefreshToken"); migrationBuilder.DropTable( name: "ReturnLog"); migrationBuilder.DropTable( name: "SendEmailHistory"); migrationBuilder.DropTable( name: "SendGridSetting"); migrationBuilder.DropTable( name: "SMTPEmailSetting"); migrationBuilder.DropTable( name: "SubDepartment"); migrationBuilder.DropTable( name: "Supplier"); migrationBuilder.DropTable( name: "UnitsofMeasure"); migrationBuilder.DropTable( name: "UserInfoFromBrowser"); migrationBuilder.DropTable( name: "UserProfile"); migrationBuilder.DropTable( name: "VatPercentage"); migrationBuilder.DropTable( name: "Warehouse"); migrationBuilder.DropTable( name: "AspNetRoles"); migrationBuilder.DropTable( name: "AspNetUsers"); } } }