using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace NexusReader.Data.Migrations
{
///
public partial class AddQuizResults : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "QuizResults",
columns: table => new
{
Id = table.Column(type: "uuid", nullable: false),
UserId = table.Column(type: "text", nullable: false),
Topic = table.Column(type: "text", nullable: false),
Score = table.Column(type: "integer", nullable: false),
TotalQuestions = table.Column(type: "integer", nullable: false),
CompletedDate = table.Column(type: "timestamp without time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_QuizResults", x => x.Id);
table.ForeignKey(
name: "FK_QuizResults_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_QuizResults_UserId",
table: "QuizResults",
column: "UserId");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "QuizResults");
}
}
}