YD_SmartSports.Api/VOL.Core/Migrations/20260304021558_20260304v1.cs
2026-03-04 15:32:12 +08:00

82 lines
4.4 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace VOL.Core.Migrations
{
public partial class _20260304v1 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "YL_Device",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
SportStationId = table.Column<long>(type: "bigint", nullable: false),
Name = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
TenantName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
SerialNumber = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
AndroidId = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
IMEI = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
IMSI = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
IsCalibration = table.Column<int>(type: "int", nullable: false),
IsSynchronization = table.Column<int>(type: "int", nullable: false),
IsActive = table.Column<int>(type: "int", nullable: false),
IsOnline = table.Column<int>(type: "int", nullable: false),
LastOnlineTime = table.Column<DateTime>(type: "datetime2", nullable: true),
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
Remark = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_YL_Device", x => x.Id);
});
migrationBuilder.CreateTable(
name: "YL_Train",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
DeviceSerial = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
DeviceType = table.Column<int>(type: "int", nullable: false),
UserSerial = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
TrainSerial = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
VideoSerial = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
TrainExam = table.Column<int>(type: "int", nullable: false),
QuizId = table.Column<int>(type: "int", nullable: true),
StandardCounts = table.Column<int>(type: "int", nullable: false),
UnStandardCounts = table.Column<int>(type: "int", nullable: false),
TimeKeeping = table.Column<double>(type: "float", nullable: true),
Duration = table.Column<int>(type: "int", nullable: false),
Distance = table.Column<double>(type: "float", nullable: true),
CourseId = table.Column<int>(type: "int", nullable: false),
StartTime = table.Column<DateTime>(type: "datetime2", nullable: false),
EndTime = table.Column<DateTime>(type: "datetime2", nullable: false),
Score = table.Column<double>(type: "float", nullable: true),
IsValid = table.Column<int>(type: "int", nullable: false),
UploadTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_YL_Train", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "YL_Device");
migrationBuilder.DropTable(
name: "YL_Train");
}
}
}