152 lines
7.3 KiB
C#
152 lines
7.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
namespace _2021_backend.Migrations
|
|
{
|
|
public partial class Initial : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "Comments",
|
|
columns: table => new
|
|
{
|
|
Guid = table.Column<Guid>(type: "uuid", nullable: false),
|
|
Operator = table.Column<Guid>(type: "uuid", nullable: false),
|
|
Content = table.Column<string>(type: "text", nullable: false),
|
|
AddTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
Student = table.Column<Guid>(type: "uuid", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Comments", x => x.Guid);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Sessions",
|
|
columns: table => new
|
|
{
|
|
Guid = table.Column<Guid>(type: "uuid", nullable: false),
|
|
Day = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
BeginTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
Place = table.Column<string>(type: "text", nullable: false),
|
|
Chiefs = table.Column<List<Guid>>(type: "uuid[]", nullable: true),
|
|
Capacity = table.Column<int>(type: "integer", nullable: false),
|
|
SendSMS = table.Column<bool>(type: "boolean", nullable: false),
|
|
Students = table.Column<List<Guid>>(type: "uuid[]", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Sessions", x => x.Guid);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "SMS",
|
|
columns: table => new
|
|
{
|
|
Guid = table.Column<Guid>(type: "uuid", nullable: false),
|
|
Host = table.Column<Guid>(type: "uuid", nullable: false),
|
|
Tel = table.Column<string>(type: "text", nullable: true),
|
|
Data = table.Column<List<string>>(type: "text[]", nullable: true),
|
|
Type = table.Column<int>(type: "integer", nullable: false),
|
|
Sender = table.Column<string>(type: "text", nullable: true),
|
|
SendTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_SMS", x => x.Guid);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Students",
|
|
columns: table => new
|
|
{
|
|
Guid = table.Column<Guid>(type: "uuid", nullable: false),
|
|
Name = table.Column<string>(type: "text", nullable: true),
|
|
Stuid = table.Column<string>(type: "text", nullable: true),
|
|
Sex = table.Column<int>(type: "integer", nullable: false),
|
|
Grade = table.Column<int>(type: "integer", nullable: false),
|
|
Yard = table.Column<int>(type: "integer", nullable: false),
|
|
Major = table.Column<string>(type: "text", nullable: true),
|
|
Email = table.Column<string>(type: "text", nullable: true),
|
|
Tel = table.Column<string>(type: "text", nullable: true),
|
|
Exp = table.Column<int>(type: "integer", nullable: false),
|
|
InterviewTime = table.Column<Guid>(type: "uuid", nullable: false),
|
|
Submissions = table.Column<List<Guid>>(type: "uuid[]", nullable: true),
|
|
Messages = table.Column<List<Guid>>(type: "uuid[]", nullable: true),
|
|
Timelist = table.Column<List<Guid>>(type: "uuid[]", nullable: true),
|
|
Comments = table.Column<List<Guid>>(type: "uuid[]", nullable: true),
|
|
Score = table.Column<int>(type: "integer", nullable: false),
|
|
Status = table.Column<int>(type: "integer", nullable: false),
|
|
LastSubmission = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
RegisterTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Students", x => x.Guid);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Submissions",
|
|
columns: table => new
|
|
{
|
|
Guid = table.Column<Guid>(type: "uuid", nullable: false),
|
|
Host = table.Column<Guid>(type: "uuid", nullable: false),
|
|
Name = table.Column<string>(type: "text", nullable: true),
|
|
Stuid = table.Column<string>(type: "text", nullable: true),
|
|
Sex = table.Column<int>(type: "integer", nullable: false),
|
|
Yard = table.Column<int>(type: "integer", nullable: false),
|
|
Grade = table.Column<int>(type: "integer", nullable: false),
|
|
Major = table.Column<string>(type: "text", nullable: true),
|
|
Email = table.Column<string>(type: "text", nullable: true),
|
|
Tel = table.Column<string>(type: "text", nullable: true),
|
|
Exp = table.Column<int>(type: "integer", nullable: false),
|
|
Timelist = table.Column<List<Guid>>(type: "uuid[]", nullable: true),
|
|
Address = table.Column<string>(type: "text", nullable: true),
|
|
SubmitTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Submissions", x => x.Guid);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Users",
|
|
columns: table => new
|
|
{
|
|
Guid = table.Column<Guid>(type: "uuid", nullable: false),
|
|
stuID = table.Column<string>(type: "text", nullable: true),
|
|
Name = table.Column<string>(type: "text", nullable: true),
|
|
Secret = table.Column<string>(type: "text", nullable: true),
|
|
isManager = table.Column<bool>(type: "boolean", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Users", x => x.Guid);
|
|
});
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "Comments");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Sessions");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "SMS");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Students");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Submissions");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Users");
|
|
}
|
|
}
|
|
}
|