using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace VOL.Core.Migrations { public partial class _20250121v1 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "XW_CameraInfo"); migrationBuilder.AddColumn( name: "CameraInfo", table: "XW_Device", type: "nvarchar(max)", nullable: true, comment: "摄像头序列号、版本信息"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "CameraInfo", table: "XW_Device"); migrationBuilder.CreateTable( name: "XW_CameraInfo", columns: table => new { Id = table.Column(type: "int", nullable: false, comment: "编号") .Annotation("SqlServer:Identity", "1, 1"), XW_DeviceId = table.Column(type: "int", nullable: false), SerialNumber = table.Column(type: "nvarchar(max)", nullable: true, comment: "摄像头序列号"), Version = table.Column(type: "nvarchar(max)", nullable: true, comment: "摄像头版本信息") }, constraints: table => { table.PrimaryKey("PK_XW_CameraInfo", x => x.Id); table.ForeignKey( name: "FK_XW_CameraInfo_XW_Device_XW_DeviceId", column: x => x.XW_DeviceId, principalTable: "XW_Device", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_XW_CameraInfo_XW_DeviceId", table: "XW_CameraInfo", column: "XW_DeviceId"); } } }