101 lines
3.3 KiB
C#
101 lines
3.3 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Distribution.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddStoreContactNumberAndNullableOwner : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "OwnerName",
|
|
table: "Stores",
|
|
type: "longtext",
|
|
nullable: true,
|
|
oldClrType: typeof(string),
|
|
oldType: "longtext")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "ContactNumber",
|
|
table: "Stores",
|
|
type: "longtext",
|
|
nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "Stores",
|
|
keyColumn: "Id",
|
|
keyValue: new Guid("26000000-0000-0000-0000-000000000001"),
|
|
column: "ContactNumber",
|
|
value: null);
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "Stores",
|
|
keyColumn: "Id",
|
|
keyValue: new Guid("26000000-0000-0000-0000-000000000002"),
|
|
column: "ContactNumber",
|
|
value: null);
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "Stores",
|
|
keyColumn: "Id",
|
|
keyValue: new Guid("26000000-0000-0000-0000-000000000003"),
|
|
column: "ContactNumber",
|
|
value: null);
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "Stores",
|
|
keyColumn: "Id",
|
|
keyValue: new Guid("26000000-0000-0000-0000-000000000004"),
|
|
column: "ContactNumber",
|
|
value: null);
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "Stores",
|
|
keyColumn: "Id",
|
|
keyValue: new Guid("26000000-0000-0000-0000-000000000005"),
|
|
column: "ContactNumber",
|
|
value: null);
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "Stores",
|
|
keyColumn: "Id",
|
|
keyValue: new Guid("26000000-0000-0000-0000-000000000006"),
|
|
column: "ContactNumber",
|
|
value: null);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "ContactNumber",
|
|
table: "Stores");
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "Stores",
|
|
keyColumn: "OwnerName",
|
|
keyValue: null,
|
|
column: "OwnerName",
|
|
value: "");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "OwnerName",
|
|
table: "Stores",
|
|
type: "longtext",
|
|
nullable: false,
|
|
oldClrType: typeof(string),
|
|
oldType: "longtext",
|
|
oldNullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
|
}
|
|
}
|
|
}
|