Feature/update net 5 (#487)

* Updated ApplicationCore to net 5

* Updated Infrastructure project to net 5

* Updated BlazorShared project to net 5

* Updated PublicApi project to net 5

* Updated Web mvc project to net 5

* Updated BlazorAdmin project to net-5

* Updated FunctionalTests to net 5

* Updated UnitTests project to net 5

* Updated IntegrationTests project to net 5

* Fixed CSS specific bug in BlazorAdmin project

* Updated github action worflow yaml

* Changes the name to only .NET

* Removed hardcoded minor version from github action workflow.

* Removed commneted code.

* Removed minor versions from the docker file

* Updated dotnet-ef tool version configuration to net-5

* Removed old migration plans

* Added net5 migration plans

* Updated infrastructure projecti setting.

* Removed database error page related configuration

* Removed commented package.
This commit is contained in:
Sumit Ghosh
2020-12-03 21:53:11 +05:30
committed by GitHub
parent 3463c89418
commit 28af1642f6
42 changed files with 830 additions and 2917 deletions

View File

@@ -1,225 +0,0 @@
// <auto-generated />
using Microsoft.eShopWeb.Infrastructure.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.EntityFrameworkCore.Storage.Internal;
using System;
namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
{
[DbContext(typeof(CatalogContext))]
[Migration("20171018175735_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.0.0-rtm-26452")
.HasAnnotation("Relational:Sequence:.catalog_brand_hilo", "'catalog_brand_hilo', '', '1', '10', '', '', 'Int64', 'False'")
.HasAnnotation("Relational:Sequence:.catalog_hilo", "'catalog_hilo', '', '1', '10', '', '', 'Int64', 'False'")
.HasAnnotation("Relational:Sequence:.catalog_type_hilo", "'catalog_type_hilo', '', '1', '10', '', '', 'Int64', 'False'")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("ApplicationCore.Entities.OrderAggregate.Order", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("BuyerId");
b.Property<DateTimeOffset>("OrderDate");
b.HasKey("Id");
b.ToTable("Orders");
});
modelBuilder.Entity("ApplicationCore.Entities.OrderAggregate.OrderItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int?>("OrderId");
b.Property<decimal>("UnitPrice");
b.Property<int>("Units");
b.HasKey("Id");
b.HasIndex("OrderId");
b.ToTable("OrderItems");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.Basket", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("BuyerId");
b.HasKey("Id");
b.ToTable("Baskets");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.BasketItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int?>("BasketId");
b.Property<int>("CatalogItemId");
b.Property<int>("Quantity");
b.Property<decimal>("UnitPrice");
b.HasKey("Id");
b.HasIndex("BasketId");
b.ToTable("BasketItem");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogBrand", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:HiLoSequenceName", "catalog_brand_hilo")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo);
b.Property<string>("Brand")
.IsRequired()
.HasMaxLength(100);
b.HasKey("Id");
b.ToTable("CatalogBrand");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:HiLoSequenceName", "catalog_hilo")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo);
b.Property<int>("CatalogBrandId");
b.Property<int>("CatalogTypeId");
b.Property<string>("Description");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50);
b.Property<string>("PictureUri");
b.Property<decimal>("Price");
b.HasKey("Id");
b.HasIndex("CatalogBrandId");
b.HasIndex("CatalogTypeId");
b.ToTable("Catalog");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogType", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:HiLoSequenceName", "catalog_type_hilo")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo);
b.Property<string>("Type")
.IsRequired()
.HasMaxLength(100);
b.HasKey("Id");
b.ToTable("CatalogType");
});
modelBuilder.Entity("ApplicationCore.Entities.OrderAggregate.Order", b =>
{
b.OwnsOne("ApplicationCore.Entities.OrderAggregate.Address", "ShipToAddress", b1 =>
{
b1.Property<int>("OrderId");
b1.Property<string>("City");
b1.Property<string>("Country");
b1.Property<string>("State");
b1.Property<string>("Street");
b1.Property<string>("ZipCode");
b1.ToTable("Orders");
b1.HasOne("ApplicationCore.Entities.OrderAggregate.Order")
.WithOne("ShipToAddress")
.HasForeignKey("ApplicationCore.Entities.OrderAggregate.Address", "OrderId")
.OnDelete(DeleteBehavior.Cascade);
});
});
modelBuilder.Entity("ApplicationCore.Entities.OrderAggregate.OrderItem", b =>
{
b.HasOne("ApplicationCore.Entities.OrderAggregate.Order")
.WithMany("OrderItems")
.HasForeignKey("OrderId");
b.OwnsOne("ApplicationCore.Entities.OrderAggregate.CatalogItemOrdered", "ItemOrdered", b1 =>
{
b1.Property<int>("OrderItemId");
b1.Property<int>("CatalogItemId");
b1.Property<string>("PictureUri");
b1.Property<string>("ProductName");
b1.ToTable("OrderItems");
b1.HasOne("ApplicationCore.Entities.OrderAggregate.OrderItem")
.WithOne("ItemOrdered")
.HasForeignKey("ApplicationCore.Entities.OrderAggregate.CatalogItemOrdered", "OrderItemId")
.OnDelete(DeleteBehavior.Cascade);
});
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.BasketItem", b =>
{
b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.Basket")
.WithMany("Items")
.HasForeignKey("BasketId");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogItem", b =>
{
b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogBrand", "CatalogBrand")
.WithMany()
.HasForeignKey("CatalogBrandId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogType", "CatalogType")
.WithMany()
.HasForeignKey("CatalogTypeId")
.OnDelete(DeleteBehavior.Cascade);
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -1,242 +0,0 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
{
[DbContext(typeof(CatalogContext))]
[Migration("20180725190153_AddExtraConstraints")]
partial class AddExtraConstraints
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.1.1-rtm-30846")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("Relational:Sequence:.catalog_brand_hilo", "'catalog_brand_hilo', '', '1', '10', '', '', 'Int64', 'False'")
.HasAnnotation("Relational:Sequence:.catalog_hilo", "'catalog_hilo', '', '1', '10', '', '', 'Int64', 'False'")
.HasAnnotation("Relational:Sequence:.catalog_type_hilo", "'catalog_type_hilo', '', '1', '10', '', '', 'Int64', 'False'")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.Basket", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("BuyerId");
b.HasKey("Id");
b.ToTable("Baskets");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.BasketItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int?>("BasketId");
b.Property<int>("CatalogItemId");
b.Property<int>("Quantity");
b.Property<decimal>("UnitPrice");
b.HasKey("Id");
b.HasIndex("BasketId");
b.ToTable("BasketItem");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogBrand", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:HiLoSequenceName", "catalog_brand_hilo")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo);
b.Property<string>("Brand")
.IsRequired()
.HasMaxLength(100);
b.HasKey("Id");
b.ToTable("CatalogBrand");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:HiLoSequenceName", "catalog_hilo")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo);
b.Property<int>("CatalogBrandId");
b.Property<int>("CatalogTypeId");
b.Property<string>("Description");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50);
b.Property<string>("PictureUri");
b.Property<decimal>("Price");
b.HasKey("Id");
b.HasIndex("CatalogBrandId");
b.HasIndex("CatalogTypeId");
b.ToTable("Catalog");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogType", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:HiLoSequenceName", "catalog_type_hilo")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo);
b.Property<string>("Type")
.IsRequired()
.HasMaxLength(100);
b.HasKey("Id");
b.ToTable("CatalogType");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Order", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("BuyerId");
b.Property<DateTimeOffset>("OrderDate");
b.HasKey("Id");
b.ToTable("Orders");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.OrderItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int?>("OrderId");
b.Property<decimal>("UnitPrice");
b.Property<int>("Units");
b.HasKey("Id");
b.HasIndex("OrderId");
b.ToTable("OrderItems");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.BasketItem", b =>
{
b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.Basket")
.WithMany("Items")
.HasForeignKey("BasketId");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogItem", b =>
{
b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogBrand", "CatalogBrand")
.WithMany()
.HasForeignKey("CatalogBrandId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogType", "CatalogType")
.WithMany()
.HasForeignKey("CatalogTypeId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Order", b =>
{
b.OwnsOne("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Address", "ShipToAddress", b1 =>
{
b1.Property<int?>("OrderId")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b1.Property<string>("City")
.IsRequired()
.HasMaxLength(100);
b1.Property<string>("Country")
.IsRequired()
.HasMaxLength(90);
b1.Property<string>("State")
.HasMaxLength(60);
b1.Property<string>("Street")
.IsRequired()
.HasMaxLength(180);
b1.Property<string>("ZipCode")
.IsRequired()
.HasMaxLength(18);
b1.ToTable("Orders");
b1.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Order")
.WithOne("ShipToAddress")
.HasForeignKey("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Address", "OrderId")
.OnDelete(DeleteBehavior.Cascade);
});
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.OrderItem", b =>
{
b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Order")
.WithMany("OrderItems")
.HasForeignKey("OrderId");
b.OwnsOne("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.CatalogItemOrdered", "ItemOrdered", b1 =>
{
b1.Property<int?>("OrderItemId")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b1.Property<int>("CatalogItemId");
b1.Property<string>("PictureUri");
b1.Property<string>("ProductName")
.IsRequired()
.HasMaxLength(50);
b1.ToTable("OrderItems");
b1.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.OrderItem")
.WithOne("ItemOrdered")
.HasForeignKey("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.CatalogItemOrdered", "OrderItemId")
.OnDelete(DeleteBehavior.Cascade);
});
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -1,104 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
{
public partial class AddExtraConstraints : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_ZipCode",
table: "Orders",
maxLength: 18,
nullable: false,
oldClrType: typeof(string),
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_Street",
table: "Orders",
maxLength: 180,
nullable: false,
oldClrType: typeof(string),
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_State",
table: "Orders",
maxLength: 60,
nullable: true,
oldClrType: typeof(string),
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_Country",
table: "Orders",
maxLength: 90,
nullable: false,
oldClrType: typeof(string),
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_City",
table: "Orders",
maxLength: 100,
nullable: false,
oldClrType: typeof(string),
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ItemOrdered_ProductName",
table: "OrderItems",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldNullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_ZipCode",
table: "Orders",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 18);
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_Street",
table: "Orders",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 180);
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_State",
table: "Orders",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 60,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_Country",
table: "Orders",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 90);
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_City",
table: "Orders",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 100);
migrationBuilder.AlterColumn<string>(
name: "ItemOrdered_ProductName",
table: "OrderItems",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 50);
}
}
}

