Browse Source
* 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.main
committed by
GitHub
42 changed files with 818 additions and 2905 deletions
@ -0,0 +1,14 @@ |
|||||
|
{ |
||||
|
"baseUrls": { |
||||
|
"apiBase": "https://localhost:5099/api/", |
||||
|
"webBase": "https://localhost:44315/" |
||||
|
}, |
||||
|
"Logging": { |
||||
|
"IncludeScopes": false, |
||||
|
"LogLevel": { |
||||
|
"Default": "Information", |
||||
|
"Microsoft": "Warning", |
||||
|
"System": "Warning" |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -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
|
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -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
|
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -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); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -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
|
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -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); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -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
|
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -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); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -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
|
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -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); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -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); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -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
|
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -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); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,215 +0,0 @@ |
|||||
using System; |
|
||||
using Microsoft.EntityFrameworkCore; |
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure; |
|
||||
using Microsoft.EntityFrameworkCore.Metadata; |
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
|
||||
using Microsoft.eShopWeb.Infrastructure.Identity; |
|
||||
|
|
||||
namespace Microsoft.eShopWeb.Infrastructure.Identity.Migrations |
|
||||
{ |
|
||||
[DbContext(typeof(AppIdentityDbContext))] |
|
||||
[Migration("20170822214310_InitialIdentityModel")] |
|
||||
partial class InitialIdentityModel |
|
||||
{ |
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
|
||||
{ |
|
||||
modelBuilder |
|
||||
.HasAnnotation("ProductVersion", "1.1.2") |
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); |
|
||||
|
|
||||
modelBuilder.Entity("Infrastructure.Identity.ApplicationUser", b => |
|
||||
{ |
|
||||
b.Property<string>("Id") |
|
||||
.ValueGeneratedOnAdd(); |
|
||||
|
|
||||
b.Property<int>("AccessFailedCount"); |
|
||||
|
|
||||
b.Property<string>("ConcurrencyStamp") |
|
||||
.IsConcurrencyToken(); |
|
||||
|
|
||||
b.Property<string>("Email") |
|
||||
.HasMaxLength(256); |
|
||||
|
|
||||
b.Property<bool>("EmailConfirmed"); |
|
||||
|
|
||||
b.Property<bool>("LockoutEnabled"); |
|
||||
|
|
||||
b.Property<DateTimeOffset?>("LockoutEnd"); |
|
||||
|
|
||||
b.Property<string>("NormalizedEmail") |
|
||||
.HasMaxLength(256); |
|
||||
|
|
||||
b.Property<string>("NormalizedUserName") |
|
||||
.HasMaxLength(256); |
|
||||
|
|
||||
b.Property<string>("PasswordHash"); |
|
||||
|
|
||||
b.Property<string>("PhoneNumber"); |
|
||||
|
|
||||
b.Property<bool>("PhoneNumberConfirmed"); |
|
||||
|
|
||||
b.Property<string>("SecurityStamp"); |
|
||||
|
|
||||
b.Property<bool>("TwoFactorEnabled"); |
|
||||
|
|
||||
b.Property<string>("UserName") |
|
||||
.HasMaxLength(256); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.HasIndex("NormalizedEmail") |
|
||||
.HasName("EmailIndex"); |
|
||||
|
|
||||
b.HasIndex("NormalizedUserName") |
|
||||
.IsUnique() |
|
||||
.HasName("UserNameIndex"); |
|
||||
|
|
||||
b.ToTable("AspNetUsers"); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole", b => |
|
||||
{ |
|
||||
b.Property<string>("Id") |
|
||||
.ValueGeneratedOnAdd(); |
|
||||
|
|
||||
b.Property<string>("ConcurrencyStamp") |
|
||||
.IsConcurrencyToken(); |
|
||||
|
|
||||
b.Property<string>("Name") |
|
||||
.HasMaxLength(256); |
|
||||
|
|
||||
b.Property<string>("NormalizedName") |
|
||||
.HasMaxLength(256); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.HasIndex("NormalizedName") |
|
||||
.IsUnique() |
|
||||
.HasName("RoleNameIndex"); |
|
||||
|
|
||||
b.ToTable("AspNetRoles"); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim<string>", b => |
|
||||
{ |
|
||||
b.Property<int>("Id") |
|
||||
.ValueGeneratedOnAdd(); |
|
||||
|
|
||||
b.Property<string>("ClaimType"); |
|
||||
|
|
||||
b.Property<string>("ClaimValue"); |
|
||||
|
|
||||
b.Property<string>("RoleId") |
|
||||
.IsRequired(); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.HasIndex("RoleId"); |
|
||||
|
|
||||
b.ToTable("AspNetRoleClaims"); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<string>", b => |
|
||||
{ |
|
||||
b.Property<int>("Id") |
|
||||
.ValueGeneratedOnAdd(); |
|
||||
|
|
||||
b.Property<string>("ClaimType"); |
|
||||
|
|
||||
b.Property<string>("ClaimValue"); |
|
||||
|
|
||||
b.Property<string>("UserId") |
|
||||
.IsRequired(); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.HasIndex("UserId"); |
|
||||
|
|
||||
b.ToTable("AspNetUserClaims"); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<string>", b => |
|
||||
{ |
|
||||
b.Property<string>("LoginProvider"); |
|
||||
|
|
||||
b.Property<string>("ProviderKey"); |
|
||||
|
|
||||
b.Property<string>("ProviderDisplayName"); |
|
||||
|
|
||||
b.Property<string>("UserId") |
|
||||
.IsRequired(); |
|
||||
|
|
||||
b.HasKey("LoginProvider", "ProviderKey"); |
|
||||
|
|
||||
b.HasIndex("UserId"); |
|
||||
|
|
||||
b.ToTable("AspNetUserLogins"); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole<string>", b => |
|
||||
{ |
|
||||
b.Property<string>("UserId"); |
|
||||
|
|
||||
b.Property<string>("RoleId"); |
|
||||
|
|
||||
b.HasKey("UserId", "RoleId"); |
|
||||
|
|
||||
b.HasIndex("RoleId"); |
|
||||
|
|
||||
b.ToTable("AspNetUserRoles"); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserToken<string>", b => |
|
||||
{ |
|
||||
b.Property<string>("UserId"); |
|
||||
|
|
||||
b.Property<string>("LoginProvider"); |
|
||||
|
|
||||
b.Property<string>("Name"); |
|
||||
|
|
||||
b.Property<string>("Value"); |
|
||||
|
|
||||
b.HasKey("UserId", "LoginProvider", "Name"); |
|
||||
|
|
||||
b.ToTable("AspNetUserTokens"); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim<string>", b => |
|
||||
{ |
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") |
|
||||
.WithMany("Claims") |
|
||||
.HasForeignKey("RoleId") |
|
||||
.OnDelete(DeleteBehavior.Cascade); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<string>", b => |
|
||||
{ |
|
||||
b.HasOne("Infrastructure.Identity.ApplicationUser") |
|
||||
.WithMany("Claims") |
|
||||
.HasForeignKey("UserId") |
|
||||
.OnDelete(DeleteBehavior.Cascade); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<string>", b => |
|
||||
{ |
|
||||
b.HasOne("Infrastructure.Identity.ApplicationUser") |
|
||||
.WithMany("Logins") |
|
||||
.HasForeignKey("UserId") |
|
||||
.OnDelete(DeleteBehavior.Cascade); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole<string>", b => |
|
||||
{ |
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") |
|
||||
.WithMany("Users") |
|
||||
.HasForeignKey("RoleId") |
|
||||
.OnDelete(DeleteBehavior.Cascade); |
|
||||
|
|
||||
b.HasOne("Infrastructure.Identity.ApplicationUser") |
|
||||
.WithMany("Roles") |
|
||||
.HasForeignKey("UserId") |
|
||||
.OnDelete(DeleteBehavior.Cascade); |
|
||||
}); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,273 @@ |
|||||
|
// <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.Identity; |
||||
|
|
||||
|
namespace Microsoft.eShopWeb.Infrastructure.Identity.Migrations |
||||
|
{ |
||||
|
[DbContext(typeof(AppIdentityDbContext))] |
||||
|
[Migration("20201202111612_InitialIdentityModel")] |
||||
|
partial class InitialIdentityModel |
||||
|
{ |
||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
||||
|
{ |
||||
|
#pragma warning disable 612, 618
|
||||
|
modelBuilder |
||||
|
.UseIdentityColumns() |
||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128) |
||||
|
.HasAnnotation("ProductVersion", "5.0.0"); |
||||
|
|
||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => |
||||
|
{ |
||||
|
b.Property<string>("Id") |
||||
|
.HasColumnType("nvarchar(450)"); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp") |
||||
|
.IsConcurrencyToken() |
||||
|
.HasColumnType("nvarchar(max)"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.HasMaxLength(256) |
||||
|
.HasColumnType("nvarchar(256)"); |
||||
|
|
||||
|
b.Property<string>("NormalizedName") |
||||
|
.HasMaxLength(256) |
||||
|
.HasColumnType("nvarchar(256)"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("NormalizedName") |
||||
|
.IsUnique() |
||||
|
.HasDatabaseName("RoleNameIndex") |
||||
|
.HasFilter("[NormalizedName] IS NOT NULL"); |
||||
|
|
||||
|
b.ToTable("AspNetRoles"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => |
||||
|
{ |
||||
|
b.Property<int>("Id") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("int") |
||||
|
.UseIdentityColumn(); |
||||
|
|
||||
|
b.Property<string>("ClaimType") |
||||
|
.HasColumnType("nvarchar(max)"); |
||||
|
|
||||
|
b.Property<string>("ClaimValue") |
||||
|
.HasColumnType("nvarchar(max)"); |
||||
|
|
||||
|
b.Property<string>("RoleId") |
||||
|
.IsRequired() |
||||
|
.HasColumnType("nvarchar(450)"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("RoleId"); |
||||
|
|
||||
|
b.ToTable("AspNetRoleClaims"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => |
||||
|
{ |
||||
|
b.Property<int>("Id") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("int") |
||||
|
.UseIdentityColumn(); |
||||
|
|
||||
|
b.Property<string>("ClaimType") |
||||
|
.HasColumnType("nvarchar(max)"); |
||||
|
|
||||
|
b.Property<string>("ClaimValue") |
||||
|
.HasColumnType("nvarchar(max)"); |
||||
|
|
||||
|
b.Property<string>("UserId") |
||||
|
.IsRequired() |
||||
|
.HasColumnType("nvarchar(450)"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("UserId"); |
||||
|
|
||||
|
b.ToTable("AspNetUserClaims"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b => |
||||
|
{ |
||||
|
b.Property<string>("LoginProvider") |
||||
|
.HasColumnType("nvarchar(450)"); |
||||
|
|
||||
|
b.Property<string>("ProviderKey") |
||||
|
.HasColumnType("nvarchar(450)"); |
||||
|
|
||||
|
b.Property<string>("ProviderDisplayName") |
||||
|
.HasColumnType("nvarchar(max)"); |
||||
|
|
||||
|
b.Property<string>("UserId") |
||||
|
.IsRequired() |
||||
|
.HasColumnType("nvarchar(450)"); |
||||
|
|
||||
|
b.HasKey("LoginProvider", "ProviderKey"); |
||||
|
|
||||
|
b.HasIndex("UserId"); |
||||
|
|
||||
|
b.ToTable("AspNetUserLogins"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b => |
||||
|
{ |
||||
|
b.Property<string>("UserId") |
||||
|
.HasColumnType("nvarchar(450)"); |
||||
|
|
||||
|
b.Property<string>("RoleId") |
||||
|
.HasColumnType("nvarchar(450)"); |
||||
|
|
||||
|
b.HasKey("UserId", "RoleId"); |
||||
|
|
||||
|
b.HasIndex("RoleId"); |
||||
|
|
||||
|
b.ToTable("AspNetUserRoles"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => |
||||
|
{ |
||||
|
b.Property<string>("UserId") |
||||
|
.HasColumnType("nvarchar(450)"); |
||||
|
|
||||
|
b.Property<string>("LoginProvider") |
||||
|
.HasColumnType("nvarchar(450)"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.HasColumnType("nvarchar(450)"); |
||||
|
|
||||
|
b.Property<string>("Value") |
||||
|
.HasColumnType("nvarchar(max)"); |
||||
|
|
||||
|
b.HasKey("UserId", "LoginProvider", "Name"); |
||||
|
|
||||
|
b.ToTable("AspNetUserTokens"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Microsoft.eShopWeb.Infrastructure.Identity.ApplicationUser", b => |
||||
|
{ |
||||
|
b.Property<string>("Id") |
||||
|
.HasColumnType("nvarchar(450)"); |
||||
|
|
||||
|
b.Property<int>("AccessFailedCount") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp") |
||||
|
.IsConcurrencyToken() |
||||
|
.HasColumnType("nvarchar(max)"); |
||||
|
|
||||
|
b.Property<string>("Email") |
||||
|
.HasMaxLength(256) |
||||
|
.HasColumnType("nvarchar(256)"); |
||||
|
|
||||
|
b.Property<bool>("EmailConfirmed") |
||||
|
.HasColumnType("bit"); |
||||
|
|
||||
|
b.Property<bool>("LockoutEnabled") |
||||
|
.HasColumnType("bit"); |
||||
|
|
||||
|
b.Property<DateTimeOffset?>("LockoutEnd") |
||||
|
.HasColumnType("datetimeoffset"); |
||||
|
|
||||
|
b.Property<string>("NormalizedEmail") |
||||
|
.HasMaxLength(256) |
||||
|
.HasColumnType("nvarchar(256)"); |
||||
|
|
||||
|
b.Property<string>("NormalizedUserName") |
||||
|
.HasMaxLength(256) |
||||
|
.HasColumnType("nvarchar(256)"); |
||||
|
|
||||
|
b.Property<string>("PasswordHash") |
||||
|
.HasColumnType("nvarchar(max)"); |
||||
|
|
||||
|
b.Property<string>("PhoneNumber") |
||||
|
.HasColumnType("nvarchar(max)"); |
||||
|
|
||||
|
b.Property<bool>("PhoneNumberConfirmed") |
||||
|
.HasColumnType("bit"); |
||||
|
|
||||
|
b.Property<string>("SecurityStamp") |
||||
|
.HasColumnType("nvarchar(max)"); |
||||
|
|
||||
|
b.Property<bool>("TwoFactorEnabled") |
||||
|
.HasColumnType("bit"); |
||||
|
|
||||
|
b.Property<string>("UserName") |
||||
|
.HasMaxLength(256) |
||||
|
.HasColumnType("nvarchar(256)"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("NormalizedEmail") |
||||
|
.HasDatabaseName("EmailIndex"); |
||||
|
|
||||
|
b.HasIndex("NormalizedUserName") |
||||
|
.IsUnique() |
||||
|
.HasDatabaseName("UserNameIndex") |
||||
|
.HasFilter("[NormalizedUserName] IS NOT NULL"); |
||||
|
|
||||
|
b.ToTable("AspNetUsers"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => |
||||
|
{ |
||||
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) |
||||
|
.WithMany() |
||||
|
.HasForeignKey("RoleId") |
||||
|
.OnDelete(DeleteBehavior.Cascade) |
||||
|
.IsRequired(); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => |
||||
|
{ |
||||
|
b.HasOne("Microsoft.eShopWeb.Infrastructure.Identity.ApplicationUser", null) |
||||
|
.WithMany() |
||||
|
.HasForeignKey("UserId") |
||||
|
.OnDelete(DeleteBehavior.Cascade) |
||||
|
.IsRequired(); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b => |
||||
|
{ |
||||
|
b.HasOne("Microsoft.eShopWeb.Infrastructure.Identity.ApplicationUser", null) |
||||
|
.WithMany() |
||||
|
.HasForeignKey("UserId") |
||||
|
.OnDelete(DeleteBehavior.Cascade) |
||||
|
.IsRequired(); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b => |
||||
|
{ |
||||
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) |
||||
|
.WithMany() |
||||
|
.HasForeignKey("RoleId") |
||||
|
.OnDelete(DeleteBehavior.Cascade) |
||||
|
.IsRequired(); |
||||
|
|
||||
|
b.HasOne("Microsoft.eShopWeb.Infrastructure.Identity.ApplicationUser", null) |
||||
|
.WithMany() |
||||
|
.HasForeignKey("UserId") |
||||
|
.OnDelete(DeleteBehavior.Cascade) |
||||
|
.IsRequired(); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => |
||||
|
{ |
||||
|
b.HasOne("Microsoft.eShopWeb.Infrastructure.Identity.ApplicationUser", null) |
||||
|
.WithMany() |
||||
|
.HasForeignKey("UserId") |
||||
|
.OnDelete(DeleteBehavior.Cascade) |
||||
|
.IsRequired(); |
||||
|
}); |
||||
|
#pragma warning restore 612, 618
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue