109 lines
3.6 KiB
C#
109 lines
3.6 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace ManagerService.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class UpdateMix6 : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_QuizQuestion_Resources_ResourceId",
|
|
table: "QuizQuestion");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_QuizQuestion_Sections_SectionQuizId",
|
|
table: "QuizQuestion");
|
|
|
|
migrationBuilder.DropPrimaryKey(
|
|
name: "PK_QuizQuestion",
|
|
table: "QuizQuestion");
|
|
|
|
migrationBuilder.RenameTable(
|
|
name: "QuizQuestion",
|
|
newName: "QuizQuestions");
|
|
|
|
migrationBuilder.RenameIndex(
|
|
name: "IX_QuizQuestion_SectionQuizId",
|
|
table: "QuizQuestions",
|
|
newName: "IX_QuizQuestions_SectionQuizId");
|
|
|
|
migrationBuilder.RenameIndex(
|
|
name: "IX_QuizQuestion_ResourceId",
|
|
table: "QuizQuestions",
|
|
newName: "IX_QuizQuestions_ResourceId");
|
|
|
|
migrationBuilder.AddPrimaryKey(
|
|
name: "PK_QuizQuestions",
|
|
table: "QuizQuestions",
|
|
column: "Id");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_QuizQuestions_Resources_ResourceId",
|
|
table: "QuizQuestions",
|
|
column: "ResourceId",
|
|
principalTable: "Resources",
|
|
principalColumn: "Id");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_QuizQuestions_Sections_SectionQuizId",
|
|
table: "QuizQuestions",
|
|
column: "SectionQuizId",
|
|
principalTable: "Sections",
|
|
principalColumn: "Id");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_QuizQuestions_Resources_ResourceId",
|
|
table: "QuizQuestions");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_QuizQuestions_Sections_SectionQuizId",
|
|
table: "QuizQuestions");
|
|
|
|
migrationBuilder.DropPrimaryKey(
|
|
name: "PK_QuizQuestions",
|
|
table: "QuizQuestions");
|
|
|
|
migrationBuilder.RenameTable(
|
|
name: "QuizQuestions",
|
|
newName: "QuizQuestion");
|
|
|
|
migrationBuilder.RenameIndex(
|
|
name: "IX_QuizQuestions_SectionQuizId",
|
|
table: "QuizQuestion",
|
|
newName: "IX_QuizQuestion_SectionQuizId");
|
|
|
|
migrationBuilder.RenameIndex(
|
|
name: "IX_QuizQuestions_ResourceId",
|
|
table: "QuizQuestion",
|
|
newName: "IX_QuizQuestion_ResourceId");
|
|
|
|
migrationBuilder.AddPrimaryKey(
|
|
name: "PK_QuizQuestion",
|
|
table: "QuizQuestion",
|
|
column: "Id");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_QuizQuestion_Resources_ResourceId",
|
|
table: "QuizQuestion",
|
|
column: "ResourceId",
|
|
principalTable: "Resources",
|
|
principalColumn: "Id");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_QuizQuestion_Sections_SectionQuizId",
|
|
table: "QuizQuestion",
|
|
column: "SectionQuizId",
|
|
principalTable: "Sections",
|
|
principalColumn: "Id");
|
|
}
|
|
}
|
|
}
|