View File

@@ -1,251 +0,0 @@
// <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 Microsoft.eShopWeb.Infrastructure.Data;
namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
{
[DbContext(typeof(CatalogContext))]
[Migration("20190601014740_UpdatingDefaultDataTypes")]
partial class UpdatingDefaultDataTypes
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.2.3-servicing-35854")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("Relational:Sequence:.catalog_brand_hilo", "'catalog_brand_hilo', '', '1', '10', '', '', 'Int64', 'False'")
.HasAnnotation("Relational:Sequence:.catalog_hilo", "'catalog_hilo', '', '1', '10', '', '', 'Int64', 'False'")
.HasAnnotation("Relational:Sequence:.catalog_type_hilo", "'catalog_type_hilo', '', '1', '10', '', '', 'Int64', 'False'")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.Basket", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("BuyerId");
b.HasKey("Id");
b.ToTable("Baskets");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.BasketItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int?>("BasketId");
b.Property<int>("CatalogItemId");
b.Property<int>("Quantity");
b.Property<decimal>("UnitPrice")
.HasColumnType("decimal(18,2)");
b.HasKey("Id");
b.HasIndex("BasketId");
b.ToTable("BasketItems");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogBrand", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:HiLoSequenceName", "catalog_brand_hilo")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo);
b.Property<string>("Brand")
.IsRequired()
.HasMaxLength(100);
b.HasKey("Id");
b.ToTable("CatalogBrand");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:HiLoSequenceName", "catalog_hilo")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo);
b.Property<int>("CatalogBrandId");
b.Property<int>("CatalogTypeId");
b.Property<string>("Description");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50);
b.Property<string>("PictureUri");
b.Property<decimal>("Price")
.HasColumnType("decimal(18,2)");
b.HasKey("Id");
b.HasIndex("CatalogBrandId");
b.HasIndex("CatalogTypeId");
b.ToTable("Catalog");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogType", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:HiLoSequenceName", "catalog_type_hilo")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo);
b.Property<string>("Type")
.IsRequired()
.HasMaxLength(100);
b.HasKey("Id");
b.ToTable("CatalogType");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Order", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("BuyerId");
b.Property<DateTimeOffset>("OrderDate");
b.HasKey("Id");
b.ToTable("Orders");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.OrderItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int?>("OrderId");
b.Property<decimal>("UnitPrice")
.HasColumnType("decimal(18,2)");
b.Property<int>("Units");
b.HasKey("Id");
b.HasIndex("OrderId");
b.ToTable("OrderItems");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.BasketItem", b =>
{
b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.Basket")
.WithMany("Items")
.HasForeignKey("BasketId");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogItem", b =>
{
b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogBrand", "CatalogBrand")
.WithMany()
.HasForeignKey("CatalogBrandId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogType", "CatalogType")
.WithMany()
.HasForeignKey("CatalogTypeId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Order", b =>
{
b.OwnsOne("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Address", "ShipToAddress", b1 =>
{
b1.Property<int>("OrderId")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b1.Property<string>("City")
.IsRequired()
.HasMaxLength(100);
b1.Property<string>("Country")
.IsRequired()
.HasMaxLength(90);
b1.Property<string>("State")
.HasMaxLength(60);
b1.Property<string>("Street")
.IsRequired()
.HasMaxLength(180);
b1.Property<string>("ZipCode")
.IsRequired()
.HasMaxLength(18);
b1.HasKey("OrderId");
b1.ToTable("Orders");
b1.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Order")
.WithOne("ShipToAddress")
.HasForeignKey("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Address", "OrderId")
.OnDelete(DeleteBehavior.Cascade);
});
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.OrderItem", b =>
{
b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Order")
.WithMany("OrderItems")
.HasForeignKey("OrderId");
b.OwnsOne("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.CatalogItemOrdered", "ItemOrdered", b1 =>
{
b1.Property<int>("OrderItemId")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b1.Property<int>("CatalogItemId");
b1.Property<string>("PictureUri");
b1.Property<string>("ProductName")
.IsRequired()
.HasMaxLength(50);
b1.HasKey("OrderItemId");
b1.ToTable("OrderItems");
b1.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.OrderItem")
.WithOne("ItemOrdered")
.HasForeignKey("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.CatalogItemOrdered", "OrderItemId")
.OnDelete(DeleteBehavior.Cascade);
});
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -1,73 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
{
public partial class UpdatingDefaultDataTypes : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_BasketItem_Baskets_BasketId",
table: "BasketItem");
migrationBuilder.DropPrimaryKey(
name: "PK_BasketItem",
table: "BasketItem");
migrationBuilder.RenameTable(
name: "BasketItem",
newName: "BasketItems");
migrationBuilder.RenameIndex(
name: "IX_BasketItem_BasketId",
table: "BasketItems",
newName: "IX_BasketItems_BasketId");
migrationBuilder.AddPrimaryKey(
name: "PK_BasketItems",
table: "BasketItems",
column: "Id");
migrationBuilder.AddForeignKey(
name: "FK_BasketItems_Baskets_BasketId",
table: "BasketItems",
column: "BasketId",
principalTable: "Baskets",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_BasketItems_Baskets_BasketId",
table: "BasketItems");
migrationBuilder.DropPrimaryKey(
name: "PK_BasketItems",
table: "BasketItems");
migrationBuilder.RenameTable(
name: "BasketItems",
newName: "BasketItem");
migrationBuilder.RenameIndex(
name: "IX_BasketItems_BasketId",
table: "BasketItem",
newName: "IX_BasketItem_BasketId");
migrationBuilder.AddPrimaryKey(
name: "PK_BasketItem",
table: "BasketItem",
column: "Id");
migrationBuilder.AddForeignKey(
name: "FK_BasketItem_Baskets_BasketId",
table: "BasketItem",
column: "BasketId",
principalTable: "Baskets",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
}
}

View File

@@ -1,254 +0,0 @@
// <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 Microsoft.eShopWeb.Infrastructure.Data;
namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
{
[DbContext(typeof(CatalogContext))]
[Migration("20190818191507_UpdatedConstraints")]
partial class UpdatedConstraints
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.2.6-servicing-10079")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("Relational:Sequence:.catalog_brand_hilo", "'catalog_brand_hilo', '', '1', '10', '', '', 'Int64', 'False'")
.HasAnnotation("Relational:Sequence:.catalog_hilo", "'catalog_hilo', '', '1', '10', '', '', 'Int64', 'False'")
.HasAnnotation("Relational:Sequence:.catalog_type_hilo", "'catalog_type_hilo', '', '1', '10', '', '', 'Int64', 'False'")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.Basket", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("BuyerId")
.IsRequired()
.HasMaxLength(20);
b.HasKey("Id");
b.ToTable("Baskets");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.BasketItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("BasketId");
b.Property<int>("CatalogItemId");
b.Property<int>("Quantity");
b.Property<decimal>("UnitPrice")
.HasColumnType("decimal(18,2)");
b.HasKey("Id");
b.HasIndex("BasketId");
b.ToTable("BasketItems");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogBrand", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:HiLoSequenceName", "catalog_brand_hilo")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo);
b.Property<string>("Brand")
.IsRequired()
.HasMaxLength(100);
b.HasKey("Id");
b.ToTable("CatalogBrands");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:HiLoSequenceName", "catalog_hilo")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo);
b.Property<int>("CatalogBrandId");
b.Property<int>("CatalogTypeId");
b.Property<string>("Description");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50);
b.Property<string>("PictureUri");
b.Property<decimal>("Price")
.HasColumnType("decimal(18,2)");
b.HasKey("Id");
b.HasIndex("CatalogBrandId");
b.HasIndex("CatalogTypeId");
b.ToTable("Catalog");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogType", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:HiLoSequenceName", "catalog_type_hilo")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo);
b.Property<string>("Type")
.IsRequired()
.HasMaxLength(100);
b.HasKey("Id");
b.ToTable("CatalogTypes");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Order", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("BuyerId");
b.Property<DateTimeOffset>("OrderDate");
b.HasKey("Id");
b.ToTable("Orders");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.OrderItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int?>("OrderId");
b.Property<decimal>("UnitPrice")
.HasColumnType("decimal(18,2)");
b.Property<int>("Units");
b.HasKey("Id");
b.HasIndex("OrderId");
b.ToTable("OrderItems");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.BasketItem", b =>
{
b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.Basket")
.WithMany("Items")
.HasForeignKey("BasketId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogItem", b =>
{
b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogBrand", "CatalogBrand")
.WithMany()
.HasForeignKey("CatalogBrandId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogType", "CatalogType")
.WithMany()
.HasForeignKey("CatalogTypeId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Order", b =>
{
b.OwnsOne("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Address", "ShipToAddress", b1 =>
{
b1.Property<int>("OrderId")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b1.Property<string>("City")
.IsRequired()
.HasMaxLength(100);
b1.Property<string>("Country")
.IsRequired()
.HasMaxLength(90);
b1.Property<string>("State")
.HasMaxLength(60);
b1.Property<string>("Street")
.IsRequired()
.HasMaxLength(180);
b1.Property<string>("ZipCode")
.IsRequired()
.HasMaxLength(18);
b1.HasKey("OrderId");
b1.ToTable("Orders");
b1.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Order")
.WithOne("ShipToAddress")
.HasForeignKey("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Address", "OrderId")
.OnDelete(DeleteBehavior.Cascade);
});
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.OrderItem", b =>
{
b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Order")
.WithMany("OrderItems")
.HasForeignKey("OrderId");
b.OwnsOne("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.CatalogItemOrdered", "ItemOrdered", b1 =>
{
b1.Property<int>("OrderItemId")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b1.Property<int>("CatalogItemId");
b1.Property<string>("PictureUri");
b1.Property<string>("ProductName")
.IsRequired()
.HasMaxLength(50);
b1.HasKey("OrderItemId");
b1.ToTable("OrderItems");
b1.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.OrderItem")
.WithOne("ItemOrdered")
.HasForeignKey("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.CatalogItemOrdered", "OrderItemId")
.OnDelete(DeleteBehavior.Cascade);
});
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -1,113 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
{
public partial class UpdatedConstraints : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Catalog_CatalogBrand_CatalogBrandId",
table: "Catalog");
migrationBuilder.DropForeignKey(
name: "FK_Catalog_CatalogType_CatalogTypeId",
table: "Catalog");
migrationBuilder.DropPrimaryKey(
name: "PK_CatalogType",
table: "CatalogType");
migrationBuilder.DropPrimaryKey(
name: "PK_CatalogBrand",
table: "CatalogBrand");
migrationBuilder.RenameTable(
name: "CatalogType",
newName: "CatalogTypes");
migrationBuilder.RenameTable(
name: "CatalogBrand",
newName: "CatalogBrands");
migrationBuilder.AddPrimaryKey(
name: "PK_CatalogTypes",
table: "CatalogTypes",
column: "Id");
migrationBuilder.AddPrimaryKey(
name: "PK_CatalogBrands",
table: "CatalogBrands",
column: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Catalog_CatalogBrands_CatalogBrandId",
table: "Catalog",
column: "CatalogBrandId",
principalTable: "CatalogBrands",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Catalog_CatalogTypes_CatalogTypeId",
table: "Catalog",
column: "CatalogTypeId",
principalTable: "CatalogTypes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Catalog_CatalogBrands_CatalogBrandId",
table: "Catalog");
migrationBuilder.DropForeignKey(
name: "FK_Catalog_CatalogTypes_CatalogTypeId",
table: "Catalog");
migrationBuilder.DropPrimaryKey(
name: "PK_CatalogTypes",
table: "CatalogTypes");
migrationBuilder.DropPrimaryKey(
name: "PK_CatalogBrands",
table: "CatalogBrands");
migrationBuilder.RenameTable(
name: "CatalogTypes",
newName: "CatalogType");
migrationBuilder.RenameTable(
name: "CatalogBrands",
newName: "CatalogBrand");
migrationBuilder.AddPrimaryKey(
name: "PK_CatalogType",
table: "CatalogType",
column: "Id");
migrationBuilder.AddPrimaryKey(
name: "PK_CatalogBrand",
table: "CatalogBrand",
column: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Catalog_CatalogBrand_CatalogBrandId",
table: "Catalog",
column: "CatalogBrandId",
principalTable: "CatalogBrand",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Catalog_CatalogType_CatalogTypeId",
table: "Catalog",
column: "CatalogTypeId",
principalTable: "CatalogType",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

View File

@@ -1,252 +0,0 @@
// <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 Microsoft.eShopWeb.Infrastructure.Data;
namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
{
[DbContext(typeof(CatalogContext))]
[Migration("20190911011026_UpdateCatalogModels")]
partial class UpdateCatalogModels
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.2.6-servicing-10079")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("Relational:Sequence:.catalog_brand_hilo", "'catalog_brand_hilo', '', '1', '10', '', '', 'Int64', 'False'")
.HasAnnotation("Relational:Sequence:.catalog_hilo", "'catalog_hilo', '', '1', '10', '', '', 'Int64', 'False'")
.HasAnnotation("Relational:Sequence:.catalog_type_hilo", "'catalog_type_hilo', '', '1', '10', '', '', 'Int64', 'False'")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.Basket", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("BuyerId");
b.HasKey("Id");
b.ToTable("Baskets");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.BasketItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("BasketId");
b.Property<int>("CatalogItemId");
b.Property<int>("Quantity");
b.Property<decimal>("UnitPrice")
.HasColumnType("decimal(18,2)");
b.HasKey("Id");
b.HasIndex("BasketId");
b.ToTable("BasketItems");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogBrand", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:HiLoSequenceName", "catalog_brand_hilo")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo);
b.Property<string>("Brand")
.IsRequired()
.HasMaxLength(100);
b.HasKey("Id");
b.ToTable("CatalogBrand");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:HiLoSequenceName", "catalog_hilo")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo);
b.Property<int>("CatalogBrandId");
b.Property<int>("CatalogTypeId");
b.Property<string>("Description");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50);
b.Property<string>("PictureUri");
b.Property<decimal>("Price")
.HasColumnType("decimal(18,2)");
b.HasKey("Id");
b.HasIndex("CatalogBrandId");
b.HasIndex("CatalogTypeId");
b.ToTable("Catalog");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogType", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:HiLoSequenceName", "catalog_type_hilo")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo);
b.Property<string>("Type")
.IsRequired()
.HasMaxLength(100);
b.HasKey("Id");
b.ToTable("CatalogType");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Order", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("BuyerId");
b.Property<DateTimeOffset>("OrderDate");
b.HasKey("Id");
b.ToTable("Orders");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.OrderItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int?>("OrderId");
b.Property<decimal>("UnitPrice")
.HasColumnType("decimal(18,2)");
b.Property<int>("Units");
b.HasKey("Id");
b.HasIndex("OrderId");
b.ToTable("OrderItems");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.BasketItem", b =>
{
b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.Basket")
.WithMany("Items")
.HasForeignKey("BasketId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogItem", b =>
{
b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogBrand", "CatalogBrand")
.WithMany()
.HasForeignKey("CatalogBrandId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogType", "CatalogType")
.WithMany()
.HasForeignKey("CatalogTypeId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Order", b =>
{
b.OwnsOne("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Address", "ShipToAddress", b1 =>
{
b1.Property<int>("OrderId")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b1.Property<string>("City")
.IsRequired()
.HasMaxLength(100);
b1.Property<string>("Country")
.IsRequired()
.HasMaxLength(90);
b1.Property<string>("State")
.HasMaxLength(60);
b1.Property<string>("Street")
.IsRequired()
.HasMaxLength(180);
b1.Property<string>("ZipCode")
.IsRequired()
.HasMaxLength(18);
b1.HasKey("OrderId");
b1.ToTable("Orders");
b1.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Order")
.WithOne("ShipToAddress")
.HasForeignKey("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Address", "OrderId")
.OnDelete(DeleteBehavior.Cascade);
});
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.OrderItem", b =>
{
b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Order")
.WithMany("OrderItems")
.HasForeignKey("OrderId");
b.OwnsOne("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.CatalogItemOrdered", "ItemOrdered", b1 =>
{
b1.Property<int>("OrderItemId")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b1.Property<int>("CatalogItemId");
b1.Property<string>("PictureUri");
b1.Property<string>("ProductName")
.IsRequired()
.HasMaxLength(50);
b1.HasKey("OrderItemId");
b1.ToTable("OrderItems");
b1.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.OrderItem")
.WithOne("ItemOrdered")
.HasForeignKey("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.CatalogItemOrdered", "OrderItemId")
.OnDelete(DeleteBehavior.Cascade);
});
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -1,128 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
{
public partial class UpdateCatalogModels : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Catalog_CatalogBrands_CatalogBrandId",
table: "Catalog");
migrationBuilder.DropForeignKey(
name: "FK_Catalog_CatalogTypes_CatalogTypeId",
table: "Catalog");
migrationBuilder.DropPrimaryKey(
name: "PK_CatalogTypes",
table: "CatalogTypes");
migrationBuilder.DropPrimaryKey(
name: "PK_CatalogBrands",
table: "CatalogBrands");
migrationBuilder.RenameTable(
name: "CatalogTypes",
newName: "CatalogType");
migrationBuilder.RenameTable(
name: "CatalogBrands",
newName: "CatalogBrand");
migrationBuilder.AlterColumn<string>(
name: "BuyerId",
table: "Baskets",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 20);
migrationBuilder.AddPrimaryKey(
name: "PK_CatalogType",
table: "CatalogType",
column: "Id");
migrationBuilder.AddPrimaryKey(
name: "PK_CatalogBrand",
table: "CatalogBrand",
column: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Catalog_CatalogBrand_CatalogBrandId",
table: "Catalog",
column: "CatalogBrandId",
principalTable: "CatalogBrand",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Catalog_CatalogType_CatalogTypeId",
table: "Catalog",
column: "CatalogTypeId",
principalTable: "CatalogType",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Catalog_CatalogBrand_CatalogBrandId",
table: "Catalog");
migrationBuilder.DropForeignKey(
name: "FK_Catalog_CatalogType_CatalogTypeId",
table: "Catalog");
migrationBuilder.DropPrimaryKey(
name: "PK_CatalogType",
table: "CatalogType");
migrationBuilder.DropPrimaryKey(
name: "PK_CatalogBrand",
table: "CatalogBrand");
migrationBuilder.RenameTable(
name: "CatalogType",
newName: "CatalogTypes");
migrationBuilder.RenameTable(
name: "CatalogBrand",
newName: "CatalogBrands");
migrationBuilder.AlterColumn<string>(
name: "BuyerId",
table: "Baskets",
maxLength: 20,
nullable: false,
oldClrType: typeof(string),
oldNullable: true);
migrationBuilder.AddPrimaryKey(
name: "PK_CatalogTypes",
table: "CatalogTypes",
column: "Id");
migrationBuilder.AddPrimaryKey(
name: "PK_CatalogBrands",
table: "CatalogBrands",
column: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Catalog_CatalogBrands_CatalogBrandId",
table: "Catalog",
column: "CatalogBrandId",
principalTable: "CatalogBrands",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Catalog_CatalogTypes_CatalogTypeId",
table: "Catalog",
column: "CatalogTypeId",
principalTable: "CatalogTypes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

View File

@@ -1,224 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
{
public partial class Post30Upgrade : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Catalog_CatalogBrand_CatalogBrandId",
table: "Catalog");
migrationBuilder.DropForeignKey(
name: "FK_Catalog_CatalogType_CatalogTypeId",
table: "Catalog");
migrationBuilder.DropPrimaryKey(
name: "PK_CatalogType",
table: "CatalogType");
migrationBuilder.DropPrimaryKey(
name: "PK_CatalogBrand",
table: "CatalogBrand");
migrationBuilder.RenameTable(
name: "CatalogType",
newName: "CatalogTypes");
migrationBuilder.RenameTable(
name: "CatalogBrand",
newName: "CatalogBrands");
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_ZipCode",
table: "Orders",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 18,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_Street",
table: "Orders",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 180,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_State",
table: "Orders",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 60,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_Country",
table: "Orders",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 90,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_City",
table: "Orders",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 100,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ItemOrdered_ProductName",
table: "OrderItems",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "BuyerId",
table: "Baskets",
maxLength: 40,
nullable: false,
oldClrType: typeof(string),
oldNullable: true);
migrationBuilder.AddPrimaryKey(
name: "PK_CatalogTypes",
table: "CatalogTypes",
column: "Id");
migrationBuilder.AddPrimaryKey(
name: "PK_CatalogBrands",
table: "CatalogBrands",
column: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Catalog_CatalogBrands_CatalogBrandId",
table: "Catalog",
column: "CatalogBrandId",
principalTable: "CatalogBrands",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Catalog_CatalogTypes_CatalogTypeId",
table: "Catalog",
column: "CatalogTypeId",
principalTable: "CatalogTypes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Catalog_CatalogBrands_CatalogBrandId",
table: "Catalog");
migrationBuilder.DropForeignKey(
name: "FK_Catalog_CatalogTypes_CatalogTypeId",
table: "Catalog");
migrationBuilder.DropPrimaryKey(
name: "PK_CatalogTypes",
table: "CatalogTypes");
migrationBuilder.DropPrimaryKey(
name: "PK_CatalogBrands",
table: "CatalogBrands");
migrationBuilder.RenameTable(
name: "CatalogTypes",
newName: "CatalogType");
migrationBuilder.RenameTable(
name: "CatalogBrands",
newName: "CatalogBrand");
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_ZipCode",
table: "Orders",
maxLength: 18,
nullable: true,
oldClrType: typeof(string),
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_Street",
table: "Orders",
maxLength: 180,
nullable: true,
oldClrType: typeof(string),
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_State",
table: "Orders",
maxLength: 60,
nullable: true,
oldClrType: typeof(string),
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_Country",
table: "Orders",
maxLength: 90,
nullable: true,
oldClrType: typeof(string),
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_City",
table: "Orders",
maxLength: 100,
nullable: true,
oldClrType: typeof(string),
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ItemOrdered_ProductName",
table: "OrderItems",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "BuyerId",
table: "Baskets",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40);
migrationBuilder.AddPrimaryKey(
name: "PK_CatalogType",
table: "CatalogType",
column: "Id");
migrationBuilder.AddPrimaryKey(
name: "PK_CatalogBrand",
table: "CatalogBrand",
column: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Catalog_CatalogBrand_CatalogBrandId",
table: "Catalog",
column: "CatalogBrandId",
principalTable: "CatalogBrand",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Catalog_CatalogType_CatalogTypeId",
table: "Catalog",
column: "CatalogTypeId",
principalTable: "CatalogType",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

View File

@@ -1,285 +0,0 @@
// <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 Microsoft.eShopWeb.Infrastructure.Data;
namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
{
[DbContext(typeof(CatalogContext))]
[Migration("20191105161820_AddressAndCatalogItemOrderedChanges")]
partial class AddressAndCatalogItemOrderedChanges
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "3.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("Relational:Sequence:.catalog_brand_hilo", "'catalog_brand_hilo', '', '1', '10', '', '', 'Int64', 'False'")
.HasAnnotation("Relational:Sequence:.catalog_hilo", "'catalog_hilo', '', '1', '10', '', '', 'Int64', 'False'")
.HasAnnotation("Relational:Sequence:.catalog_type_hilo", "'catalog_type_hilo', '', '1', '10', '', '', 'Int64', 'False'")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.Basket", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("BuyerId")
.IsRequired()
.HasColumnType("nvarchar(40)")
.HasMaxLength(40);
b.HasKey("Id");
b.ToTable("Baskets");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.BasketItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("BasketId")
.HasColumnType("int");
b.Property<int>("CatalogItemId")
.HasColumnType("int");
b.Property<int>("Quantity")
.HasColumnType("int");
b.Property<decimal>("UnitPrice")
.HasColumnType("decimal(18,2)");
b.HasKey("Id");
b.HasIndex("BasketId");
b.ToTable("BasketItems");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogBrand", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:HiLoSequenceName", "catalog_brand_hilo")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo);
b.Property<string>("Brand")
.IsRequired()
.HasColumnType("nvarchar(100)")
.HasMaxLength(100);
b.HasKey("Id");
b.ToTable("CatalogBrands");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:HiLoSequenceName", "catalog_hilo")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo);
b.Property<int>("CatalogBrandId")
.HasColumnType("int");
b.Property<int>("CatalogTypeId")
.HasColumnType("int");
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(50)")
.HasMaxLength(50);
b.Property<string>("PictureUri")
.HasColumnType("nvarchar(max)");
b.Property<decimal>("Price")
.HasColumnType("decimal(18,2)");
b.HasKey("Id");
b.HasIndex("CatalogBrandId");
b.HasIndex("CatalogTypeId");
b.ToTable("Catalog");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogType", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:HiLoSequenceName", "catalog_type_hilo")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo);
b.Property<string>("Type")
.IsRequired()
.HasColumnType("nvarchar(100)")
.HasMaxLength(100);
b.HasKey("Id");
b.ToTable("CatalogTypes");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Order", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("BuyerId")
.HasColumnType("nvarchar(max)");
b.Property<DateTimeOffset>("OrderDate")
.HasColumnType("datetimeoffset");
b.HasKey("Id");
b.ToTable("Orders");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.OrderItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int?>("OrderId")
.HasColumnType("int");
b.Property<decimal>("UnitPrice")
.HasColumnType("decimal(18,2)");
b.Property<int>("Units")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("OrderId");
b.ToTable("OrderItems");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.BasketItem", b =>
{
b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.Basket", null)
.WithMany("Items")
.HasForeignKey("BasketId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogItem", b =>
{
b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogBrand", "CatalogBrand")
.WithMany()
.HasForeignKey("CatalogBrandId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogType", "CatalogType")
.WithMany()
.HasForeignKey("CatalogTypeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Order", b =>
{
b.OwnsOne("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Address", "ShipToAddress", b1 =>
{
b1.Property<int>("OrderId")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b1.Property<string>("City")
.IsRequired()
.HasColumnType("nvarchar(100)")
.HasMaxLength(100);
b1.Property<string>("Country")
.IsRequired()
.HasColumnType("nvarchar(90)")
.HasMaxLength(90);
b1.Property<string>("State")
.HasColumnType("nvarchar(60)")
.HasMaxLength(60);
b1.Property<string>("Street")
.IsRequired()
.HasColumnType("nvarchar(180)")
.HasMaxLength(180);
b1.Property<string>("ZipCode")
.IsRequired()
.HasColumnType("nvarchar(18)")
.HasMaxLength(18);
b1.HasKey("OrderId");
b1.ToTable("Orders");
b1.WithOwner()
.HasForeignKey("OrderId");
});
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.OrderItem", b =>
{
b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Order", null)
.WithMany("OrderItems")
.HasForeignKey("OrderId");
b.OwnsOne("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.CatalogItemOrdered", "ItemOrdered", b1 =>
{
b1.Property<int>("OrderItemId")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b1.Property<int>("CatalogItemId")
.HasColumnType("int");
b1.Property<string>("PictureUri")
.HasColumnType("nvarchar(max)");
b1.Property<string>("ProductName")
.IsRequired()
.HasColumnType("nvarchar(50)")
.HasMaxLength(50);
b1.HasKey("OrderItemId");
b1.ToTable("OrderItems");
b1.WithOwner()
.HasForeignKey("OrderItemId");
});
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -1,121 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
{
public partial class AddressAndCatalogItemOrderedChanges : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_ZipCode",
table: "Orders",
maxLength: 18,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_Street",
table: "Orders",
maxLength: 180,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_State",
table: "Orders",
maxLength: 60,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_Country",
table: "Orders",
maxLength: 90,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_City",
table: "Orders",
maxLength: 100,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ItemOrdered_ProductName",
table: "OrderItems",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_ZipCode",
table: "Orders",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 18,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_Street",
table: "Orders",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 180,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_State",
table: "Orders",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 60,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_Country",
table: "Orders",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 90,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ShipToAddress_City",
table: "Orders",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 100,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ItemOrdered_ProductName",
table: "OrderItems",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 50,
oldNullable: true);
}
}
}

View File

@@ -10,31 +10,37 @@ using Microsoft.eShopWeb.Infrastructure.Data;
namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
{
[DbContext(typeof(CatalogContext))]
[Migration("20191031185508_Post30Upgrade")]
partial class Post30Upgrade
[Migration("20201202111507_InitialModel")]
partial class InitialModel
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "3.0.0")
.UseIdentityColumns()
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("Relational:Sequence:.catalog_brand_hilo", "'catalog_brand_hilo', '', '1', '10', '', '', 'Int64', 'False'")
.HasAnnotation("Relational:Sequence:.catalog_hilo", "'catalog_hilo', '', '1', '10', '', '', 'Int64', 'False'")
.HasAnnotation("Relational:Sequence:.catalog_type_hilo", "'catalog_type_hilo', '', '1', '10', '', '', 'Int64', 'False'")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
.HasAnnotation("ProductVersion", "5.0.0");
modelBuilder.HasSequence("catalog_brand_hilo")
.IncrementsBy(10);
modelBuilder.HasSequence("catalog_hilo")
.IncrementsBy(10);
modelBuilder.HasSequence("catalog_type_hilo")
.IncrementsBy(10);
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.Basket", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
.UseIdentityColumn();
b.Property<string>("BuyerId")
.IsRequired()
.HasColumnType("nvarchar(40)")
.HasMaxLength(40);
.HasMaxLength(40)
.HasColumnType("nvarchar(40)");
b.HasKey("Id");
@@ -46,7 +52,7 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
.UseIdentityColumn();
b.Property<int>("BasketId")
.HasColumnType("int");
@@ -72,13 +78,12 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:HiLoSequenceName", "catalog_brand_hilo")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo);
.UseHiLo("catalog_brand_hilo");
b.Property<string>("Brand")
.IsRequired()
.HasColumnType("nvarchar(100)")
.HasMaxLength(100);
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.HasKey("Id");
@@ -90,8 +95,7 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:HiLoSequenceName", "catalog_hilo")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo);
.UseHiLo("catalog_hilo");
b.Property<int>("CatalogBrandId")
.HasColumnType("int");
@@ -104,8 +108,8 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(50)")
.HasMaxLength(50);
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("PictureUri")
.HasColumnType("nvarchar(max)");
@@ -127,13 +131,12 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:HiLoSequenceName", "catalog_type_hilo")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo);
.UseHiLo("catalog_type_hilo");
b.Property<string>("Type")
.IsRequired()
.HasColumnType("nvarchar(100)")
.HasMaxLength(100);
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.HasKey("Id");
@@ -145,7 +148,7 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
.UseIdentityColumn();
b.Property<string>("BuyerId")
.HasColumnType("nvarchar(max)");
@@ -163,7 +166,7 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
.UseIdentityColumn();
b.Property<int?>("OrderId")
.HasColumnType("int");
@@ -203,6 +206,10 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
.HasForeignKey("CatalogTypeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CatalogBrand");
b.Navigation("CatalogType");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Order", b =>
@@ -212,22 +219,31 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
b1.Property<int>("OrderId")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
.UseIdentityColumn();
b1.Property<string>("City")
.HasColumnType("nvarchar(max)");
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b1.Property<string>("Country")
.HasColumnType("nvarchar(max)");
.IsRequired()
.HasMaxLength(90)
.HasColumnType("nvarchar(90)");
b1.Property<string>("State")
.HasColumnType("nvarchar(max)");
.HasMaxLength(60)
.HasColumnType("nvarchar(60)");
b1.Property<string>("Street")
.HasColumnType("nvarchar(max)");
.IsRequired()
.HasMaxLength(180)
.HasColumnType("nvarchar(180)");
b1.Property<string>("ZipCode")
.HasColumnType("nvarchar(max)");
.IsRequired()
.HasMaxLength(18)
.HasColumnType("nvarchar(18)");
b1.HasKey("OrderId");
@@ -236,6 +252,8 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
b1.WithOwner()
.HasForeignKey("OrderId");
});
b.Navigation("ShipToAddress");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.OrderItem", b =>
@@ -249,7 +267,7 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
b1.Property<int>("OrderItemId")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
.UseIdentityColumn();
b1.Property<int>("CatalogItemId")
.HasColumnType("int");
@@ -258,7 +276,9 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
.HasColumnType("nvarchar(max)");
b1.Property<string>("ProductName")
.HasColumnType("nvarchar(max)");
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b1.HasKey("OrderItemId");
@@ -267,6 +287,18 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
b1.WithOwner()
.HasForeignKey("OrderItemId");
});
b.Navigation("ItemOrdered");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.Basket", b =>
{
b.Navigation("Items");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Order", b =>
{
b.Navigation("OrderItems");
});
#pragma warning restore 612, 618
}

View File

@@ -1,10 +1,9 @@
using Microsoft.EntityFrameworkCore.Metadata;
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using System;
namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
{
public partial class Initial : Migration
public partial class InitialModel : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
@@ -25,8 +24,8 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
BuyerId = table.Column<string>(type: "nvarchar(max)", nullable: true)
.Annotation("SqlServer:Identity", "1, 1"),
BuyerId = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false)
},
constraints: table =>
{
@@ -34,7 +33,7 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
});
migrationBuilder.CreateTable(
name: "CatalogBrand",
name: "CatalogBrands",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false),
@@ -42,11 +41,11 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
},
constraints: table =>
{
table.PrimaryKey("PK_CatalogBrand", x => x.Id);
table.PrimaryKey("PK_CatalogBrands", x => x.Id);
});
migrationBuilder.CreateTable(
name: "CatalogType",
name: "CatalogTypes",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false),
@@ -54,7 +53,7 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
},
constraints: table =>
{
table.PrimaryKey("PK_CatalogType", x => x.Id);
table.PrimaryKey("PK_CatalogTypes", x => x.Id);
});
migrationBuilder.CreateTable(
@@ -62,14 +61,14 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
.Annotation("SqlServer:Identity", "1, 1"),
BuyerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
OrderDate = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
ShipToAddress_City = table.Column<string>(type: "nvarchar(max)", nullable: true),
ShipToAddress_Country = table.Column<string>(type: "nvarchar(max)", nullable: true),
ShipToAddress_State = table.Column<string>(type: "nvarchar(max)", nullable: true),
ShipToAddress_Street = table.Column<string>(type: "nvarchar(max)", nullable: true),
ShipToAddress_ZipCode = table.Column<string>(type: "nvarchar(max)", nullable: true)
ShipToAddress_Street = table.Column<string>(type: "nvarchar(180)", maxLength: 180, nullable: true),
ShipToAddress_City = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
ShipToAddress_State = table.Column<string>(type: "nvarchar(60)", maxLength: 60, nullable: true),
ShipToAddress_Country = table.Column<string>(type: "nvarchar(90)", maxLength: 90, nullable: true),
ShipToAddress_ZipCode = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true)
},
constraints: table =>
{
@@ -77,25 +76,25 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
});
migrationBuilder.CreateTable(
name: "BasketItem",
name: "BasketItems",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
BasketId = table.Column<int>(type: "int", nullable: true),
CatalogItemId = table.Column<int>(type: "int", nullable: false),
.Annotation("SqlServer:Identity", "1, 1"),
UnitPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
Quantity = table.Column<int>(type: "int", nullable: false),
UnitPrice = table.Column<decimal>(type: "decimal(18, 2)", nullable: false)
CatalogItemId = table.Column<int>(type: "int", nullable: false),
BasketId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_BasketItem", x => x.Id);
table.PrimaryKey("PK_BasketItems", x => x.Id);
table.ForeignKey(
name: "FK_BasketItem_Baskets_BasketId",
name: "FK_BasketItems_Baskets_BasketId",
column: x => x.BasketId,
principalTable: "Baskets",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
@@ -103,26 +102,26 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false),
CatalogBrandId = table.Column<int>(type: "int", nullable: false),
CatalogTypeId = table.Column<int>(type: "int", nullable: false),
Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
Price = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
PictureUri = table.Column<string>(type: "nvarchar(max)", nullable: true),
Price = table.Column<decimal>(type: "decimal(18, 2)", nullable: false)
CatalogTypeId = table.Column<int>(type: "int", nullable: false),
CatalogBrandId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Catalog", x => x.Id);
table.ForeignKey(
name: "FK_Catalog_CatalogBrand_CatalogBrandId",
name: "FK_Catalog_CatalogBrands_CatalogBrandId",
column: x => x.CatalogBrandId,
principalTable: "CatalogBrand",
principalTable: "CatalogBrands",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Catalog_CatalogType_CatalogTypeId",
name: "FK_Catalog_CatalogTypes_CatalogTypeId",
column: x => x.CatalogTypeId,
principalTable: "CatalogType",
principalTable: "CatalogTypes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
@@ -132,13 +131,13 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
OrderId = table.Column<int>(type: "int", nullable: true),
UnitPrice = table.Column<decimal>(type: "decimal(18, 2)", nullable: false),
Units = table.Column<int>(type: "int", nullable: false),
ItemOrdered_CatalogItemId = table.Column<int>(type: "int", nullable: false),
.Annotation("SqlServer:Identity", "1, 1"),
ItemOrdered_CatalogItemId = table.Column<int>(type: "int", nullable: true),
ItemOrdered_ProductName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
ItemOrdered_PictureUri = table.Column<string>(type: "nvarchar(max)", nullable: true),
ItemOrdered_ProductName = table.Column<string>(type: "nvarchar(max)", nullable: true)
UnitPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
Units = table.Column<int>(type: "int", nullable: false),
OrderId = table.Column<int>(type: "int", nullable: true)
},
constraints: table =>
{
@@ -152,8 +151,8 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
});
migrationBuilder.CreateIndex(
name: "IX_BasketItem_BasketId",
table: "BasketItem",
name: "IX_BasketItems_BasketId",
table: "BasketItems",
column: "BasketId");
migrationBuilder.CreateIndex(
@@ -175,7 +174,7 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "BasketItem");
name: "BasketItems");
migrationBuilder.DropTable(
name: "Catalog");
@@ -187,10 +186,10 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
name: "Baskets");
migrationBuilder.DropTable(
name: "CatalogBrand");
name: "CatalogBrands");
migrationBuilder.DropTable(
name: "CatalogType");
name: "CatalogTypes");
migrationBuilder.DropTable(
name: "Orders");

