YD_SmartSports.Api/VOL.Core/Migrations/20260623055812_20260623v1.cs
2026-07-07 13:08:28 +08:00

126 lines
7.6 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace VOL.Core.Migrations
{
public partial class _20260623v1 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "XW_DeviceImage",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false, comment: "编号")
.Annotation("SqlServer:Identity", "1, 1"),
Path = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "图片地址路径"),
ImageUrl = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "图片OSS地址"),
DeviceNum = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "上传设备序列号"),
Timestamp = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "上传时间戳"),
StudentId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "学生ID"),
FileName = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "原始文件名"),
CreateTime = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "创建时间")
},
constraints: table =>
{
table.PrimaryKey("PK_XW_DeviceImage", x => x.Id);
});
migrationBuilder.CreateTable(
name: "XW_SunshinePoint",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false, comment: "编号")
.Annotation("SqlServer:Identity", "1, 1"),
ImageUrl = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "图片OSS地址"),
FileName = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "原始文件名"),
DeviceNum = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "上传设备序列号"),
Timestamp = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "上传时间戳"),
StudentNo = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "学号"),
PointName = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "点位名称"),
CameraIp = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "抓拍摄像机ip"),
EffectiveDistance = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "有效里程"),
SumDistance = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "总里程"),
CreateTime = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "创建时间")
},
constraints: table =>
{
table.PrimaryKey("PK_XW_SunshinePoint", x => x.Id);
});
migrationBuilder.CreateTable(
name: "XW_SunshineRunTrain",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false, comment: "编号")
.Annotation("SqlServer:Identity", "1, 1"),
OrgId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "学校id"),
GradeName = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "年级名称"),
GradeId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "年级ID"),
ClassName = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "班级名称"),
ClassId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "班级Id"),
StudentId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "学生ID"),
StudentName = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "学生名称"),
Sex = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "性别(1:男 2:女)"),
EffectiveDistance = table.Column<int>(type: "int", nullable: true, comment: "有效里程(米)"),
InvalidDistance = table.Column<int>(type: "int", nullable: true, comment: "无效里程(米)"),
Times = table.Column<int>(type: "int", nullable: true, comment: "用时(s)"),
InvalidTimes = table.Column<int>(type: "int", nullable: true, comment: "无效用时(s)"),
CreateTime = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "创建时间")
},
constraints: table =>
{
table.PrimaryKey("PK_XW_SunshineRunTrain", x => x.Id);
});
migrationBuilder.CreateTable(
name: "XW_SunshineRunTrainDetail",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false, comment: "编号")
.Annotation("SqlServer:Identity", "1, 1"),
SunshineRunTrainId = table.Column<int>(type: "int", nullable: false, comment: "阳光跑训练数据ID"),
Point = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "点位号"),
Distance = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "距离上一个点位距离"),
LapSpeed = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "速度 每ms/m"),
CameraName = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "摄像头名称"),
Trigger = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "抓拍时间"),
SnapPath = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "抓拍图片路径"),
ValidFlag = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "是否有效"),
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "备注")
},
constraints: table =>
{
table.PrimaryKey("PK_XW_SunshineRunTrainDetail", x => x.Id);
table.ForeignKey(
name: "FK_XW_SunshineRunTrainDetail_XW_SunshineRunTrain_SunshineRunTrainId",
column: x => x.SunshineRunTrainId,
principalTable: "XW_SunshineRunTrain",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_XW_SunshineRunTrainDetail_SunshineRunTrainId",
table: "XW_SunshineRunTrainDetail",
column: "SunshineRunTrainId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "XW_DeviceImage");
migrationBuilder.DropTable(
name: "XW_SunshinePoint");
migrationBuilder.DropTable(
name: "XW_SunshineRunTrainDetail");
migrationBuilder.DropTable(
name: "XW_SunshineRunTrain");
}
}
}