123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- using Microsoft.EntityFrameworkCore.Migrations;
- #nullable disable
- #pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
- namespace MTWorkHR.Infrastructure.Migrations
- {
- /// <inheritdoc />
- public partial class altrAttach : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(
- name: "FK_UserTaskAttachments_AttachmentTypes_AttachmentTypeId",
- table: "UserTaskAttachments");
- migrationBuilder.AlterColumn<string>(
- name: "OriginalName",
- table: "UserTaskAttachments",
- type: "nvarchar(250)",
- maxLength: 250,
- nullable: true,
- oldClrType: typeof(string),
- oldType: "nvarchar(250)",
- oldMaxLength: 250);
- migrationBuilder.AlterColumn<long>(
- name: "AttachmentTypeId",
- table: "UserTaskAttachments",
- type: "bigint",
- nullable: true,
- oldClrType: typeof(long),
- oldType: "bigint");
- migrationBuilder.InsertData(
- table: "AttachmentTypes",
- columns: new[] { "Id", "IsRequired", "NameAr", "NameEn" },
- values: new object[,]
- {
- { 3L, false, "شهادة التعليم", "Education Certification" },
- { 4L, false, "شهادة الخبرة", "Experience Certification" },
- { 5L, false, "شهادة الاحتراف", "Professional Certification" }
- });
- migrationBuilder.AddForeignKey(
- name: "FK_UserTaskAttachments_AttachmentTypes_AttachmentTypeId",
- table: "UserTaskAttachments",
- column: "AttachmentTypeId",
- principalTable: "AttachmentTypes",
- principalColumn: "Id");
- }
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(
- name: "FK_UserTaskAttachments_AttachmentTypes_AttachmentTypeId",
- table: "UserTaskAttachments");
- migrationBuilder.DeleteData(
- table: "AttachmentTypes",
- keyColumn: "Id",
- keyValue: 3L);
- migrationBuilder.DeleteData(
- table: "AttachmentTypes",
- keyColumn: "Id",
- keyValue: 4L);
- migrationBuilder.DeleteData(
- table: "AttachmentTypes",
- keyColumn: "Id",
- keyValue: 5L);
- migrationBuilder.AlterColumn<string>(
- name: "OriginalName",
- table: "UserTaskAttachments",
- type: "nvarchar(250)",
- maxLength: 250,
- nullable: false,
- defaultValue: "",
- oldClrType: typeof(string),
- oldType: "nvarchar(250)",
- oldMaxLength: 250,
- oldNullable: true);
- migrationBuilder.AlterColumn<long>(
- name: "AttachmentTypeId",
- table: "UserTaskAttachments",
- type: "bigint",
- nullable: false,
- defaultValue: 0L,
- oldClrType: typeof(long),
- oldType: "bigint",
- oldNullable: true);
- migrationBuilder.AddForeignKey(
- name: "FK_UserTaskAttachments_AttachmentTypes_AttachmentTypeId",
- table: "UserTaskAttachments",
- column: "AttachmentTypeId",
- principalTable: "AttachmentTypes",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- }
- }
- }
|