Initial commit
This commit is contained in:
405
PartSource.Data/Migrations/20190811020941_ImportDateDcfMapping.Designer.cs
generated
Normal file
405
PartSource.Data/Migrations/20190811020941_ImportDateDcfMapping.Designer.cs
generated
Normal file
@@ -0,0 +1,405 @@
|
||||
// <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 PartSource.Data;
|
||||
|
||||
namespace PartSource.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(PartSourceContext))]
|
||||
[Migration("20190811020941_ImportDateDcfMapping")]
|
||||
partial class ImportDateDcfMapping
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "2.2.2-servicing-10034")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.ApiClient", b =>
|
||||
{
|
||||
b.Property<string>("Key")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<bool>("Active");
|
||||
|
||||
b.Property<string>("AppName");
|
||||
|
||||
b.Property<string>("Secret");
|
||||
|
||||
b.HasKey("Key");
|
||||
|
||||
b.ToTable("ApiClient");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.BaseVehicle", b =>
|
||||
{
|
||||
b.Property<int>("Id");
|
||||
|
||||
b.Property<int>("VehicleMakeId");
|
||||
|
||||
b.Property<int>("VehicleModelId");
|
||||
|
||||
b.Property<int>("Year");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("BaseVehicle","Vehicle");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.DcfMapping", b =>
|
||||
{
|
||||
b.Property<string>("LineCode");
|
||||
|
||||
b.Property<string>("WhiCode");
|
||||
|
||||
b.HasKey("LineCode", "WhiCode");
|
||||
|
||||
b.ToTable("DcfMapping");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.Fitment", b =>
|
||||
{
|
||||
b.Property<int>("FitmentId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<int?>("BaseVehicleId");
|
||||
|
||||
b.Property<int?>("EngineConfigId");
|
||||
|
||||
b.Property<string>("ManufacturerCode");
|
||||
|
||||
b.Property<string>("NoteText");
|
||||
|
||||
b.Property<string>("PartLabel");
|
||||
|
||||
b.Property<string>("PartNumber");
|
||||
|
||||
b.Property<string>("Position");
|
||||
|
||||
b.HasKey("FitmentId");
|
||||
|
||||
b.ToTable("Fitment");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.ImportData", b =>
|
||||
{
|
||||
b.Property<string>("VariantSku")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("BodyHtml");
|
||||
|
||||
b.Property<decimal>("CompareAt");
|
||||
|
||||
b.Property<string>("ImageAltText");
|
||||
|
||||
b.Property<string>("ImageSrc");
|
||||
|
||||
b.Property<bool?>("IsFitment");
|
||||
|
||||
b.Property<bool?>("IsVariant");
|
||||
|
||||
b.Property<string>("LineCode");
|
||||
|
||||
b.Property<string>("PartNumber");
|
||||
|
||||
b.Property<decimal>("Price");
|
||||
|
||||
b.Property<long?>("ShopifyId");
|
||||
|
||||
b.Property<string>("Title");
|
||||
|
||||
b.Property<string>("VariantTitle");
|
||||
|
||||
b.Property<string>("Vendor");
|
||||
|
||||
b.HasKey("VariantSku");
|
||||
|
||||
b.ToTable("ImportData");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.ImportMetric", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<int?>("ChangedItems");
|
||||
|
||||
b.Property<DateTime>("ImportDate");
|
||||
|
||||
b.Property<int?>("TotalItems");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("ImportMetric");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.Manufacturer", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<string>("LineCode");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Manufacturer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.Part", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.Property<int>("ManufacturerId");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<string>("PartNumber");
|
||||
|
||||
b.Property<long?>("ShopifyId");
|
||||
|
||||
b.Property<int>("Sku");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ManufacturerId");
|
||||
|
||||
b.ToTable("Part");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.PartData", b =>
|
||||
{
|
||||
b.Property<string>("SKU")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("BRAND_NM")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("CATEGORY_NM")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("CORPORATE_STATUS_NM")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<decimal?>("Compare_Price")
|
||||
.HasColumnName("Compare Price")
|
||||
.HasColumnType("money");
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS1")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS10")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS11")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS12")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS13")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS14")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS2")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS3")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS4")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS5")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS6")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS7")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS8")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS9")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FINELINE_NM")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<byte?>("IsFitment");
|
||||
|
||||
b.Property<string>("LOB_NM")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("Line_Code")
|
||||
.HasColumnName("Line Code")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("PRODUCT_ENGLISH_LONG_DESC")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("Part_Number")
|
||||
.HasColumnName("Part Number")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<byte?>("Published");
|
||||
|
||||
b.Property<string>("SUBCATEGORY_NM")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("Tested")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("Title");
|
||||
|
||||
b.Property<string>("VariantTitle");
|
||||
|
||||
b.Property<decimal?>("Your_Price")
|
||||
.HasColumnName("Your Price")
|
||||
.HasColumnType("money");
|
||||
|
||||
b.HasKey("SKU");
|
||||
|
||||
b.ToTable("PartData");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.PartImage", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<string>("Sku");
|
||||
|
||||
b.Property<string>("Url");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("PartImage");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.PartPrice", b =>
|
||||
{
|
||||
b.Property<string>("SKU")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Active");
|
||||
|
||||
b.Property<decimal?>("Compare_Price");
|
||||
|
||||
b.Property<decimal?>("Your_Price");
|
||||
|
||||
b.HasKey("SKU");
|
||||
|
||||
b.ToTable("PartPrice");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.PartsAvailability", b =>
|
||||
{
|
||||
b.Property<int>("Store");
|
||||
|
||||
b.Property<int>("SKU");
|
||||
|
||||
b.Property<string>("Line_Code")
|
||||
.HasColumnName("Line Code")
|
||||
.HasMaxLength(50);
|
||||
|
||||
b.Property<string>("Part_Number")
|
||||
.HasColumnName("Part Number")
|
||||
.HasMaxLength(50);
|
||||
|
||||
b.Property<int?>("QTY");
|
||||
|
||||
b.HasKey("Store", "SKU");
|
||||
|
||||
b.ToTable("PartsAvailability");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.Submodel", b =>
|
||||
{
|
||||
b.Property<int>("VehicleToEngineConfigId");
|
||||
|
||||
b.Property<int>("BaseVehicleId");
|
||||
|
||||
b.Property<int>("EngineId");
|
||||
|
||||
b.Property<int>("SubmodelId");
|
||||
|
||||
b.HasKey("VehicleToEngineConfigId");
|
||||
|
||||
b.ToTable("Submodel","Vehicle");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.VehicleEngine", b =>
|
||||
{
|
||||
b.Property<int>("Id");
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("VehicleEngine","Vehicle");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.VehicleMake", b =>
|
||||
{
|
||||
b.Property<int>("Id");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("VehicleMake","Vehicle");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.VehicleModel", b =>
|
||||
{
|
||||
b.Property<int>("Id");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<int>("VehicleMakeId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("VehicleModel","Vehicle");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.DcfMapping", b =>
|
||||
{
|
||||
b.HasOne("PartSource.Data.Models.ImportData")
|
||||
.WithMany("DcfMapping")
|
||||
.HasForeignKey("LineCode")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.Part", b =>
|
||||
{
|
||||
b.HasOne("PartSource.Data.Models.Manufacturer", "Manufacturer")
|
||||
.WithMany()
|
||||
.HasForeignKey("ManufacturerId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,358 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace PartSource.Data.Migrations
|
||||
{
|
||||
public partial class ImportDateDcfMapping : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.EnsureSchema(
|
||||
name: "Vehicle");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ApiClient",
|
||||
columns: table => new
|
||||
{
|
||||
Key = table.Column<string>(nullable: false),
|
||||
AppName = table.Column<string>(nullable: true),
|
||||
Secret = table.Column<string>(nullable: true),
|
||||
Active = table.Column<bool>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ApiClient", x => x.Key);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Fitment",
|
||||
columns: table => new
|
||||
{
|
||||
FitmentId = table.Column<int>(nullable: false)
|
||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||
ManufacturerCode = table.Column<string>(nullable: true),
|
||||
PartNumber = table.Column<string>(nullable: true),
|
||||
PartLabel = table.Column<string>(nullable: true),
|
||||
BaseVehicleId = table.Column<int>(nullable: true),
|
||||
EngineConfigId = table.Column<int>(nullable: true),
|
||||
NoteText = table.Column<string>(nullable: true),
|
||||
Position = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Fitment", x => x.FitmentId);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ImportData",
|
||||
columns: table => new
|
||||
{
|
||||
VariantSku = table.Column<string>(nullable: false),
|
||||
Title = table.Column<string>(nullable: true),
|
||||
BodyHtml = table.Column<string>(nullable: true),
|
||||
Vendor = table.Column<string>(nullable: true),
|
||||
IsVariant = table.Column<bool>(nullable: true),
|
||||
VariantTitle = table.Column<string>(nullable: true),
|
||||
Price = table.Column<decimal>(nullable: false),
|
||||
CompareAt = table.Column<decimal>(nullable: false),
|
||||
ShopifyId = table.Column<long>(nullable: true),
|
||||
ImageSrc = table.Column<string>(nullable: true),
|
||||
ImageAltText = table.Column<string>(nullable: true),
|
||||
IsFitment = table.Column<bool>(nullable: true),
|
||||
LineCode = table.Column<string>(nullable: true),
|
||||
PartNumber = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ImportData", x => x.VariantSku);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ImportMetric",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||
TotalItems = table.Column<int>(nullable: true),
|
||||
ChangedItems = table.Column<int>(nullable: true),
|
||||
ImportDate = table.Column<DateTime>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ImportMetric", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Manufacturer",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||
Name = table.Column<string>(nullable: true),
|
||||
LineCode = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Manufacturer", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PartData",
|
||||
columns: table => new
|
||||
{
|
||||
SKU = table.Column<string>(maxLength: 255, nullable: false),
|
||||
LOB_NM = table.Column<string>(maxLength: 255, nullable: true),
|
||||
CATEGORY_NM = table.Column<string>(maxLength: 255, nullable: true),
|
||||
SUBCATEGORY_NM = table.Column<string>(maxLength: 255, nullable: true),
|
||||
FINELINE_NM = table.Column<string>(maxLength: 255, nullable: true),
|
||||
PRODUCT_ENGLISH_LONG_DESC = table.Column<string>(maxLength: 255, nullable: true),
|
||||
BRAND_NM = table.Column<string>(maxLength: 255, nullable: true),
|
||||
CORPORATE_STATUS_NM = table.Column<string>(maxLength: 255, nullable: true),
|
||||
FAMILY_FEATURES_BENEFITS1 = table.Column<string>(maxLength: 255, nullable: true),
|
||||
FAMILY_FEATURES_BENEFITS2 = table.Column<string>(maxLength: 255, nullable: true),
|
||||
FAMILY_FEATURES_BENEFITS3 = table.Column<string>(maxLength: 255, nullable: true),
|
||||
FAMILY_FEATURES_BENEFITS4 = table.Column<string>(maxLength: 255, nullable: true),
|
||||
FAMILY_FEATURES_BENEFITS5 = table.Column<string>(maxLength: 255, nullable: true),
|
||||
FAMILY_FEATURES_BENEFITS6 = table.Column<string>(maxLength: 255, nullable: true),
|
||||
FAMILY_FEATURES_BENEFITS7 = table.Column<string>(maxLength: 255, nullable: true),
|
||||
FAMILY_FEATURES_BENEFITS8 = table.Column<string>(maxLength: 255, nullable: true),
|
||||
FAMILY_FEATURES_BENEFITS9 = table.Column<string>(maxLength: 255, nullable: true),
|
||||
FAMILY_FEATURES_BENEFITS10 = table.Column<string>(maxLength: 255, nullable: true),
|
||||
FAMILY_FEATURES_BENEFITS11 = table.Column<string>(maxLength: 255, nullable: true),
|
||||
FAMILY_FEATURES_BENEFITS12 = table.Column<string>(maxLength: 255, nullable: true),
|
||||
FAMILY_FEATURES_BENEFITS13 = table.Column<string>(maxLength: 255, nullable: true),
|
||||
FAMILY_FEATURES_BENEFITS14 = table.Column<string>(maxLength: 255, nullable: true),
|
||||
Tested = table.Column<string>(maxLength: 255, nullable: true),
|
||||
LineCode = table.Column<string>(name: "Line Code", maxLength: 255, nullable: true),
|
||||
PartNumber = table.Column<string>(name: "Part Number", maxLength: 255, nullable: true),
|
||||
ComparePrice = table.Column<decimal>(name: "Compare Price", type: "money", nullable: true),
|
||||
YourPrice = table.Column<decimal>(name: "Your Price", type: "money", nullable: true),
|
||||
Title = table.Column<string>(nullable: true),
|
||||
VariantTitle = table.Column<string>(nullable: true),
|
||||
IsFitment = table.Column<byte>(nullable: true),
|
||||
Published = table.Column<byte>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PartData", x => x.SKU);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PartImage",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||
Sku = table.Column<string>(nullable: true),
|
||||
Url = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PartImage", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PartPrice",
|
||||
columns: table => new
|
||||
{
|
||||
SKU = table.Column<string>(nullable: false),
|
||||
Compare_Price = table.Column<decimal>(nullable: true),
|
||||
Your_Price = table.Column<decimal>(nullable: true),
|
||||
Active = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PartPrice", x => x.SKU);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PartsAvailability",
|
||||
columns: table => new
|
||||
{
|
||||
Store = table.Column<int>(nullable: false),
|
||||
SKU = table.Column<int>(nullable: false),
|
||||
LineCode = table.Column<string>(name: "Line Code", maxLength: 50, nullable: true),
|
||||
PartNumber = table.Column<string>(name: "Part Number", maxLength: 50, nullable: true),
|
||||
QTY = table.Column<int>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PartsAvailability", x => new { x.Store, x.SKU });
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "BaseVehicle",
|
||||
schema: "Vehicle",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false),
|
||||
Year = table.Column<int>(nullable: false),
|
||||
VehicleMakeId = table.Column<int>(nullable: false),
|
||||
VehicleModelId = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_BaseVehicle", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Submodel",
|
||||
schema: "Vehicle",
|
||||
columns: table => new
|
||||
{
|
||||
VehicleToEngineConfigId = table.Column<int>(nullable: false),
|
||||
SubmodelId = table.Column<int>(nullable: false),
|
||||
BaseVehicleId = table.Column<int>(nullable: false),
|
||||
EngineId = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Submodel", x => x.VehicleToEngineConfigId);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "VehicleEngine",
|
||||
schema: "Vehicle",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false),
|
||||
Description = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_VehicleEngine", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "VehicleMake",
|
||||
schema: "Vehicle",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false),
|
||||
Name = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_VehicleMake", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "VehicleModel",
|
||||
schema: "Vehicle",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false),
|
||||
Name = table.Column<string>(nullable: true),
|
||||
VehicleMakeId = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_VehicleModel", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DcfMapping",
|
||||
columns: table => new
|
||||
{
|
||||
LineCode = table.Column<string>(nullable: false),
|
||||
WhiCode = table.Column<string>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DcfMapping", x => new { x.LineCode, x.WhiCode });
|
||||
table.ForeignKey(
|
||||
name: "FK_DcfMapping_ImportData_LineCode",
|
||||
column: x => x.LineCode,
|
||||
principalTable: "ImportData",
|
||||
principalColumn: "VariantSku",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Part",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||
ManufacturerId = table.Column<int>(nullable: false),
|
||||
ShopifyId = table.Column<long>(nullable: true),
|
||||
Sku = table.Column<int>(nullable: false),
|
||||
PartNumber = table.Column<string>(nullable: true),
|
||||
Name = table.Column<string>(nullable: true),
|
||||
Description = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Part", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Part_Manufacturer_ManufacturerId",
|
||||
column: x => x.ManufacturerId,
|
||||
principalTable: "Manufacturer",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Part_ManufacturerId",
|
||||
table: "Part",
|
||||
column: "ManufacturerId");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "ApiClient");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "DcfMapping");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Fitment");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ImportMetric");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Part");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "PartData");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "PartImage");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "PartPrice");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "PartsAvailability");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "BaseVehicle",
|
||||
schema: "Vehicle");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Submodel",
|
||||
schema: "Vehicle");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "VehicleEngine",
|
||||
schema: "Vehicle");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "VehicleMake",
|
||||
schema: "Vehicle");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "VehicleModel",
|
||||
schema: "Vehicle");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ImportData");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Manufacturer");
|
||||
}
|
||||
}
|
||||
}
|
||||
403
PartSource.Data/Migrations/PartSourceContextModelSnapshot.cs
Normal file
403
PartSource.Data/Migrations/PartSourceContextModelSnapshot.cs
Normal file
@@ -0,0 +1,403 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using PartSource.Data;
|
||||
|
||||
namespace PartSource.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(PartSourceContext))]
|
||||
partial class PartSourceContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "2.2.2-servicing-10034")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.ApiClient", b =>
|
||||
{
|
||||
b.Property<string>("Key")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<bool>("Active");
|
||||
|
||||
b.Property<string>("AppName");
|
||||
|
||||
b.Property<string>("Secret");
|
||||
|
||||
b.HasKey("Key");
|
||||
|
||||
b.ToTable("ApiClient");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.BaseVehicle", b =>
|
||||
{
|
||||
b.Property<int>("Id");
|
||||
|
||||
b.Property<int>("VehicleMakeId");
|
||||
|
||||
b.Property<int>("VehicleModelId");
|
||||
|
||||
b.Property<int>("Year");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("BaseVehicle","Vehicle");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.DcfMapping", b =>
|
||||
{
|
||||
b.Property<string>("LineCode");
|
||||
|
||||
b.Property<string>("WhiCode");
|
||||
|
||||
b.HasKey("LineCode", "WhiCode");
|
||||
|
||||
b.ToTable("DcfMapping");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.Fitment", b =>
|
||||
{
|
||||
b.Property<int>("FitmentId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<int?>("BaseVehicleId");
|
||||
|
||||
b.Property<int?>("EngineConfigId");
|
||||
|
||||
b.Property<string>("ManufacturerCode");
|
||||
|
||||
b.Property<string>("NoteText");
|
||||
|
||||
b.Property<string>("PartLabel");
|
||||
|
||||
b.Property<string>("PartNumber");
|
||||
|
||||
b.Property<string>("Position");
|
||||
|
||||
b.HasKey("FitmentId");
|
||||
|
||||
b.ToTable("Fitment");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.ImportData", b =>
|
||||
{
|
||||
b.Property<string>("VariantSku")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("BodyHtml");
|
||||
|
||||
b.Property<decimal>("CompareAt");
|
||||
|
||||
b.Property<string>("ImageAltText");
|
||||
|
||||
b.Property<string>("ImageSrc");
|
||||
|
||||
b.Property<bool?>("IsFitment");
|
||||
|
||||
b.Property<bool?>("IsVariant");
|
||||
|
||||
b.Property<string>("LineCode");
|
||||
|
||||
b.Property<string>("PartNumber");
|
||||
|
||||
b.Property<decimal>("Price");
|
||||
|
||||
b.Property<long?>("ShopifyId");
|
||||
|
||||
b.Property<string>("Title");
|
||||
|
||||
b.Property<string>("VariantTitle");
|
||||
|
||||
b.Property<string>("Vendor");
|
||||
|
||||
b.HasKey("VariantSku");
|
||||
|
||||
b.ToTable("ImportData");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.ImportMetric", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<int?>("ChangedItems");
|
||||
|
||||
b.Property<DateTime>("ImportDate");
|
||||
|
||||
b.Property<int?>("TotalItems");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("ImportMetric");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.Manufacturer", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<string>("LineCode");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Manufacturer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.Part", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.Property<int>("ManufacturerId");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<string>("PartNumber");
|
||||
|
||||
b.Property<long?>("ShopifyId");
|
||||
|
||||
b.Property<int>("Sku");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ManufacturerId");
|
||||
|
||||
b.ToTable("Part");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.PartData", b =>
|
||||
{
|
||||
b.Property<string>("SKU")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("BRAND_NM")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("CATEGORY_NM")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("CORPORATE_STATUS_NM")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<decimal?>("Compare_Price")
|
||||
.HasColumnName("Compare Price")
|
||||
.HasColumnType("money");
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS1")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS10")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS11")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS12")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS13")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS14")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS2")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS3")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS4")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS5")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS6")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS7")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS8")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FAMILY_FEATURES_BENEFITS9")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("FINELINE_NM")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<byte?>("IsFitment");
|
||||
|
||||
b.Property<string>("LOB_NM")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("Line_Code")
|
||||
.HasColumnName("Line Code")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("PRODUCT_ENGLISH_LONG_DESC")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("Part_Number")
|
||||
.HasColumnName("Part Number")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<byte?>("Published");
|
||||
|
||||
b.Property<string>("SUBCATEGORY_NM")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("Tested")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("Title");
|
||||
|
||||
b.Property<string>("VariantTitle");
|
||||
|
||||
b.Property<decimal?>("Your_Price")
|
||||
.HasColumnName("Your Price")
|
||||
.HasColumnType("money");
|
||||
|
||||
b.HasKey("SKU");
|
||||
|
||||
b.ToTable("PartData");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.PartImage", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<string>("Sku");
|
||||
|
||||
b.Property<string>("Url");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("PartImage");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.PartPrice", b =>
|
||||
{
|
||||
b.Property<string>("SKU")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Active");
|
||||
|
||||
b.Property<decimal?>("Compare_Price");
|
||||
|
||||
b.Property<decimal?>("Your_Price");
|
||||
|
||||
b.HasKey("SKU");
|
||||
|
||||
b.ToTable("PartPrice");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.PartsAvailability", b =>
|
||||
{
|
||||
b.Property<int>("Store");
|
||||
|
||||
b.Property<int>("SKU");
|
||||
|
||||
b.Property<string>("Line_Code")
|
||||
.HasColumnName("Line Code")
|
||||
.HasMaxLength(50);
|
||||
|
||||
b.Property<string>("Part_Number")
|
||||
.HasColumnName("Part Number")
|
||||
.HasMaxLength(50);
|
||||
|
||||
b.Property<int?>("QTY");
|
||||
|
||||
b.HasKey("Store", "SKU");
|
||||
|
||||
b.ToTable("PartsAvailability");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.Submodel", b =>
|
||||
{
|
||||
b.Property<int>("VehicleToEngineConfigId");
|
||||
|
||||
b.Property<int>("BaseVehicleId");
|
||||
|
||||
b.Property<int>("EngineId");
|
||||
|
||||
b.Property<int>("SubmodelId");
|
||||
|
||||
b.HasKey("VehicleToEngineConfigId");
|
||||
|
||||
b.ToTable("Submodel","Vehicle");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.VehicleEngine", b =>
|
||||
{
|
||||
b.Property<int>("Id");
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("VehicleEngine","Vehicle");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.VehicleMake", b =>
|
||||
{
|
||||
b.Property<int>("Id");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("VehicleMake","Vehicle");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.VehicleModel", b =>
|
||||
{
|
||||
b.Property<int>("Id");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<int>("VehicleMakeId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("VehicleModel","Vehicle");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.DcfMapping", b =>
|
||||
{
|
||||
b.HasOne("PartSource.Data.Models.ImportData")
|
||||
.WithMany("DcfMapping")
|
||||
.HasForeignKey("LineCode")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PartSource.Data.Models.Part", b =>
|
||||
{
|
||||
b.HasOne("PartSource.Data.Models.Manufacturer", "Manufacturer")
|
||||
.WithMany()
|
||||
.HasForeignKey("ManufacturerId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user