using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace MTWorkHR.Infrastructure.Migrations
{
///
public partial class altrAddress : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "City",
table: "UserAddress");
migrationBuilder.AlterColumn(
name: "CountryId",
table: "UserAddress",
type: "bigint",
nullable: true,
oldClrType: typeof(int),
oldType: "int",
oldNullable: true);
migrationBuilder.AddColumn(
name: "CityId",
table: "UserAddress",
type: "bigint",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_UserAddress_CityId",
table: "UserAddress",
column: "CityId");
migrationBuilder.CreateIndex(
name: "IX_UserAddress_CountryId",
table: "UserAddress",
column: "CountryId");
migrationBuilder.AddForeignKey(
name: "FK_UserAddress_Cities_CityId",
table: "UserAddress",
column: "CityId",
principalTable: "Cities",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_UserAddress_CountryLookups_CountryId",
table: "UserAddress",
column: "CountryId",
principalTable: "CountryLookups",
principalColumn: "Id");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_UserAddress_Cities_CityId",
table: "UserAddress");
migrationBuilder.DropForeignKey(
name: "FK_UserAddress_CountryLookups_CountryId",
table: "UserAddress");
migrationBuilder.DropIndex(
name: "IX_UserAddress_CityId",
table: "UserAddress");
migrationBuilder.DropIndex(
name: "IX_UserAddress_CountryId",
table: "UserAddress");
migrationBuilder.DropColumn(
name: "CityId",
table: "UserAddress");
migrationBuilder.AlterColumn(
name: "CountryId",
table: "UserAddress",
type: "int",
nullable: true,
oldClrType: typeof(long),
oldType: "bigint",
oldNullable: true);
migrationBuilder.AddColumn(
name: "City",
table: "UserAddress",
type: "nvarchar(max)",
nullable: true);
}
}
}