|
@@ -0,0 +1,96 @@
|
|
|
+using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
+
|
|
|
+#nullable disable
|
|
|
+
|
|
|
+namespace MTWorkHR.Infrastructure.Migrations
|
|
|
+{
|
|
|
+ /// <inheritdoc />
|
|
|
+ public partial class altrAddress : Migration
|
|
|
+ {
|
|
|
+ /// <inheritdoc />
|
|
|
+ protected override void Up(MigrationBuilder migrationBuilder)
|
|
|
+ {
|
|
|
+ migrationBuilder.DropColumn(
|
|
|
+ name: "City",
|
|
|
+ table: "UserAddress");
|
|
|
+
|
|
|
+ migrationBuilder.AlterColumn<long>(
|
|
|
+ name: "CountryId",
|
|
|
+ table: "UserAddress",
|
|
|
+ type: "bigint",
|
|
|
+ nullable: true,
|
|
|
+ oldClrType: typeof(int),
|
|
|
+ oldType: "int",
|
|
|
+ oldNullable: true);
|
|
|
+
|
|
|
+ migrationBuilder.AddColumn<long>(
|
|
|
+ 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");
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <inheritdoc />
|
|
|
+ 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<int>(
|
|
|
+ name: "CountryId",
|
|
|
+ table: "UserAddress",
|
|
|
+ type: "int",
|
|
|
+ nullable: true,
|
|
|
+ oldClrType: typeof(long),
|
|
|
+ oldType: "bigint",
|
|
|
+ oldNullable: true);
|
|
|
+
|
|
|
+ migrationBuilder.AddColumn<string>(
|
|
|
+ name: "City",
|
|
|
+ table: "UserAddress",
|
|
|
+ type: "nvarchar(max)",
|
|
|
+ nullable: true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|