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