using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Jiaowu.Api.Infrastructure.Persistence.Migrations.MySql
{
///
public partial class StudentStatusChanges : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "StudentStatusChanges",
columns: table => new
{
Id = table.Column(type: "char(36)", nullable: false),
StudentId = table.Column(type: "char(36)", nullable: false),
Type = table.Column(type: "int", nullable: false),
OriginalStatus = table.Column(type: "int", nullable: false),
TargetStatus = table.Column(type: "int", nullable: false),
Reason = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: false),
State = table.Column(type: "int", nullable: false),
ReviewComment = table.Column(type: "varchar(500)", maxLength: 500, nullable: true),
SubmittedAt = table.Column(type: "datetime(6)", nullable: false),
ReviewedAt = table.Column(type: "datetime(6)", nullable: true),
ApprovedAt = table.Column(type: "datetime(6)", nullable: true),
CreatedAt = table.Column(type: "datetime(6)", nullable: false),
UpdatedAt = table.Column(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_StudentStatusChanges", x => x.Id);
table.ForeignKey(
name: "FK_StudentStatusChanges_Students_StudentId",
column: x => x.StudentId,
principalTable: "Students",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
})
.Annotation("MySQL:Charset", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_StudentStatusChanges_StudentId_State",
table: "StudentStatusChanges",
columns: new[] { "StudentId", "State" });
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "StudentStatusChanges");
}
}
}