This commit is contained in:
2021-10-19 06:29:11 +08:00
commit 60131e4608
131 changed files with 46479 additions and 0 deletions
+251
View File
@@ -0,0 +1,251 @@
// <auto-generated />
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using _2021_backend.Data;
namespace _2021_backend.Migrations
{
[DbContext(typeof(BackendContext))]
[Migration("20211018220015_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 63)
.HasAnnotation("ProductVersion", "5.0.9")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
modelBuilder.Entity("_2021_backend.Models.Comment", b =>
{
b.Property<Guid>("Guid")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTime>("AddTime")
.HasColumnType("timestamp without time zone");
b.Property<string>("Content")
.IsRequired()
.HasColumnType("text");
b.Property<Guid>("Operator")
.HasColumnType("uuid");
b.Property<Guid>("Student")
.HasColumnType("uuid");
b.HasKey("Guid");
b.ToTable("Comments");
});
modelBuilder.Entity("_2021_backend.Models.SMS", b =>
{
b.Property<Guid>("Guid")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<List<string>>("Data")
.HasColumnType("text[]");
b.Property<Guid>("Host")
.HasColumnType("uuid");
b.Property<DateTime>("SendTime")
.HasColumnType("timestamp without time zone");
b.Property<string>("Sender")
.HasColumnType("text");
b.Property<string>("Tel")
.HasColumnType("text");
b.Property<int>("Type")
.HasColumnType("integer");
b.HasKey("Guid");
b.ToTable("SMS");
});
modelBuilder.Entity("_2021_backend.Models.Session", b =>
{
b.Property<Guid>("Guid")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTime>("BeginTime")
.HasColumnType("timestamp without time zone");
b.Property<int>("Capacity")
.HasColumnType("integer");
b.Property<List<Guid>>("Chiefs")
.HasColumnType("uuid[]");
b.Property<DateTime>("Day")
.HasColumnType("timestamp without time zone");
b.Property<string>("Place")
.IsRequired()
.HasColumnType("text");
b.Property<bool>("SendSMS")
.HasColumnType("boolean");
b.Property<List<Guid>>("Students")
.HasColumnType("uuid[]");
b.HasKey("Guid");
b.ToTable("Sessions");
});
modelBuilder.Entity("_2021_backend.Models.Student", b =>
{
b.Property<Guid>("Guid")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<List<Guid>>("Comments")
.HasColumnType("uuid[]");
b.Property<string>("Email")
.HasColumnType("text");
b.Property<int>("Exp")
.HasColumnType("integer");
b.Property<int>("Grade")
.HasColumnType("integer");
b.Property<Guid>("InterviewTime")
.HasColumnType("uuid");
b.Property<DateTime>("LastSubmission")
.HasColumnType("timestamp without time zone");
b.Property<string>("Major")
.HasColumnType("text");
b.Property<List<Guid>>("Messages")
.HasColumnType("uuid[]");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<DateTime>("RegisterTime")
.HasColumnType("timestamp without time zone");
b.Property<int>("Score")
.HasColumnType("integer");
b.Property<int>("Sex")
.HasColumnType("integer");
b.Property<int>("Status")
.HasColumnType("integer");
b.Property<string>("Stuid")
.HasColumnType("text");
b.Property<List<Guid>>("Submissions")
.HasColumnType("uuid[]");
b.Property<string>("Tel")
.HasColumnType("text");
b.Property<List<Guid>>("Timelist")
.HasColumnType("uuid[]");
b.Property<int>("Yard")
.HasColumnType("integer");
b.HasKey("Guid");
b.ToTable("Students");
});
modelBuilder.Entity("_2021_backend.Models.Submission", b =>
{
b.Property<Guid>("Guid")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Address")
.HasColumnType("text");
b.Property<string>("Email")
.HasColumnType("text");
b.Property<int>("Exp")
.HasColumnType("integer");
b.Property<int>("Grade")
.HasColumnType("integer");
b.Property<Guid>("Host")
.HasColumnType("uuid");
b.Property<string>("Major")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<int>("Sex")
.HasColumnType("integer");
b.Property<string>("Stuid")
.HasColumnType("text");
b.Property<DateTime>("SubmitTime")
.HasColumnType("timestamp without time zone");
b.Property<string>("Tel")
.HasColumnType("text");
b.Property<List<Guid>>("Timelist")
.HasColumnType("uuid[]");
b.Property<int>("Yard")
.HasColumnType("integer");
b.HasKey("Guid");
b.ToTable("Submissions");
});
modelBuilder.Entity("_2021_backend.Models.User", b =>
{
b.Property<Guid>("Guid")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("Secret")
.HasColumnType("text");
b.Property<bool>("isManager")
.HasColumnType("boolean");
b.Property<string>("stuID")
.HasColumnType("text");
b.HasKey("Guid");
b.ToTable("Users");
});
#pragma warning restore 612, 618
}
}
}
+151
View File
@@ -0,0 +1,151 @@
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");
}
}
}
+249
View File
@@ -0,0 +1,249 @@
// <auto-generated />
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using _2021_backend.Data;
namespace _2021_backend.Migrations
{
[DbContext(typeof(BackendContext))]
partial class BackendContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 63)
.HasAnnotation("ProductVersion", "5.0.9")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
modelBuilder.Entity("_2021_backend.Models.Comment", b =>
{
b.Property<Guid>("Guid")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTime>("AddTime")
.HasColumnType("timestamp without time zone");
b.Property<string>("Content")
.IsRequired()
.HasColumnType("text");
b.Property<Guid>("Operator")
.HasColumnType("uuid");
b.Property<Guid>("Student")
.HasColumnType("uuid");
b.HasKey("Guid");
b.ToTable("Comments");
});
modelBuilder.Entity("_2021_backend.Models.SMS", b =>
{
b.Property<Guid>("Guid")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<List<string>>("Data")
.HasColumnType("text[]");
b.Property<Guid>("Host")
.HasColumnType("uuid");
b.Property<DateTime>("SendTime")
.HasColumnType("timestamp without time zone");
b.Property<string>("Sender")
.HasColumnType("text");
b.Property<string>("Tel")
.HasColumnType("text");
b.Property<int>("Type")
.HasColumnType("integer");
b.HasKey("Guid");
b.ToTable("SMS");
});
modelBuilder.Entity("_2021_backend.Models.Session", b =>
{
b.Property<Guid>("Guid")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTime>("BeginTime")
.HasColumnType("timestamp without time zone");
b.Property<int>("Capacity")
.HasColumnType("integer");
b.Property<List<Guid>>("Chiefs")
.HasColumnType("uuid[]");
b.Property<DateTime>("Day")
.HasColumnType("timestamp without time zone");
b.Property<string>("Place")
.IsRequired()
.HasColumnType("text");
b.Property<bool>("SendSMS")
.HasColumnType("boolean");
b.Property<List<Guid>>("Students")
.HasColumnType("uuid[]");
b.HasKey("Guid");
b.ToTable("Sessions");
});
modelBuilder.Entity("_2021_backend.Models.Student", b =>
{
b.Property<Guid>("Guid")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<List<Guid>>("Comments")
.HasColumnType("uuid[]");
b.Property<string>("Email")
.HasColumnType("text");
b.Property<int>("Exp")
.HasColumnType("integer");
b.Property<int>("Grade")
.HasColumnType("integer");
b.Property<Guid>("InterviewTime")
.HasColumnType("uuid");
b.Property<DateTime>("LastSubmission")
.HasColumnType("timestamp without time zone");
b.Property<string>("Major")
.HasColumnType("text");
b.Property<List<Guid>>("Messages")
.HasColumnType("uuid[]");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<DateTime>("RegisterTime")
.HasColumnType("timestamp without time zone");
b.Property<int>("Score")
.HasColumnType("integer");
b.Property<int>("Sex")
.HasColumnType("integer");
b.Property<int>("Status")
.HasColumnType("integer");
b.Property<string>("Stuid")
.HasColumnType("text");
b.Property<List<Guid>>("Submissions")
.HasColumnType("uuid[]");
b.Property<string>("Tel")
.HasColumnType("text");
b.Property<List<Guid>>("Timelist")
.HasColumnType("uuid[]");
b.Property<int>("Yard")
.HasColumnType("integer");
b.HasKey("Guid");
b.ToTable("Students");
});
modelBuilder.Entity("_2021_backend.Models.Submission", b =>
{
b.Property<Guid>("Guid")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Address")
.HasColumnType("text");
b.Property<string>("Email")
.HasColumnType("text");
b.Property<int>("Exp")
.HasColumnType("integer");
b.Property<int>("Grade")
.HasColumnType("integer");
b.Property<Guid>("Host")
.HasColumnType("uuid");
b.Property<string>("Major")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<int>("Sex")
.HasColumnType("integer");
b.Property<string>("Stuid")
.HasColumnType("text");
b.Property<DateTime>("SubmitTime")
.HasColumnType("timestamp without time zone");
b.Property<string>("Tel")
.HasColumnType("text");
b.Property<List<Guid>>("Timelist")
.HasColumnType("uuid[]");
b.Property<int>("Yard")
.HasColumnType("integer");
b.HasKey("Guid");
b.ToTable("Submissions");
});
modelBuilder.Entity("_2021_backend.Models.User", b =>
{
b.Property<Guid>("Guid")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("Secret")
.HasColumnType("text");
b.Property<bool>("isManager")
.HasColumnType("boolean");
b.Property<string>("stuID")
.HasColumnType("text");
b.HasKey("Guid");
b.ToTable("Users");
});
#pragma warning restore 612, 618
}
}
}