Updates to existing PR
- updating City value to be 100 instead of 189. The longest city name in the world is 85 characters long, so making it 100 just in case. - Fixed typo in file name: constrains to constraints
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user