using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace TechHelper.Server.Migrations
{
///
public partial class init : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AspNetRoles",
columns: table => new
{
Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
NormalizedName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetRoles", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AspNetUsers",
columns: table => new
{
Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
RefreshToken = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
RefreshTokenExpiryTime = table.Column(type: "datetime(6)", nullable: true),
Address = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DisplayName = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
deleted = table.Column(type: "tinyint(1)", nullable: false),
UserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
NormalizedUserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Email = table.Column(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
NormalizedEmail = table.Column(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
EmailConfirmed = table.Column(type: "tinyint(1)", nullable: false),
PasswordHash = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
SecurityStamp = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
PhoneNumber = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
PhoneNumberConfirmed = table.Column(type: "tinyint(1)", nullable: false),
TwoFactorEnabled = table.Column(type: "tinyint(1)", nullable: false),
LockoutEnd = table.Column(type: "datetime(6)", nullable: true),
LockoutEnabled = table.Column(type: "tinyint(1)", nullable: false),
AccessFailedCount = table.Column(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUsers", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AspNetRoleClaims",
columns: table => new
{
Id = table.Column(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
RoleId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ClaimType = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ClaimValue = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id);
table.ForeignKey(
name: "FK_AspNetRoleClaims_AspNetRoles_RoleId",
column: x => x.RoleId,
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AspNetUserClaims",
columns: table => new
{
Id = table.Column(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ClaimType = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ClaimValue = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserClaims", x => x.Id);
table.ForeignKey(
name: "FK_AspNetUserClaims_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AspNetUserLogins",
columns: table => new
{
LoginProvider = table.Column(type: "varchar(255)", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ProviderKey = table.Column(type: "varchar(255)", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ProviderDisplayName = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey });
table.ForeignKey(
name: "FK_AspNetUserLogins_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AspNetUserRoles",
columns: table => new
{
UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
RoleId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId });
table.ForeignKey(
name: "FK_AspNetUserRoles_AspNetRoles_RoleId",
column: x => x.RoleId,
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AspNetUserRoles_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AspNetUserTokens",
columns: table => new
{
UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
LoginProvider = table.Column(type: "varchar(255)", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Name = table.Column(type: "varchar(255)", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Value = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
table.ForeignKey(
name: "FK_AspNetUserTokens_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "assignments",
columns: table => new
{
id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
title = table.Column(type: "varchar(255)", maxLength: 255, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
description = table.Column(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
subject_area = table.Column(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
due_date = table.Column(type: "datetime(6)", nullable: false),
total_points = table.Column(type: "float", nullable: true),
created_by = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
created_at = table.Column(type: "datetime(6)", nullable: false),
updated_at = table.Column(type: "datetime(6)", nullable: false),
deleted = table.Column(type: "tinyint(1)", nullable: false),
UserId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_assignments", x => x.id);
table.ForeignKey(
name: "FK_assignments_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id");
table.ForeignKey(
name: "FK_assignments_AspNetUsers_created_by",
column: x => x.created_by,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "classes",
columns: table => new
{
id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
grade = table.Column(type: "tinyint unsigned", nullable: false),
@class = table.Column(name: "class", type: "tinyint unsigned", nullable: false),
description = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
head_teacher_id = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
created_at = table.Column(type: "datetime(6)", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
updated_at = table.Column(type: "datetime(6)", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
deleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false)
},
constraints: table =>
{
table.PrimaryKey("PK_classes", x => x.id);
table.ForeignKey(
name: "FK_classes_AspNetUsers_head_teacher_id",
column: x => x.head_teacher_id,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "questions",
columns: table => new
{
id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
question_text = table.Column(type: "longtext", maxLength: 65535, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
question_type = table.Column(type: "varchar(20)", maxLength: 20, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
correct_answer = table.Column(type: "longtext", maxLength: 65535, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
difficulty_level = table.Column(type: "varchar(10)", maxLength: 10, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
subject_area = table.Column(type: "varchar(100)", maxLength: 100, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
created_by = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
created_at = table.Column(type: "datetime(6)", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
updated_at = table.Column(type: "datetime(6)", rowVersion: true, nullable: false),
deleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false),
valid_question = table.Column(type: "tinyint(1)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_questions", x => x.id);
table.ForeignKey(
name: "FK_questions_AspNetUsers_created_by",
column: x => x.created_by,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "assignment_attachments",
columns: table => new
{
id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
assignment_id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
file_path = table.Column(type: "varchar(255)", maxLength: 255, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
file_name = table.Column(type: "varchar(255)", maxLength: 255, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
uploaded_at = table.Column(type: "datetime(6)", nullable: false),
deleted = table.Column(type: "tinyint(1)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_assignment_attachments", x => x.id);
table.ForeignKey(
name: "FK_assignment_attachments_assignments_assignment_id",
column: x => x.assignment_id,
principalTable: "assignments",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "assignment_group",
columns: table => new
{
id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
assignment = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
title = table.Column(type: "longtext", maxLength: 65535, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
descript = table.Column(type: "longtext", maxLength: 65535, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
total_points = table.Column(type: "float", nullable: true),
number = table.Column(type: "tinyint unsigned", nullable: false),
parent_group = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
deleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false),
valid_question_group = table.Column(type: "tinyint(1)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_assignment_group", x => x.id);
table.ForeignKey(
name: "FK_assignment_group_assignment_group_parent_group",
column: x => x.parent_group,
principalTable: "assignment_group",
principalColumn: "id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_assignment_group_assignments_assignment",
column: x => x.assignment,
principalTable: "assignments",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "submissions",
columns: table => new
{
id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
assignment_id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
student_id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
attempt_number = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
submission_time = table.Column(type: "datetime(6)", nullable: false),
overall_grade = table.Column(type: "float", precision: 5, scale: 2, nullable: true),
overall_feedback = table.Column(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
graded_by = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
graded_at = table.Column(type: "datetime(6)", nullable: true),
deleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false),
status = table.Column(type: "varchar(15)", maxLength: 15, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_submissions", x => x.id);
table.ForeignKey(
name: "FK_submissions_AspNetUsers_graded_by",
column: x => x.graded_by,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_submissions_AspNetUsers_student_id",
column: x => x.student_id,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_submissions_assignments_assignment_id",
column: x => x.assignment_id,
principalTable: "assignments",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "assignment_class",
columns: table => new
{
assignment_id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
class_id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
assigned_at = table.Column(type: "datetime(6)", nullable: false),
deleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false)
},
constraints: table =>
{
table.PrimaryKey("PK_assignment_class", x => new { x.assignment_id, x.class_id });
table.ForeignKey(
name: "FK_assignment_class_assignments_assignment_id",
column: x => x.assignment_id,
principalTable: "assignments",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_assignment_class_classes_class_id",
column: x => x.class_id,
principalTable: "classes",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "class_student",
columns: table => new
{
class_id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
student_id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
enrollment_date = table.Column(type: "datetime(6)", nullable: false),
deleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false)
},
constraints: table =>
{
table.PrimaryKey("PK_class_student", x => new { x.class_id, x.student_id });
table.ForeignKey(
name: "FK_class_student_AspNetUsers_student_id",
column: x => x.student_id,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_class_student_classes_class_id",
column: x => x.class_id,
principalTable: "classes",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "class_teachers",
columns: table => new
{
class_id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
teacher_id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
subject_taught = table.Column(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_class_teachers", x => new { x.class_id, x.teacher_id });
table.ForeignKey(
name: "FK_class_teachers_AspNetUsers_teacher_id",
column: x => x.teacher_id,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_class_teachers_classes_class_id",
column: x => x.class_id,
principalTable: "classes",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "assignment_questions",
columns: table => new
{
id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
question_id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
group_id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
question_number = table.Column(type: "tinyint unsigned", nullable: false),
created_at = table.Column(type: "datetime(6)", nullable: false),
score = table.Column(type: "float", nullable: true),
deleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false)
},
constraints: table =>
{
table.PrimaryKey("PK_assignment_questions", x => x.id);
table.ForeignKey(
name: "FK_assignment_questions_assignment_group_group_id",
column: x => x.group_id,
principalTable: "assignment_group",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_assignment_questions_questions_question_id",
column: x => x.question_id,
principalTable: "questions",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "submission_details",
columns: table => new
{
id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
submission_id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
student_id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
assignment_question_id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
student_answer = table.Column(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
is_correct = table.Column(type: "tinyint(1)", nullable: true),
points_awarded = table.Column(type: "float", precision: 5, scale: 2, nullable: true),
teacher_feedback = table.Column(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
created_at = table.Column(type: "datetime(6)", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
updated_at = table.Column(type: "datetime(6)", rowVersion: true, nullable: false),
deleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false)
},
constraints: table =>
{
table.PrimaryKey("PK_submission_details", x => x.id);
table.ForeignKey(
name: "FK_submission_details_AspNetUsers_student_id",
column: x => x.student_id,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_submission_details_assignment_questions_assignment_question_~",
column: x => x.assignment_question_id,
principalTable: "assignment_questions",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_submission_details_submissions_submission_id",
column: x => x.submission_id,
principalTable: "submissions",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "AspNetRoles",
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
values: new object[,]
{
{ new Guid("02a808ba-bd16-4f90-bf2b-0bc42f767e00"), null, "Administrator", "ADMINISTRATOR" },
{ new Guid("9e526681-e57e-46b5-a01c-5731b27bfc4a"), null, "Student", "STUDENT" },
{ new Guid("dfdfb884-4063-4161-84e0-9c225f4e883c"), null, "Teacher", "TEACHER" }
});
migrationBuilder.CreateIndex(
name: "IX_AspNetRoleClaims_RoleId",
table: "AspNetRoleClaims",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "RoleNameIndex",
table: "AspNetRoles",
column: "NormalizedName",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_AspNetUserClaims_UserId",
table: "AspNetUserClaims",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_AspNetUserLogins_UserId",
table: "AspNetUserLogins",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_AspNetUserRoles_RoleId",
table: "AspNetUserRoles",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "EmailIndex",
table: "AspNetUsers",
column: "NormalizedEmail");
migrationBuilder.CreateIndex(
name: "UserNameIndex",
table: "AspNetUsers",
column: "NormalizedUserName",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_assignment_attachments_assignment_id",
table: "assignment_attachments",
column: "assignment_id");
migrationBuilder.CreateIndex(
name: "IX_assignment_class_class_id",
table: "assignment_class",
column: "class_id");
migrationBuilder.CreateIndex(
name: "IX_assignment_group_assignment",
table: "assignment_group",
column: "assignment");
migrationBuilder.CreateIndex(
name: "IX_assignment_group_parent_group",
table: "assignment_group",
column: "parent_group");
migrationBuilder.CreateIndex(
name: "IX_assignment_questions_group_id",
table: "assignment_questions",
column: "group_id");
migrationBuilder.CreateIndex(
name: "IX_assignment_questions_question_id",
table: "assignment_questions",
column: "question_id");
migrationBuilder.CreateIndex(
name: "IX_assignments_created_by",
table: "assignments",
column: "created_by");
migrationBuilder.CreateIndex(
name: "IX_assignments_UserId",
table: "assignments",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_class_student_student_id",
table: "class_student",
column: "student_id");
migrationBuilder.CreateIndex(
name: "IX_class_teachers_teacher_id",
table: "class_teachers",
column: "teacher_id");
migrationBuilder.CreateIndex(
name: "IX_classes_head_teacher_id",
table: "classes",
column: "head_teacher_id");
migrationBuilder.CreateIndex(
name: "IX_questions_created_by",
table: "questions",
column: "created_by");
migrationBuilder.CreateIndex(
name: "IX_submission_details_assignment_question_id",
table: "submission_details",
column: "assignment_question_id");
migrationBuilder.CreateIndex(
name: "IX_submission_details_student_id",
table: "submission_details",
column: "student_id");
migrationBuilder.CreateIndex(
name: "IX_submission_details_submission_id",
table: "submission_details",
column: "submission_id");
migrationBuilder.CreateIndex(
name: "IX_submissions_assignment_id",
table: "submissions",
column: "assignment_id");
migrationBuilder.CreateIndex(
name: "IX_submissions_graded_by",
table: "submissions",
column: "graded_by");
migrationBuilder.CreateIndex(
name: "IX_submissions_student_id",
table: "submissions",
column: "student_id");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AspNetRoleClaims");
migrationBuilder.DropTable(
name: "AspNetUserClaims");
migrationBuilder.DropTable(
name: "AspNetUserLogins");
migrationBuilder.DropTable(
name: "AspNetUserRoles");
migrationBuilder.DropTable(
name: "AspNetUserTokens");
migrationBuilder.DropTable(
name: "assignment_attachments");
migrationBuilder.DropTable(
name: "assignment_class");
migrationBuilder.DropTable(
name: "class_student");
migrationBuilder.DropTable(
name: "class_teachers");
migrationBuilder.DropTable(
name: "submission_details");
migrationBuilder.DropTable(
name: "AspNetRoles");
migrationBuilder.DropTable(
name: "classes");
migrationBuilder.DropTable(
name: "assignment_questions");
migrationBuilder.DropTable(
name: "submissions");
migrationBuilder.DropTable(
name: "assignment_group");
migrationBuilder.DropTable(
name: "questions");
migrationBuilder.DropTable(
name: "assignments");
migrationBuilder.DropTable(
name: "AspNetUsers");
}
}
}