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(type: "int", nullable: false, comment: "编号") .Annotation("SqlServer:Identity", "1, 1"), Path = table.Column(type: "nvarchar(max)", nullable: true, comment: "图片地址路径"), ImageUrl = table.Column(type: "nvarchar(max)", nullable: true, comment: "图片OSS地址"), DeviceNum = table.Column(type: "nvarchar(max)", nullable: true, comment: "上传设备序列号"), Timestamp = table.Column(type: "nvarchar(max)", nullable: true, comment: "上传时间戳"), StudentId = table.Column(type: "nvarchar(max)", nullable: true, comment: "学生ID"), FileName = table.Column(type: "nvarchar(max)", nullable: true, comment: "原始文件名"), CreateTime = table.Column(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(type: "int", nullable: false, comment: "编号") .Annotation("SqlServer:Identity", "1, 1"), ImageUrl = table.Column(type: "nvarchar(max)", nullable: true, comment: "图片OSS地址"), FileName = table.Column(type: "nvarchar(max)", nullable: true, comment: "原始文件名"), DeviceNum = table.Column(type: "nvarchar(max)", nullable: true, comment: "上传设备序列号"), Timestamp = table.Column(type: "nvarchar(max)", nullable: true, comment: "上传时间戳"), StudentNo = table.Column(type: "nvarchar(max)", nullable: true, comment: "学号"), PointName = table.Column(type: "nvarchar(max)", nullable: true, comment: "点位名称"), CameraIp = table.Column(type: "nvarchar(max)", nullable: true, comment: "抓拍摄像机ip"), EffectiveDistance = table.Column(type: "nvarchar(max)", nullable: true, comment: "有效里程"), SumDistance = table.Column(type: "nvarchar(max)", nullable: true, comment: "总里程"), CreateTime = table.Column(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(type: "int", nullable: false, comment: "编号") .Annotation("SqlServer:Identity", "1, 1"), OrgId = table.Column(type: "nvarchar(max)", nullable: true, comment: "学校id"), GradeName = table.Column(type: "nvarchar(max)", nullable: true, comment: "年级名称"), GradeId = table.Column(type: "nvarchar(max)", nullable: true, comment: "年级ID"), ClassName = table.Column(type: "nvarchar(max)", nullable: true, comment: "班级名称"), ClassId = table.Column(type: "nvarchar(max)", nullable: true, comment: "班级Id"), StudentId = table.Column(type: "nvarchar(max)", nullable: true, comment: "学生ID"), StudentName = table.Column(type: "nvarchar(max)", nullable: true, comment: "学生名称"), Sex = table.Column(type: "nvarchar(max)", nullable: true, comment: "性别(1:男 2:女)"), EffectiveDistance = table.Column(type: "int", nullable: true, comment: "有效里程(米)"), InvalidDistance = table.Column(type: "int", nullable: true, comment: "无效里程(米)"), Times = table.Column(type: "int", nullable: true, comment: "用时(s)"), InvalidTimes = table.Column(type: "int", nullable: true, comment: "无效用时(s)"), CreateTime = table.Column(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(type: "int", nullable: false, comment: "编号") .Annotation("SqlServer:Identity", "1, 1"), SunshineRunTrainId = table.Column(type: "int", nullable: false, comment: "阳光跑训练数据ID"), Point = table.Column(type: "nvarchar(max)", nullable: true, comment: "点位号"), Distance = table.Column(type: "nvarchar(max)", nullable: true, comment: "距离上一个点位距离"), LapSpeed = table.Column(type: "nvarchar(max)", nullable: true, comment: "速度 每ms/m"), CameraName = table.Column(type: "nvarchar(max)", nullable: true, comment: "摄像头名称"), Trigger = table.Column(type: "nvarchar(max)", nullable: true, comment: "抓拍时间"), SnapPath = table.Column(type: "nvarchar(max)", nullable: true, comment: "抓拍图片路径"), ValidFlag = table.Column(type: "nvarchar(max)", nullable: true, comment: "是否有效"), Remark = table.Column(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"); } } }