From 27d401aa6308e70ae58fcf1a25fc5347c978bf23 Mon Sep 17 00:00:00 2001 From: Wesley Cho Date: Sun, 11 Jan 2026 23:18:45 -0800 Subject: [PATCH] docker sql, migrations --- .../20260112070934_InitialCreate.Designer.cs | 256 ++++++++++++++++++ Migrations/20260112070934_InitialCreate.cs | 99 +++++++ Migrations/Catalog26ContextModelSnapshot.cs | 253 +++++++++++++++++ Models/TDSPriceAvailability.cs | 4 + appsettings.json | 2 +- 5 files changed, 613 insertions(+), 1 deletion(-) create mode 100644 Migrations/20260112070934_InitialCreate.Designer.cs create mode 100644 Migrations/20260112070934_InitialCreate.cs create mode 100644 Migrations/Catalog26ContextModelSnapshot.cs diff --git a/Migrations/20260112070934_InitialCreate.Designer.cs b/Migrations/20260112070934_InitialCreate.Designer.cs new file mode 100644 index 0000000..17c44d7 --- /dev/null +++ b/Migrations/20260112070934_InitialCreate.Designer.cs @@ -0,0 +1,256 @@ +// +using System; +using Catalog26.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Catalog26.Migrations +{ + [DbContext(typeof(Catalog26Context))] + [Migration("20260112070934_InitialCreate")] + partial class InitialCreate + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "10.0.1") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("PricingCatalog.Models.TDSPriceAvailability", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ABCCode") + .HasColumnType("nvarchar(max)"); + + b.Property("COOListCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ContractPrice") + .HasPrecision(12, 2) + .HasColumnType("decimal(12, 2)"); + + b.Property("ETADate") + .HasColumnType("datetime2"); + + b.Property("EduPrice") + .HasPrecision(12, 2) + .HasColumnType("decimal(12, 2)"); + + b.Property("FederalGovPrice") + .HasPrecision(12, 2) + .HasColumnType("decimal(12, 2)"); + + b.Property("GSANTEPrice") + .HasPrecision(12, 2) + .HasColumnType("decimal(12, 2)"); + + b.Property("GSAPricing") + .HasPrecision(12, 2) + .HasColumnType("decimal(12, 2)"); + + b.Property("GovClass") + .HasColumnType("nvarchar(max)"); + + b.Property("Height") + .HasColumnType("nvarchar(max)"); + + b.Property("KitStandAloneFlag") + .HasColumnType("nvarchar(max)"); + + b.Property("Length") + .HasColumnType("nvarchar(max)"); + + b.Property("LongDescription1") + .HasColumnType("nvarchar(max)"); + + b.Property("LongDescription2") + .HasColumnType("nvarchar(max)"); + + b.Property("LongDescription3") + .HasColumnType("nvarchar(max)"); + + b.Property("MAPPrice") + .HasPrecision(12, 2) + .HasColumnType("decimal(12, 2)"); + + b.Property("MSRP") + .HasPrecision(12, 2) + .HasColumnType("decimal(12, 2)"); + + b.Property("MediaTypeCode") + .HasColumnType("nvarchar(max)"); + + b.Property("MfgDropShipWHouseQty") + .HasColumnType("int"); + + b.Property("MfgName") + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("MfgPartNo") + .IsRequired() + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("MinimumQtyOrder") + .HasColumnType("int"); + + b.Property("ParcelShippableFlag") + .HasColumnType("nvarchar(max)"); + + b.Property("PartDescription") + .HasMaxLength(80) + .HasColumnType("nvarchar(80)"); + + b.Property("PartnerCode") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("PlatformType") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductStreetDate") + .HasColumnType("datetime2"); + + b.Property("PromoComment") + .HasColumnType("nvarchar(max)"); + + b.Property("PromoExpDate") + .HasColumnType("datetime2"); + + b.Property("PromoFlag") + .HasColumnType("nvarchar(max)"); + + b.Property("PurchasingRequirements") + .HasColumnType("nvarchar(max)"); + + b.Property("RecordId") + .HasColumnType("nvarchar(max)"); + + b.Property("ReplacementSKU") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnableFlag") + .HasColumnType("nvarchar(max)"); + + b.Property("SKUAttribute") + .HasColumnType("nvarchar(max)"); + + b.Property("SKUCreatedDate") + .HasColumnType("datetime2"); + + b.Property("SerializedFlag") + .HasColumnType("nvarchar(max)"); + + b.Property("ShipWeight") + .HasPrecision(7, 2) + .HasColumnType("decimal(7, 2)"); + + b.Property("StateGovPrice") + .HasPrecision(12, 2) + .HasColumnType("decimal(12, 2)"); + + b.Property("StatusCode") + .HasColumnType("nvarchar(max)"); + + b.Property("TAAFlag") + .HasColumnType("nvarchar(max)"); + + b.Property("TDS_HCPrice") + .HasPrecision(12, 2) + .HasColumnType("decimal(12, 2)"); + + b.Property("TotalQtyOnHand") + .HasColumnType("int"); + + b.Property("UNSPSCCode") + .HasColumnType("nvarchar(max)"); + + b.Property("UPCCode") + .HasColumnType("nvarchar(max)"); + + b.Property("UnitCost") + .HasPrecision(12, 2) + .HasColumnType("decimal(12, 2)"); + + b.Property("VendorCategoryCode") + .HasColumnType("nvarchar(max)"); + + b.Property("VendorPartNo") + .IsRequired() + .HasMaxLength(80) + .HasColumnType("nvarchar(80)"); + + b.Property("VendorSKUNo") + .HasColumnType("nvarchar(max)"); + + b.Property("WQtyOnHand_16DFL") + .HasColumnType("int"); + + b.Property("WQtyOnHand_31DCG") + .HasColumnType("int"); + + b.Property("WQtyOnHand_3DFR_26DHA") + .HasColumnType("int"); + + b.Property("WQtyOnHand_502DGA") + .HasColumnType("int"); + + b.Property("WQtyOnHand_504DIN") + .HasColumnType("int"); + + b.Property("WQtyOnHand_505DFW") + .HasColumnType("int"); + + b.Property("WQtyOnHand_506DFO") + .HasColumnType("int"); + + b.Property("WQtyOnHand_50DCO") + .HasColumnType("int"); + + b.Property("WQtyOnHand_6DCH_29DGU") + .HasColumnType("int"); + + b.Property("WQtyOnHand_7DTN") + .HasColumnType("int"); + + b.Property("WQtyOnHand_80DMS") + .HasColumnType("int"); + + b.Property("WQtyOnHand_81DRN") + .HasColumnType("int"); + + b.Property("WQtyOnHand_Future1") + .HasColumnType("int"); + + b.Property("WQtyOnHand_Future2") + .HasColumnType("int"); + + b.Property("Width") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("TDSPriceAvailability", (string)null); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Migrations/20260112070934_InitialCreate.cs b/Migrations/20260112070934_InitialCreate.cs new file mode 100644 index 0000000..6fc12df --- /dev/null +++ b/Migrations/20260112070934_InitialCreate.cs @@ -0,0 +1,99 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Catalog26.Migrations +{ + /// + public partial class InitialCreate : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "TDSPriceAvailability", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + PartnerCode = table.Column(type: "nvarchar(max)", nullable: false), + RecordId = table.Column(type: "nvarchar(max)", nullable: true), + MfgPartNo = table.Column(type: "nvarchar(60)", maxLength: 60, nullable: false), + VendorPartNo = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: false), + VendorSKUNo = table.Column(type: "nvarchar(max)", nullable: true), + StatusCode = table.Column(type: "nvarchar(max)", nullable: true), + PartDescription = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true), + MfgName = table.Column(type: "nvarchar(30)", maxLength: 30, nullable: true), + TotalQtyOnHand = table.Column(type: "int", nullable: true), + ContractPrice = table.Column(type: "decimal(12,2)", precision: 12, scale: 2, nullable: true), + MSRP = table.Column(type: "decimal(12,2)", precision: 12, scale: 2, nullable: true), + WQtyOnHand_16DFL = table.Column(type: "int", nullable: true), + WQtyOnHand_3DFR_26DHA = table.Column(type: "int", nullable: true), + ReturnableFlag = table.Column(type: "nvarchar(max)", nullable: true), + WQtyOnHand_Future1 = table.Column(type: "int", nullable: true), + ParcelShippableFlag = table.Column(type: "nvarchar(max)", nullable: true), + WQtyOnHand_31DCG = table.Column(type: "int", nullable: true), + UnitCost = table.Column(type: "decimal(12,2)", precision: 12, scale: 2, nullable: true), + WQtyOnHand_6DCH_29DGU = table.Column(type: "int", nullable: true), + MediaTypeCode = table.Column(type: "nvarchar(max)", nullable: true), + WQtyOnHand_7DTN = table.Column(type: "int", nullable: true), + VendorCategoryCode = table.Column(type: "nvarchar(max)", nullable: true), + WQtyOnHand_Future2 = table.Column(type: "int", nullable: true), + ShipWeight = table.Column(type: "decimal(7,2)", precision: 7, scale: 2, nullable: true), + SerializedFlag = table.Column(type: "nvarchar(max)", nullable: true), + WQtyOnHand_50DCO = table.Column(type: "int", nullable: false), + MAPPrice = table.Column(type: "decimal(12,2)", precision: 12, scale: 2, nullable: true), + COOListCode = table.Column(type: "nvarchar(max)", nullable: true), + TDS_HCPrice = table.Column(type: "decimal(12,2)", precision: 12, scale: 2, nullable: true), + UPCCode = table.Column(type: "nvarchar(max)", nullable: true), + UNSPSCCode = table.Column(type: "nvarchar(max)", nullable: true), + SKUCreatedDate = table.Column(type: "datetime2", nullable: true), + SKUAttribute = table.Column(type: "nvarchar(max)", nullable: true), + ETADate = table.Column(type: "datetime2", nullable: true), + ABCCode = table.Column(type: "nvarchar(max)", nullable: true), + KitStandAloneFlag = table.Column(type: "nvarchar(max)", nullable: true), + StateGovPrice = table.Column(type: "decimal(12,2)", precision: 12, scale: 2, nullable: true), + FederalGovPrice = table.Column(type: "decimal(12,2)", precision: 12, scale: 2, nullable: true), + EduPrice = table.Column(type: "decimal(12,2)", precision: 12, scale: 2, nullable: true), + TAAFlag = table.Column(type: "nvarchar(max)", nullable: true), + GSAPricing = table.Column(type: "decimal(12,2)", precision: 12, scale: 2, nullable: true), + PromoFlag = table.Column(type: "nvarchar(max)", nullable: true), + PromoComment = table.Column(type: "nvarchar(max)", nullable: true), + PromoExpDate = table.Column(type: "datetime2", nullable: true), + LongDescription1 = table.Column(type: "nvarchar(max)", nullable: true), + LongDescription2 = table.Column(type: "nvarchar(max)", nullable: true), + LongDescription3 = table.Column(type: "nvarchar(max)", nullable: true), + Length = table.Column(type: "nvarchar(max)", nullable: true), + Width = table.Column(type: "nvarchar(max)", nullable: true), + Height = table.Column(type: "nvarchar(max)", nullable: true), + WQtyOnHand_502DGA = table.Column(type: "int", nullable: true), + GSANTEPrice = table.Column(type: "decimal(12,2)", precision: 12, scale: 2, nullable: true), + PlatformType = table.Column(type: "nvarchar(max)", nullable: true), + ProductDescription = table.Column(type: "nvarchar(max)", nullable: true), + ProductStreetDate = table.Column(type: "datetime2", nullable: true), + WQtyOnHand_80DMS = table.Column(type: "int", nullable: true), + WQtyOnHand_81DRN = table.Column(type: "int", nullable: true), + WQtyOnHand_504DIN = table.Column(type: "int", nullable: true), + WQtyOnHand_505DFW = table.Column(type: "int", nullable: true), + ReplacementSKU = table.Column(type: "nvarchar(max)", nullable: true), + MinimumQtyOrder = table.Column(type: "int", nullable: true), + PurchasingRequirements = table.Column(type: "nvarchar(max)", nullable: true), + GovClass = table.Column(type: "nvarchar(max)", nullable: true), + WQtyOnHand_506DFO = table.Column(type: "int", nullable: true), + MfgDropShipWHouseQty = table.Column(type: "int", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_TDSPriceAvailability", x => x.Id); + }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "TDSPriceAvailability"); + } + } +} diff --git a/Migrations/Catalog26ContextModelSnapshot.cs b/Migrations/Catalog26ContextModelSnapshot.cs new file mode 100644 index 0000000..330d3dc --- /dev/null +++ b/Migrations/Catalog26ContextModelSnapshot.cs @@ -0,0 +1,253 @@ +// +using System; +using Catalog26.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Catalog26.Migrations +{ + [DbContext(typeof(Catalog26Context))] + partial class Catalog26ContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "10.0.1") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("PricingCatalog.Models.TDSPriceAvailability", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ABCCode") + .HasColumnType("nvarchar(max)"); + + b.Property("COOListCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ContractPrice") + .HasPrecision(12, 2) + .HasColumnType("decimal(12, 2)"); + + b.Property("ETADate") + .HasColumnType("datetime2"); + + b.Property("EduPrice") + .HasPrecision(12, 2) + .HasColumnType("decimal(12, 2)"); + + b.Property("FederalGovPrice") + .HasPrecision(12, 2) + .HasColumnType("decimal(12, 2)"); + + b.Property("GSANTEPrice") + .HasPrecision(12, 2) + .HasColumnType("decimal(12, 2)"); + + b.Property("GSAPricing") + .HasPrecision(12, 2) + .HasColumnType("decimal(12, 2)"); + + b.Property("GovClass") + .HasColumnType("nvarchar(max)"); + + b.Property("Height") + .HasColumnType("nvarchar(max)"); + + b.Property("KitStandAloneFlag") + .HasColumnType("nvarchar(max)"); + + b.Property("Length") + .HasColumnType("nvarchar(max)"); + + b.Property("LongDescription1") + .HasColumnType("nvarchar(max)"); + + b.Property("LongDescription2") + .HasColumnType("nvarchar(max)"); + + b.Property("LongDescription3") + .HasColumnType("nvarchar(max)"); + + b.Property("MAPPrice") + .HasPrecision(12, 2) + .HasColumnType("decimal(12, 2)"); + + b.Property("MSRP") + .HasPrecision(12, 2) + .HasColumnType("decimal(12, 2)"); + + b.Property("MediaTypeCode") + .HasColumnType("nvarchar(max)"); + + b.Property("MfgDropShipWHouseQty") + .HasColumnType("int"); + + b.Property("MfgName") + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("MfgPartNo") + .IsRequired() + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("MinimumQtyOrder") + .HasColumnType("int"); + + b.Property("ParcelShippableFlag") + .HasColumnType("nvarchar(max)"); + + b.Property("PartDescription") + .HasMaxLength(80) + .HasColumnType("nvarchar(80)"); + + b.Property("PartnerCode") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("PlatformType") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductStreetDate") + .HasColumnType("datetime2"); + + b.Property("PromoComment") + .HasColumnType("nvarchar(max)"); + + b.Property("PromoExpDate") + .HasColumnType("datetime2"); + + b.Property("PromoFlag") + .HasColumnType("nvarchar(max)"); + + b.Property("PurchasingRequirements") + .HasColumnType("nvarchar(max)"); + + b.Property("RecordId") + .HasColumnType("nvarchar(max)"); + + b.Property("ReplacementSKU") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnableFlag") + .HasColumnType("nvarchar(max)"); + + b.Property("SKUAttribute") + .HasColumnType("nvarchar(max)"); + + b.Property("SKUCreatedDate") + .HasColumnType("datetime2"); + + b.Property("SerializedFlag") + .HasColumnType("nvarchar(max)"); + + b.Property("ShipWeight") + .HasPrecision(7, 2) + .HasColumnType("decimal(7, 2)"); + + b.Property("StateGovPrice") + .HasPrecision(12, 2) + .HasColumnType("decimal(12, 2)"); + + b.Property("StatusCode") + .HasColumnType("nvarchar(max)"); + + b.Property("TAAFlag") + .HasColumnType("nvarchar(max)"); + + b.Property("TDS_HCPrice") + .HasPrecision(12, 2) + .HasColumnType("decimal(12, 2)"); + + b.Property("TotalQtyOnHand") + .HasColumnType("int"); + + b.Property("UNSPSCCode") + .HasColumnType("nvarchar(max)"); + + b.Property("UPCCode") + .HasColumnType("nvarchar(max)"); + + b.Property("UnitCost") + .HasPrecision(12, 2) + .HasColumnType("decimal(12, 2)"); + + b.Property("VendorCategoryCode") + .HasColumnType("nvarchar(max)"); + + b.Property("VendorPartNo") + .IsRequired() + .HasMaxLength(80) + .HasColumnType("nvarchar(80)"); + + b.Property("VendorSKUNo") + .HasColumnType("nvarchar(max)"); + + b.Property("WQtyOnHand_16DFL") + .HasColumnType("int"); + + b.Property("WQtyOnHand_31DCG") + .HasColumnType("int"); + + b.Property("WQtyOnHand_3DFR_26DHA") + .HasColumnType("int"); + + b.Property("WQtyOnHand_502DGA") + .HasColumnType("int"); + + b.Property("WQtyOnHand_504DIN") + .HasColumnType("int"); + + b.Property("WQtyOnHand_505DFW") + .HasColumnType("int"); + + b.Property("WQtyOnHand_506DFO") + .HasColumnType("int"); + + b.Property("WQtyOnHand_50DCO") + .HasColumnType("int"); + + b.Property("WQtyOnHand_6DCH_29DGU") + .HasColumnType("int"); + + b.Property("WQtyOnHand_7DTN") + .HasColumnType("int"); + + b.Property("WQtyOnHand_80DMS") + .HasColumnType("int"); + + b.Property("WQtyOnHand_81DRN") + .HasColumnType("int"); + + b.Property("WQtyOnHand_Future1") + .HasColumnType("int"); + + b.Property("WQtyOnHand_Future2") + .HasColumnType("int"); + + b.Property("Width") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("TDSPriceAvailability", (string)null); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Models/TDSPriceAvailability.cs b/Models/TDSPriceAvailability.cs index 81e28ab..7276fcb 100644 --- a/Models/TDSPriceAvailability.cs +++ b/Models/TDSPriceAvailability.cs @@ -13,14 +13,18 @@ public class TDSPriceAvailability public required string PartnerCode { get; set; } public string? RecordId { get; set; } [Display(Name = "Mfg PartNo")] + [MaxLength(60)] public required string MfgPartNo { get; set; } [Display(Name = "Vendor PartNo")] + [MaxLength(80)] public required string VendorPartNo { get; set; } public string? VendorSKUNo { get; set; } public string? StatusCode { get; set; } [Display(Name = "Product Description")] + [MaxLength(80)] public string? PartDescription { get; set; } [Display(Name = "Mfg Name")] + [MaxLength(30)] public string? MfgName { get; set; } [Display(Name = "Total Quantity")] public int? TotalQtyOnHand { get; set; } diff --git a/appsettings.json b/appsettings.json index 51095a8..95529b8 100644 --- a/appsettings.json +++ b/appsettings.json @@ -8,6 +8,6 @@ }, "AllowedHosts": "*", "ConnectionStrings": { - "Catalog26Context": "Server=localhost;Database=Catalog;User ID=dbuser;Password=dbpass;Integrated Security=false;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True" + "Catalog26Context": "Server=sql1.chopark.home;Database=Catalog;User ID=sa;Password=dbP@ss01;Integrated Security=false;MultipleActiveResultSets=true;TrustServerCertificate=True" } } \ No newline at end of file