YD_SmartSports.Api/VOL.Core/Migrations/20240416153518_init002.cs

196 lines
6.7 KiB
C#
Raw Permalink Normal View History

2025-06-06 16:00:39 +08:00
using Microsoft.EntityFrameworkCore.Migrations;
using System;
#nullable disable
namespace VOL.Core.Migrations
{
public partial class init002 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "SchoolNatureId",
table: "Sys_User");
migrationBuilder.AddColumn<string>(
name: "SchooCode",
table: "Sys_User",
type: "nvarchar(20)",
maxLength: 20,
nullable: true);
migrationBuilder.AlterColumn<string>(
name: "UserName",
table: "Sys_Log",
type: "text",
maxLength: 30000,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(30000)",
oldMaxLength: 30000,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Url",
table: "Sys_Log",
type: "text",
maxLength: 30000,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(30000)",
oldMaxLength: 30000,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ResponseParameter",
table: "Sys_Log",
type: "text",
maxLength: 10000,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(10000)",
oldMaxLength: 10000,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "RequestParameter",
table: "Sys_Log",
type: "text",
maxLength: 10000,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(10000)",
oldMaxLength: 10000,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ExceptionInfo",
table: "Sys_Log",
type: "text",
maxLength: 10000,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(10000)",
oldMaxLength: 10000,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "BrowserType",
table: "Sys_Log",
type: "varchar(200)",
maxLength: 200,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(200)",
oldMaxLength: 200,
oldNullable: true);
migrationBuilder.CreateTable(
name: "S_School",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false, comment: "Id")
.Annotation("SqlServer:Identity", "1, 1"),
SchoolCode = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "学校编号"),
SchoolName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "学校名称"),
DistrictCode = table.Column<string>(type: "nvarchar(20)", nullable: true, comment: "学校名称"),
Remarks = table.Column<string>(type: "text", nullable: true, comment: "备注"),
Creator = table.Column<int>(type: "int", nullable: false, comment: "创建人"), // 修改这行
CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
Modifier = table.Column<int>(type: "int", nullable: false, comment: "修改人"), // 修改这行
ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间")
},
constraints: table =>
{
table.PrimaryKey("PK_S_School", x => x.Id);
});
// 下面是额外的描述信息
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "S_School");
migrationBuilder.DropColumn(
name: "SchooCode",
table: "Sys_User");
migrationBuilder.AddColumn<int>(
name: "SchoolNatureId",
table: "Sys_User",
type: "int",
nullable: false,
defaultValue: 0,
comment: "学校类别Id");
migrationBuilder.AlterColumn<string>(
name: "UserName",
table: "Sys_Log",
type: "varchar(30000)",
maxLength: 30000,
nullable: true,
oldClrType: typeof(string),
oldType: "text",
oldMaxLength: 30000,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Url",
table: "Sys_Log",
type: "varchar(30000)",
maxLength: 30000,
nullable: true,
oldClrType: typeof(string),
oldType: "text",
oldMaxLength: 30000,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ResponseParameter",
table: "Sys_Log",
type: "nvarchar(10000)",
maxLength: 10000,
nullable: true,
oldClrType: typeof(string),
oldType: "text",
oldMaxLength: 10000,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "RequestParameter",
table: "Sys_Log",
type: "nvarchar(10000)",
maxLength: 10000,
nullable: true,
oldClrType: typeof(string),
oldType: "text",
oldMaxLength: 10000,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ExceptionInfo",
table: "Sys_Log",
type: "nvarchar(10000)",
maxLength: 10000,
nullable: true,
oldClrType: typeof(string),
oldType: "text",
oldMaxLength: 10000,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "BrowserType",
table: "Sys_Log",
type: "nvarchar(200)",
maxLength: 200,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(200)",
oldMaxLength: 200,
oldNullable: true);
}
}
}