|
@@ -0,0 +1,69 @@
|
|
|
+using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
+
|
|
|
+#nullable disable
|
|
|
+
|
|
|
+namespace MTWorkHR.Infrastructure.Migrations
|
|
|
+{
|
|
|
+ /// <inheritdoc />
|
|
|
+ public partial class altrTaskHistory2 : Migration
|
|
|
+ {
|
|
|
+ /// <inheritdoc />
|
|
|
+ protected override void Up(MigrationBuilder migrationBuilder)
|
|
|
+ {
|
|
|
+ migrationBuilder.DropForeignKey(
|
|
|
+ name: "FK_UserTaskHistories_UserTasks_UserTaskId",
|
|
|
+ table: "UserTaskHistories");
|
|
|
+
|
|
|
+ migrationBuilder.DropIndex(
|
|
|
+ name: "IX_UserTaskHistories_UserTaskId",
|
|
|
+ table: "UserTaskHistories");
|
|
|
+
|
|
|
+ migrationBuilder.DropColumn(
|
|
|
+ name: "UserTaskId",
|
|
|
+ table: "UserTaskHistories");
|
|
|
+
|
|
|
+ migrationBuilder.CreateIndex(
|
|
|
+ name: "IX_UserTaskHistories_TaskId",
|
|
|
+ table: "UserTaskHistories",
|
|
|
+ column: "TaskId");
|
|
|
+
|
|
|
+ migrationBuilder.AddForeignKey(
|
|
|
+ name: "FK_UserTaskHistories_UserTasks_TaskId",
|
|
|
+ table: "UserTaskHistories",
|
|
|
+ column: "TaskId",
|
|
|
+ principalTable: "UserTasks",
|
|
|
+ principalColumn: "Id",
|
|
|
+ onDelete: ReferentialAction.NoAction);
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <inheritdoc />
|
|
|
+ protected override void Down(MigrationBuilder migrationBuilder)
|
|
|
+ {
|
|
|
+ migrationBuilder.DropForeignKey(
|
|
|
+ name: "FK_UserTaskHistories_UserTasks_TaskId",
|
|
|
+ table: "UserTaskHistories");
|
|
|
+
|
|
|
+ migrationBuilder.DropIndex(
|
|
|
+ name: "IX_UserTaskHistories_TaskId",
|
|
|
+ table: "UserTaskHistories");
|
|
|
+
|
|
|
+ migrationBuilder.AddColumn<long>(
|
|
|
+ name: "UserTaskId",
|
|
|
+ table: "UserTaskHistories",
|
|
|
+ type: "bigint",
|
|
|
+ nullable: true);
|
|
|
+
|
|
|
+ migrationBuilder.CreateIndex(
|
|
|
+ name: "IX_UserTaskHistories_UserTaskId",
|
|
|
+ table: "UserTaskHistories",
|
|
|
+ column: "UserTaskId");
|
|
|
+
|
|
|
+ migrationBuilder.AddForeignKey(
|
|
|
+ name: "FK_UserTaskHistories_UserTasks_UserTaskId",
|
|
|
+ table: "UserTaskHistories",
|
|
|
+ column: "UserTaskId",
|
|
|
+ principalTable: "UserTasks",
|
|
|
+ principalColumn: "Id");
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|