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( name: "WorkStatus", table: "WCA_ExerciseData", type: "int", nullable: true, comment: "状态", oldClrType: typeof(int), oldType: "int", oldComment: "状态"); migrationBuilder.AlterColumn( name: "StudentNo", table: "WCA_ExerciseData", type: "nvarchar(100)", nullable: true, comment: "学生学号", oldClrType: typeof(string), oldType: "nvarchar(100)", oldComment: "学生学号"); migrationBuilder.AlterColumn( name: "StudentName", table: "WCA_ExerciseData", type: "nvarchar(100)", nullable: true, comment: "学生名称", oldClrType: typeof(string), oldType: "nvarchar(100)", oldComment: "学生名称"); migrationBuilder.AlterColumn( name: "StartTime", table: "WCA_ExerciseData", type: "datetime", nullable: true, comment: "开始时间", oldClrType: typeof(DateTime), oldType: "datetime", oldComment: "开始时间"); migrationBuilder.AlterColumn( name: "Sex", table: "WCA_ExerciseData", type: "int", nullable: true, comment: "性别", oldClrType: typeof(int), oldType: "int", oldComment: "性别"); migrationBuilder.AlterColumn( name: "EndTime", table: "WCA_ExerciseData", type: "datetime", nullable: true, comment: "结束时间", oldClrType: typeof(DateTime), oldType: "datetime", oldComment: "结束时间"); migrationBuilder.AlterColumn( name: "Duration", table: "WCA_ExerciseData", type: "int", nullable: true, comment: "时长", oldClrType: typeof(int), oldType: "int", oldComment: "时长"); migrationBuilder.AlterColumn( name: "Calorie", table: "WCA_ExerciseData", type: "int", nullable: true, comment: "卡路里", oldClrType: typeof(int), oldType: "int", oldComment: "卡路里"); migrationBuilder.AlterColumn( name: "Amount", table: "WCA_ExerciseData", type: "int", nullable: true, comment: "数量", oldClrType: typeof(int), oldType: "int", oldComment: "数量"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.AlterColumn( name: "WorkStatus", table: "WCA_ExerciseData", type: "int", nullable: false, defaultValue: 0, comment: "状态", oldClrType: typeof(int), oldType: "int", oldNullable: true, oldComment: "状态"); migrationBuilder.AlterColumn( name: "StudentNo", table: "WCA_ExerciseData", type: "nvarchar(100)", nullable: false, defaultValue: "", comment: "学生学号", oldClrType: typeof(string), oldType: "nvarchar(100)", oldNullable: true, oldComment: "学生学号"); migrationBuilder.AlterColumn( name: "StudentName", table: "WCA_ExerciseData", type: "nvarchar(100)", nullable: false, defaultValue: "", comment: "学生名称", oldClrType: typeof(string), oldType: "nvarchar(100)", oldNullable: true, oldComment: "学生名称"); migrationBuilder.AlterColumn( 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( name: "Sex", table: "WCA_ExerciseData", type: "int", nullable: false, defaultValue: 0, comment: "性别", oldClrType: typeof(int), oldType: "int", oldNullable: true, oldComment: "性别"); migrationBuilder.AlterColumn( 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( name: "Duration", table: "WCA_ExerciseData", type: "int", nullable: false, defaultValue: 0, comment: "时长", oldClrType: typeof(int), oldType: "int", oldNullable: true, oldComment: "时长"); migrationBuilder.AlterColumn( name: "Calorie", table: "WCA_ExerciseData", type: "int", nullable: false, defaultValue: 0, comment: "卡路里", oldClrType: typeof(int), oldType: "int", oldNullable: true, oldComment: "卡路里"); migrationBuilder.AlterColumn( name: "Amount", table: "WCA_ExerciseData", type: "int", nullable: false, defaultValue: 0, comment: "数量", oldClrType: typeof(int), oldType: "int", oldNullable: true, oldComment: "数量"); migrationBuilder.AddColumn( name: "Photo", table: "WCA_ExerciseData", type: "nvarchar(2000)", nullable: false, defaultValue: "", comment: "学生照片"); } } }