using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace MTWorkHR.Infrastructure.Migrations
{
///
public partial class country : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "JobTitle",
table: "AspNetUsers");
migrationBuilder.DropColumn(
name: "University",
table: "AspNetUsers");
migrationBuilder.AddColumn(
name: "CountryId",
table: "AspNetUsers",
type: "int",
nullable: true);
migrationBuilder.AddColumn(
name: "IndustryId",
table: "AspNetUsers",
type: "int",
nullable: true);
migrationBuilder.AddColumn(
name: "JobTitleId",
table: "AspNetUsers",
type: "int",
nullable: true);
migrationBuilder.AddColumn(
name: "UniversityId",
table: "AspNetUsers",
type: "int",
nullable: true);
migrationBuilder.CreateTable(
name: "CountryLookups",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
NameAr = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false),
NameEn = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false),
Code = table.Column(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CountryLookups", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Industries",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
NameAr = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false),
NameEn = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Industries", x => x.Id);
});
migrationBuilder.CreateTable(
name: "JobTitles",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
NameAr = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false),
NameEn = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_JobTitles", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Qualifications",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
NameAr = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false),
NameEn = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Qualifications", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Universities",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
NameAr = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false),
NameEn = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Universities", x => x.Id);
});
migrationBuilder.UpdateData(
table: "AspNetUsers",
keyColumn: "Id",
keyValue: "ADMB3B92-2311-48F8-9DEC-F9FAEF1F21UA",
columns: new[] { "CountryId", "IndustryId", "JobTitleId", "UniversityId" },
values: new object[] { null, null, null, null });
migrationBuilder.UpdateData(
table: "AspNetUsers",
keyColumn: "Id",
keyValue: "AL5B3B92-2311-48F8-9DEC-F9FAEF1F21UB",
columns: new[] { "CountryId", "IndustryId", "JobTitleId", "UniversityId" },
values: new object[] { null, null, null, null });
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CountryLookups");
migrationBuilder.DropTable(
name: "Industries");
migrationBuilder.DropTable(
name: "JobTitles");
migrationBuilder.DropTable(
name: "Qualifications");
migrationBuilder.DropTable(
name: "Universities");
migrationBuilder.DropColumn(
name: "CountryId",
table: "AspNetUsers");
migrationBuilder.DropColumn(
name: "IndustryId",
table: "AspNetUsers");
migrationBuilder.DropColumn(
name: "JobTitleId",
table: "AspNetUsers");
migrationBuilder.DropColumn(
name: "UniversityId",
table: "AspNetUsers");
migrationBuilder.AddColumn(
name: "JobTitle",
table: "AspNetUsers",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn(
name: "University",
table: "AspNetUsers",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.UpdateData(
table: "AspNetUsers",
keyColumn: "Id",
keyValue: "ADMB3B92-2311-48F8-9DEC-F9FAEF1F21UA",
columns: new[] { "JobTitle", "University" },
values: new object[] { null, null });
migrationBuilder.UpdateData(
table: "AspNetUsers",
keyColumn: "Id",
keyValue: "AL5B3B92-2311-48F8-9DEC-F9FAEF1F21UB",
columns: new[] { "JobTitle", "University" },
values: new object[] { null, null });
}
}
}