using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace MTWorkHR.Infrastructure.Migrations { /// public partial class altrCompanyTbl : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterColumn( name: "PhoneNumber", table: "Companies", type: "nvarchar(max)", nullable: false, oldClrType: typeof(int), oldType: "int"); migrationBuilder.AlterColumn( name: "Email", table: "Companies", type: "nvarchar(max)", nullable: false, oldClrType: typeof(int), oldType: "int"); migrationBuilder.AlterColumn( name: "Address", table: "Companies", type: "nvarchar(max)", nullable: false, oldClrType: typeof(int), oldType: "int"); migrationBuilder.AddColumn( name: "CityId", table: "Companies", type: "bigint", nullable: true); migrationBuilder.AddColumn( name: "CountryId", table: "Companies", type: "bigint", nullable: true); migrationBuilder.CreateIndex( name: "IX_Companies_CityId", table: "Companies", column: "CityId"); migrationBuilder.CreateIndex( name: "IX_Companies_CountryId", table: "Companies", column: "CountryId"); migrationBuilder.AddForeignKey( name: "FK_Companies_Cities_CityId", table: "Companies", column: "CityId", principalTable: "Cities", principalColumn: "Id"); migrationBuilder.AddForeignKey( name: "FK_Companies_CountryLookups_CountryId", table: "Companies", column: "CountryId", principalTable: "CountryLookups", principalColumn: "Id"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Companies_Cities_CityId", table: "Companies"); migrationBuilder.DropForeignKey( name: "FK_Companies_CountryLookups_CountryId", table: "Companies"); migrationBuilder.DropIndex( name: "IX_Companies_CityId", table: "Companies"); migrationBuilder.DropIndex( name: "IX_Companies_CountryId", table: "Companies"); migrationBuilder.DropColumn( name: "CityId", table: "Companies"); migrationBuilder.DropColumn( name: "CountryId", table: "Companies"); migrationBuilder.AlterColumn( name: "PhoneNumber", table: "Companies", type: "int", nullable: false, oldClrType: typeof(string), oldType: "nvarchar(max)"); migrationBuilder.AlterColumn( name: "Email", table: "Companies", type: "int", nullable: false, oldClrType: typeof(string), oldType: "nvarchar(max)"); migrationBuilder.AlterColumn( name: "Address", table: "Companies", type: "int", nullable: false, oldClrType: typeof(string), oldType: "nvarchar(max)"); } } }