View File

@@ -15,24 +15,30 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "3.0.0")
.UseIdentityColumns()
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("Relational:Sequence:.catalog_brand_hilo", "'catalog_brand_hilo', '', '1', '10', '', '', 'Int64', 'False'")
.HasAnnotation("Relational:Sequence:.catalog_hilo", "'catalog_hilo', '', '1', '10', '', '', 'Int64', 'False'")
.HasAnnotation("Relational:Sequence:.catalog_type_hilo", "'catalog_type_hilo', '', '1', '10', '', '', 'Int64', 'False'")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
.HasAnnotation("ProductVersion", "5.0.0");
modelBuilder.HasSequence("catalog_brand_hilo")
.IncrementsBy(10);
modelBuilder.HasSequence("catalog_hilo")
.IncrementsBy(10);
modelBuilder.HasSequence("catalog_type_hilo")
.IncrementsBy(10);
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.Basket", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
.UseIdentityColumn();
b.Property<string>("BuyerId")
.IsRequired()
.HasColumnType("nvarchar(40)")
.HasMaxLength(40);
.HasMaxLength(40)
.HasColumnType("nvarchar(40)");
b.HasKey("Id");
@@ -44,7 +50,7 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
.UseIdentityColumn();
b.Property<int>("BasketId")
.HasColumnType("int");
@@ -70,13 +76,12 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:HiLoSequenceName", "catalog_brand_hilo")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo);
.UseHiLo("catalog_brand_hilo");
b.Property<string>("Brand")
.IsRequired()
.HasColumnType("nvarchar(100)")
.HasMaxLength(100);
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.HasKey("Id");
@@ -88,8 +93,7 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:HiLoSequenceName", "catalog_hilo")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo);
.UseHiLo("catalog_hilo");
b.Property<int>("CatalogBrandId")
.HasColumnType("int");
@@ -102,8 +106,8 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(50)")
.HasMaxLength(50);
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("PictureUri")
.HasColumnType("nvarchar(max)");
@@ -125,13 +129,12 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:HiLoSequenceName", "catalog_type_hilo")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo);
.UseHiLo("catalog_type_hilo");
b.Property<string>("Type")
.IsRequired()
.HasColumnType("nvarchar(100)")
.HasMaxLength(100);
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.HasKey("Id");
@@ -143,7 +146,7 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
.UseIdentityColumn();
b.Property<string>("BuyerId")
.HasColumnType("nvarchar(max)");
@@ -161,7 +164,7 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
.UseIdentityColumn();
b.Property<int?>("OrderId")
.HasColumnType("int");
@@ -201,6 +204,10 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
.HasForeignKey("CatalogTypeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CatalogBrand");
b.Navigation("CatalogType");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Order", b =>
@@ -210,31 +217,31 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
b1.Property<int>("OrderId")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
.UseIdentityColumn();
b1.Property<string>("City")
.IsRequired()
.HasColumnType("nvarchar(100)")
.HasMaxLength(100);
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b1.Property<string>("Country")
.IsRequired()
.HasColumnType("nvarchar(90)")
.HasMaxLength(90);
.HasMaxLength(90)
.HasColumnType("nvarchar(90)");
b1.Property<string>("State")
.HasColumnType("nvarchar(60)")
.HasMaxLength(60);
.HasMaxLength(60)
.HasColumnType("nvarchar(60)");
b1.Property<string>("Street")
.IsRequired()
.HasColumnType("nvarchar(180)")
.HasMaxLength(180);
.HasMaxLength(180)
.HasColumnType("nvarchar(180)");
b1.Property<string>("ZipCode")
.IsRequired()
.HasColumnType("nvarchar(18)")
.HasMaxLength(18);
.HasMaxLength(18)
.HasColumnType("nvarchar(18)");
b1.HasKey("OrderId");
@@ -243,6 +250,8 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
b1.WithOwner()
.HasForeignKey("OrderId");
});
b.Navigation("ShipToAddress");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.OrderItem", b =>
@@ -256,7 +265,7 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
b1.Property<int>("OrderItemId")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
.UseIdentityColumn();
b1.Property<int>("CatalogItemId")
.HasColumnType("int");
@@ -266,8 +275,8 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
b1.Property<string>("ProductName")
.IsRequired()
.HasColumnType("nvarchar(50)")
.HasMaxLength(50);
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b1.HasKey("OrderItemId");
@@ -276,6 +285,18 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
b1.WithOwner()
.HasForeignKey("OrderItemId");
});
b.Navigation("ItemOrdered");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.Basket", b =>
{
b.Navigation("Items");
});
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Order", b =>
{
b.Navigation("OrderItems");
});
#pragma warning restore 612, 618
}