Skip to content

Commit e0d67bf

Browse files
committed
Add catalog product migration
1 parent ac53528 commit e0d67bf

3 files changed

Lines changed: 170 additions & 0 deletions

File tree

src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20170509130025_AddStockProductItem.Designer.cs

Lines changed: 107 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using Microsoft.EntityFrameworkCore.Migrations;
4+
5+
namespace Catalog.API.Infrastructure.Migrations
6+
{
7+
public partial class AddStockProductItem : Migration
8+
{
9+
protected override void Up(MigrationBuilder migrationBuilder)
10+
{
11+
migrationBuilder.AddColumn<int>(
12+
name: "AvailableStock",
13+
table: "Catalog",
14+
nullable: false,
15+
defaultValue: 0);
16+
17+
migrationBuilder.AddColumn<int>(
18+
name: "MaxStockThreshold",
19+
table: "Catalog",
20+
nullable: false,
21+
defaultValue: 0);
22+
23+
migrationBuilder.AddColumn<bool>(
24+
name: "OnReorder",
25+
table: "Catalog",
26+
nullable: false,
27+
defaultValue: false);
28+
29+
migrationBuilder.AddColumn<int>(
30+
name: "RestockThreshold",
31+
table: "Catalog",
32+
nullable: false,
33+
defaultValue: 0);
34+
}
35+
36+
protected override void Down(MigrationBuilder migrationBuilder)
37+
{
38+
migrationBuilder.DropColumn(
39+
name: "AvailableStock",
40+
table: "Catalog");
41+
42+
migrationBuilder.DropColumn(
43+
name: "MaxStockThreshold",
44+
table: "Catalog");
45+
46+
migrationBuilder.DropColumn(
47+
name: "OnReorder",
48+
table: "Catalog");
49+
50+
migrationBuilder.DropColumn(
51+
name: "RestockThreshold",
52+
table: "Catalog");
53+
}
54+
}
55+
}

src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/CatalogContextModelSnapshot.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,28 @@ protected override void BuildModel(ModelBuilder modelBuilder)
4242
.HasAnnotation("SqlServer:HiLoSequenceName", "catalog_hilo")
4343
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo);
4444

45+
b.Property<int>("AvailableStock");
46+
4547
b.Property<int>("CatalogBrandId");
4648

4749
b.Property<int>("CatalogTypeId");
4850

4951
b.Property<string>("Description");
5052

53+
b.Property<int>("MaxStockThreshold");
54+
5155
b.Property<string>("Name")
5256
.IsRequired()
5357
.HasMaxLength(50);
5458

59+
b.Property<bool>("OnReorder");
60+
5561
b.Property<string>("PictureUri");
5662

5763
b.Property<decimal>("Price");
5864

65+
b.Property<int>("RestockThreshold");
66+
5967
b.HasKey("Id");
6068

6169
b.HasIndex("CatalogBrandId");

0 commit comments

Comments
 (0)