227 lines
7.6 KiB
C#
227 lines
7.6 KiB
C#
![]() |
using System;
|
|||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|||
|
#nullable disable
|
|||
|
|
|||
|
namespace YD_WeChatApplet.Api.Migrations
|
|||
|
{
|
|||
|
public partial class _20250310v2 : Migration
|
|||
|
{
|
|||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropColumn(
|
|||
|
name: "Photo",
|
|||
|
table: "WCA_ExerciseData");
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<int>(
|
|||
|
name: "WorkStatus",
|
|||
|
table: "WCA_ExerciseData",
|
|||
|
type: "int",
|
|||
|
nullable: true,
|
|||
|
comment: "状态",
|
|||
|
oldClrType: typeof(int),
|
|||
|
oldType: "int",
|
|||
|
oldComment: "状态");
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<string>(
|
|||
|
name: "StudentNo",
|
|||
|
table: "WCA_ExerciseData",
|
|||
|
type: "nvarchar(100)",
|
|||
|
nullable: true,
|
|||
|
comment: "学生学号",
|
|||
|
oldClrType: typeof(string),
|
|||
|
oldType: "nvarchar(100)",
|
|||
|
oldComment: "学生学号");
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<string>(
|
|||
|
name: "StudentName",
|
|||
|
table: "WCA_ExerciseData",
|
|||
|
type: "nvarchar(100)",
|
|||
|
nullable: true,
|
|||
|
comment: "学生名称",
|
|||
|
oldClrType: typeof(string),
|
|||
|
oldType: "nvarchar(100)",
|
|||
|
oldComment: "学生名称");
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<DateTime>(
|
|||
|
name: "StartTime",
|
|||
|
table: "WCA_ExerciseData",
|
|||
|
type: "datetime",
|
|||
|
nullable: true,
|
|||
|
comment: "开始时间",
|
|||
|
oldClrType: typeof(DateTime),
|
|||
|
oldType: "datetime",
|
|||
|
oldComment: "开始时间");
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<int>(
|
|||
|
name: "Sex",
|
|||
|
table: "WCA_ExerciseData",
|
|||
|
type: "int",
|
|||
|
nullable: true,
|
|||
|
comment: "性别",
|
|||
|
oldClrType: typeof(int),
|
|||
|
oldType: "int",
|
|||
|
oldComment: "性别");
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<DateTime>(
|
|||
|
name: "EndTime",
|
|||
|
table: "WCA_ExerciseData",
|
|||
|
type: "datetime",
|
|||
|
nullable: true,
|
|||
|
comment: "结束时间",
|
|||
|
oldClrType: typeof(DateTime),
|
|||
|
oldType: "datetime",
|
|||
|
oldComment: "结束时间");
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<int>(
|
|||
|
name: "Duration",
|
|||
|
table: "WCA_ExerciseData",
|
|||
|
type: "int",
|
|||
|
nullable: true,
|
|||
|
comment: "时长",
|
|||
|
oldClrType: typeof(int),
|
|||
|
oldType: "int",
|
|||
|
oldComment: "时长");
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<int>(
|
|||
|
name: "Calorie",
|
|||
|
table: "WCA_ExerciseData",
|
|||
|
type: "int",
|
|||
|
nullable: true,
|
|||
|
comment: "卡路里",
|
|||
|
oldClrType: typeof(int),
|
|||
|
oldType: "int",
|
|||
|
oldComment: "卡路里");
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<int>(
|
|||
|
name: "Amount",
|
|||
|
table: "WCA_ExerciseData",
|
|||
|
type: "int",
|
|||
|
nullable: true,
|
|||
|
comment: "数量",
|
|||
|
oldClrType: typeof(int),
|
|||
|
oldType: "int",
|
|||
|
oldComment: "数量");
|
|||
|
}
|
|||
|
|
|||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.AlterColumn<int>(
|
|||
|
name: "WorkStatus",
|
|||
|
table: "WCA_ExerciseData",
|
|||
|
type: "int",
|
|||
|
nullable: false,
|
|||
|
defaultValue: 0,
|
|||
|
comment: "状态",
|
|||
|
oldClrType: typeof(int),
|
|||
|
oldType: "int",
|
|||
|
oldNullable: true,
|
|||
|
oldComment: "状态");
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<string>(
|
|||
|
name: "StudentNo",
|
|||
|
table: "WCA_ExerciseData",
|
|||
|
type: "nvarchar(100)",
|
|||
|
nullable: false,
|
|||
|
defaultValue: "",
|
|||
|
comment: "学生学号",
|
|||
|
oldClrType: typeof(string),
|
|||
|
oldType: "nvarchar(100)",
|
|||
|
oldNullable: true,
|
|||
|
oldComment: "学生学号");
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<string>(
|
|||
|
name: "StudentName",
|
|||
|
table: "WCA_ExerciseData",
|
|||
|
type: "nvarchar(100)",
|
|||
|
nullable: false,
|
|||
|
defaultValue: "",
|
|||
|
comment: "学生名称",
|
|||
|
oldClrType: typeof(string),
|
|||
|
oldType: "nvarchar(100)",
|
|||
|
oldNullable: true,
|
|||
|
oldComment: "学生名称");
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<DateTime>(
|
|||
|
name: "StartTime",
|
|||
|
table: "WCA_ExerciseData",
|
|||
|
type: "datetime",
|
|||
|
nullable: false,
|
|||
|
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
|||
|
comment: "开始时间",
|
|||
|
oldClrType: typeof(DateTime),
|
|||
|
oldType: "datetime",
|
|||
|
oldNullable: true,
|
|||
|
oldComment: "开始时间");
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<int>(
|
|||
|
name: "Sex",
|
|||
|
table: "WCA_ExerciseData",
|
|||
|
type: "int",
|
|||
|
nullable: false,
|
|||
|
defaultValue: 0,
|
|||
|
comment: "性别",
|
|||
|
oldClrType: typeof(int),
|
|||
|
oldType: "int",
|
|||
|
oldNullable: true,
|
|||
|
oldComment: "性别");
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<DateTime>(
|
|||
|
name: "EndTime",
|
|||
|
table: "WCA_ExerciseData",
|
|||
|
type: "datetime",
|
|||
|
nullable: false,
|
|||
|
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
|||
|
comment: "结束时间",
|
|||
|
oldClrType: typeof(DateTime),
|
|||
|
oldType: "datetime",
|
|||
|
oldNullable: true,
|
|||
|
oldComment: "结束时间");
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<int>(
|
|||
|
name: "Duration",
|
|||
|
table: "WCA_ExerciseData",
|
|||
|
type: "int",
|
|||
|
nullable: false,
|
|||
|
defaultValue: 0,
|
|||
|
comment: "时长",
|
|||
|
oldClrType: typeof(int),
|
|||
|
oldType: "int",
|
|||
|
oldNullable: true,
|
|||
|
oldComment: "时长");
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<int>(
|
|||
|
name: "Calorie",
|
|||
|
table: "WCA_ExerciseData",
|
|||
|
type: "int",
|
|||
|
nullable: false,
|
|||
|
defaultValue: 0,
|
|||
|
comment: "卡路里",
|
|||
|
oldClrType: typeof(int),
|
|||
|
oldType: "int",
|
|||
|
oldNullable: true,
|
|||
|
oldComment: "卡路里");
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<int>(
|
|||
|
name: "Amount",
|
|||
|
table: "WCA_ExerciseData",
|
|||
|
type: "int",
|
|||
|
nullable: false,
|
|||
|
defaultValue: 0,
|
|||
|
comment: "数量",
|
|||
|
oldClrType: typeof(int),
|
|||
|
oldType: "int",
|
|||
|
oldNullable: true,
|
|||
|
oldComment: "数量");
|
|||
|
|
|||
|
migrationBuilder.AddColumn<string>(
|
|||
|
name: "Photo",
|
|||
|
table: "WCA_ExerciseData",
|
|||
|
type: "nvarchar(2000)",
|
|||
|
nullable: false,
|
|||
|
defaultValue: "",
|
|||
|
comment: "学生照片");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|