105 lines
3.8 KiB
C#
105 lines
3.8 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
|
|
|
namespace TechHelper.Server.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class score_in_submission : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DeleteData(
|
|
table: "AspNetRoles",
|
|
keyColumn: "Id",
|
|
keyValue: new Guid("379143a2-8d7f-4ef7-b7c0-14701b710f87"));
|
|
|
|
migrationBuilder.DeleteData(
|
|
table: "AspNetRoles",
|
|
keyColumn: "Id",
|
|
keyValue: new Guid("6d49bb08-97d6-4a38-88a7-8080925b589b"));
|
|
|
|
migrationBuilder.DeleteData(
|
|
table: "AspNetRoles",
|
|
keyColumn: "Id",
|
|
keyValue: new Guid("e330c745-f422-43e3-bcdf-1439ace3c52f"));
|
|
|
|
migrationBuilder.AddColumn<byte>(
|
|
name: "ErrorQuesNum",
|
|
table: "submissions",
|
|
type: "tinyint unsigned",
|
|
nullable: false,
|
|
defaultValue: (byte)0);
|
|
|
|
migrationBuilder.AddColumn<byte>(
|
|
name: "TotalQuesNum",
|
|
table: "submissions",
|
|
type: "tinyint unsigned",
|
|
nullable: false,
|
|
defaultValue: (byte)0);
|
|
|
|
migrationBuilder.AddColumn<byte>(
|
|
name: "TotalScore",
|
|
table: "submissions",
|
|
type: "tinyint unsigned",
|
|
nullable: false,
|
|
defaultValue: (byte)0);
|
|
|
|
migrationBuilder.InsertData(
|
|
table: "AspNetRoles",
|
|
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
|
values: new object[,]
|
|
{
|
|
{ new Guid("53307917-63c4-468a-ab05-a03882a69ef8"), null, "Teacher", "TEACHER" },
|
|
{ new Guid("789b7819-685f-4a2b-9adf-463f397f24d1"), null, "Administrator", "ADMINISTRATOR" },
|
|
{ new Guid("bbea7915-e27c-4ddc-b06c-1f579fc8104e"), null, "Student", "STUDENT" }
|
|
});
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DeleteData(
|
|
table: "AspNetRoles",
|
|
keyColumn: "Id",
|
|
keyValue: new Guid("53307917-63c4-468a-ab05-a03882a69ef8"));
|
|
|
|
migrationBuilder.DeleteData(
|
|
table: "AspNetRoles",
|
|
keyColumn: "Id",
|
|
keyValue: new Guid("789b7819-685f-4a2b-9adf-463f397f24d1"));
|
|
|
|
migrationBuilder.DeleteData(
|
|
table: "AspNetRoles",
|
|
keyColumn: "Id",
|
|
keyValue: new Guid("bbea7915-e27c-4ddc-b06c-1f579fc8104e"));
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "ErrorQuesNum",
|
|
table: "submissions");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "TotalQuesNum",
|
|
table: "submissions");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "TotalScore",
|
|
table: "submissions");
|
|
|
|
migrationBuilder.InsertData(
|
|
table: "AspNetRoles",
|
|
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
|
values: new object[,]
|
|
{
|
|
{ new Guid("379143a2-8d7f-4ef7-b7c0-14701b710f87"), null, "Administrator", "ADMINISTRATOR" },
|
|
{ new Guid("6d49bb08-97d6-4a38-88a7-8080925b589b"), null, "Student", "STUDENT" },
|
|
{ new Guid("e330c745-f422-43e3-bcdf-1439ace3c52f"), null, "Teacher", "TEACHER" }
|
|
});
|
|
}
|
|
}
|
|
}
|