123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- using Microsoft.EntityFrameworkCore.Migrations;
- #nullable disable
- namespace MTWorkHR.Infrastructure.Migrations
- {
- /// <inheritdoc />
- public partial class country : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "JobTitle",
- table: "AspNetUsers");
- migrationBuilder.DropColumn(
- name: "University",
- table: "AspNetUsers");
- migrationBuilder.AddColumn<int>(
- name: "CountryId",
- table: "AspNetUsers",
- type: "int",
- nullable: true);
- migrationBuilder.AddColumn<int>(
- name: "IndustryId",
- table: "AspNetUsers",
- type: "int",
- nullable: true);
- migrationBuilder.AddColumn<int>(
- name: "JobTitleId",
- table: "AspNetUsers",
- type: "int",
- nullable: true);
- migrationBuilder.AddColumn<int>(
- name: "UniversityId",
- table: "AspNetUsers",
- type: "int",
- nullable: true);
- migrationBuilder.CreateTable(
- name: "CountryLookups",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- NameAr = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
- NameEn = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
- Code = table.Column<string>(type: "nvarchar(max)", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_CountryLookups", x => x.Id);
- });
- migrationBuilder.CreateTable(
- name: "Industries",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- NameAr = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
- NameEn = table.Column<string>(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<long>(type: "bigint", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- NameAr = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
- NameEn = table.Column<string>(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<long>(type: "bigint", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- NameAr = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
- NameEn = table.Column<string>(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<long>(type: "bigint", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- NameAr = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
- NameEn = table.Column<string>(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 });
- }
- /// <inheritdoc />
- 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<string>(
- name: "JobTitle",
- table: "AspNetUsers",
- type: "nvarchar(max)",
- nullable: true);
- migrationBuilder.AddColumn<string>(
- 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 });
- }
- }
- }
|