Files
eShopOnWeb/src/Infrastructure/Data/Migrations/20180725190153_AddExtraConstraints.cs
Eric Fleming 9c65c4e3f7 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
2019-01-22 20:28:56 -05:00

105 lines
3.4 KiB
C#

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);
}
}
}