backend/ExamKing.Database.Migrations/Migrations/20201201170344_v1.0.0.cs

(开头部分) 39KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

namespace ExamKing.Database.Migrations.Migrations
{
    public partial class v100 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "tb_admin",
                columns: table => new
                {
                    id = table.Column<int>(type: "int", nullable: false, comment: "ID")
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    username = table.Column<string>(type: "varchar(30)", nullable: false, comment: "账号", collation: "utf8mb4_unicode_ci")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    password = table.Column<string>(type: "varchar(50)", nullable: true, comment: "密码", collation: "utf8mb4_unicode_ci")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    createTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: false, comment: "创建时间")
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_tb_admin", x => x.id);
                },
                comment: "管理员表");

            migrationBuilder.CreateTable(
                name: "tb_dept",
                columns: table => new
                {
                    id = table.Column<int>(type: "int", nullable: false, comment: "ID")
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    deptName = table.Column<string>(type: "varchar(50)", nullable: false, comment: "系别名称", collation: "utf8_general_ci")
                        .Annotation("MySql:CharSet", "utf8"),
                    createTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: false, comment: "创建时间")
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_tb_dept", x => x.id);
                },
                comment: "系别表");

            migrationBuilder.CreateTable(
                name: "tb_classes",
                columns: table => new
                {
                    id = table.Column<int>(type: "int", nullable: false, comment: "ID")
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    classesName = table.Column<string>(type: "varchar(50)", nullable: false, comment: "班级名称", collation: "utf8_general_ci")
                        .Annotation("MySql:CharSet", "utf8"),
                    DeptId = table.Column<int>(type: "int", nullable: false, comment: "系别ID"),
                    createTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: false, comment: "创建时间")
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
                },
                constraints: table =>
                {
后面还有 740 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。