85 lines
3.4 KiB
C#
85 lines
3.4 KiB
C#
![]() |
using System;
|
|||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|||
|
#nullable disable
|
|||
|
|
|||
|
namespace YD_WeChatApplet.Api.Migrations
|
|||
|
{
|
|||
|
public partial class _20250420v5 : Migration
|
|||
|
{
|
|||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.AlterColumn<int>(
|
|||
|
name: "GoalDuration",
|
|||
|
table: "WCA_PersonalGoal",
|
|||
|
type: "int",
|
|||
|
nullable: false,
|
|||
|
defaultValue: 0,
|
|||
|
comment: "目标时长",
|
|||
|
oldClrType: typeof(int),
|
|||
|
oldType: "int",
|
|||
|
oldNullable: true,
|
|||
|
oldComment: "目标时长");
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<int>(
|
|||
|
name: "GoalAmount",
|
|||
|
table: "WCA_PersonalGoal",
|
|||
|
type: "int",
|
|||
|
nullable: false,
|
|||
|
defaultValue: 0,
|
|||
|
comment: "目标数量",
|
|||
|
oldClrType: typeof(int),
|
|||
|
oldType: "int",
|
|||
|
oldNullable: true,
|
|||
|
oldComment: "目标数量");
|
|||
|
|
|||
|
migrationBuilder.CreateTable(
|
|||
|
name: "WCA_PersonalGoalResult",
|
|||
|
columns: table => new
|
|||
|
{
|
|||
|
Id = table.Column<int>(type: "int", nullable: false, comment: "Id")
|
|||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|||
|
PersonalGoalName = table.Column<string>(type: "nvarchar(200)", nullable: false, comment: "名称"),
|
|||
|
UserId = table.Column<int>(type: "int", nullable: false, comment: "用户Id"),
|
|||
|
HeadImageUrl = table.Column<string>(type: "nvarchar(500)", nullable: true, comment: "头像"),
|
|||
|
WorkModeType = table.Column<int>(type: "int", nullable: false, comment: "作业类型"),
|
|||
|
WorkModeTypeName = table.Column<string>(type: "nvarchar(200)", nullable: false, comment: "模式类型名称"),
|
|||
|
Duration = table.Column<int>(type: "int", nullable: false, comment: "作业时长"),
|
|||
|
Amount = table.Column<int>(type: "int", nullable: false, comment: "作业数量"),
|
|||
|
CreateTime = table.Column<DateTime>(type: "datetime", nullable: false, comment: "创建时间"),
|
|||
|
PersonalGoalId = table.Column<int>(type: "int", nullable: false)
|
|||
|
},
|
|||
|
constraints: table =>
|
|||
|
{
|
|||
|
table.PrimaryKey("PK_WCA_PersonalGoalResult", x => x.Id);
|
|||
|
});
|
|||
|
}
|
|||
|
|
|||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropTable(
|
|||
|
name: "WCA_PersonalGoalResult");
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<int>(
|
|||
|
name: "GoalDuration",
|
|||
|
table: "WCA_PersonalGoal",
|
|||
|
type: "int",
|
|||
|
nullable: true,
|
|||
|
comment: "目标时长",
|
|||
|
oldClrType: typeof(int),
|
|||
|
oldType: "int",
|
|||
|
oldComment: "目标时长");
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<int>(
|
|||
|
name: "GoalAmount",
|
|||
|
table: "WCA_PersonalGoal",
|
|||
|
type: "int",
|
|||
|
nullable: true,
|
|||
|
comment: "目标数量",
|
|||
|
oldClrType: typeof(int),
|
|||
|
oldType: "int",
|
|||
|
oldComment: "目标数量");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|