Updating and testing migrations (#42)

Updating readme to describe how to run migrations
This commit is contained in:
Steve Smith
2017-08-22 17:58:53 -04:00
committed by GitHub
parent ecb4889dd3
commit eefc8170cb
9 changed files with 842 additions and 22 deletions

View File

@@ -1,6 +1,9 @@
using Microsoft.EntityFrameworkCore;
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Infrastructure.Data;
namespace Infrastructure.Data.Migrations
{
@@ -10,13 +13,45 @@ namespace Infrastructure.Data.Migrations
protected override void BuildModel(ModelBuilder modelBuilder)
{
modelBuilder
.HasAnnotation("ProductVersion", "1.1.0-rtm-22752")
.HasAnnotation("ProductVersion", "1.1.2")
.HasAnnotation("SqlServer:Sequence:.catalog_brand_hilo", "'catalog_brand_hilo', '', '1', '10', '', '', 'Int64', 'False'")
.HasAnnotation("SqlServer:Sequence:.catalog_hilo", "'catalog_hilo', '', '1', '10', '', '', 'Int64', 'False'")
.HasAnnotation("SqlServer:Sequence:.catalog_type_hilo", "'catalog_type_hilo', '', '1', '10', '', '', 'Int64', 'False'")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("eShopWeb.Models.CatalogBrand", b =>
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()
@@ -32,7 +67,7 @@ namespace Infrastructure.Data.Migrations
b.ToTable("CatalogBrand");
});
modelBuilder.Entity("eShopWeb.Models.CatalogItem", b =>
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@@ -62,7 +97,7 @@ namespace Infrastructure.Data.Migrations
b.ToTable("Catalog");
});
modelBuilder.Entity("eShopWeb.Models.CatalogType", b =>
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogType", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@@ -78,14 +113,21 @@ namespace Infrastructure.Data.Migrations
b.ToTable("CatalogType");
});
modelBuilder.Entity("eShopWeb.Models.CatalogItem", b =>
modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.BasketItem", b =>
{
b.HasOne("eShopWeb.Models.CatalogBrand", "CatalogBrand")
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("eShopWeb.Models.CatalogType", "CatalogType")
b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogType", "CatalogType")
.WithMany()
.HasForeignKey("CatalogTypeId")
.OnDelete(DeleteBehavior.Cascade);