Add migration for camera bug report system with related logs and screenshots
This commit is contained in:
11546
CompanyManagment.EFCore/Migrations/20251207125001_add camera bug report.Designer.cs
generated
Normal file
11546
CompanyManagment.EFCore/Migrations/20251207125001_add camera bug report.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,122 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addcamerabugreport : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CameraBugReports",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
UpdateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
StackTrace = table.Column<string>(type: "ntext", nullable: true),
|
||||
Status = table.Column<int>(type: "int", nullable: false),
|
||||
Priority = table.Column<int>(type: "int", nullable: false),
|
||||
Type = table.Column<int>(type: "int", nullable: false),
|
||||
Flavor = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
LastUpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
InstallTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
PackageName = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: true),
|
||||
BuildNumber = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
AppVersion = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
NetworkType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
IsCharging = table.Column<bool>(type: "bit", nullable: false),
|
||||
BatteryLevel = table.Column<int>(type: "int", nullable: false),
|
||||
StorageInMB = table.Column<int>(type: "int", nullable: false),
|
||||
MemoryInMB = table.Column<int>(type: "int", nullable: false),
|
||||
ScreenResolution = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
DeviceId = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
Manufacturer = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
Platform = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
OsVersion = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
DeviceModel = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
AccountId = table.Column<long>(type: "bigint", nullable: true),
|
||||
UserEmail = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: false),
|
||||
Description = table.Column<string>(type: "ntext", nullable: false),
|
||||
Title = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_CameraBugReports", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CameraBugReportLogs",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
CameraBugReportId = table.Column<long>(type: "bigint", nullable: false),
|
||||
Message = table.Column<string>(type: "ntext", nullable: false),
|
||||
Timestamp = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_CameraBugReportLogs", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_CameraBugReportLogs_CameraBugReports_CameraBugReportId",
|
||||
column: x => x.CameraBugReportId,
|
||||
principalTable: "CameraBugReports",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CameraBugReportScreenshots",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
CameraBugReportId = table.Column<long>(type: "bigint", nullable: false),
|
||||
Base64Data = table.Column<string>(type: "ntext", nullable: false),
|
||||
FileName = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
|
||||
UploadDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_CameraBugReportScreenshots", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_CameraBugReportScreenshots_CameraBugReports_CameraBugReportId",
|
||||
column: x => x.CameraBugReportId,
|
||||
principalTable: "CameraBugReports",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CameraBugReportLogs_CameraBugReportId",
|
||||
table: "CameraBugReportLogs",
|
||||
column: "CameraBugReportId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CameraBugReportScreenshots_CameraBugReportId",
|
||||
table: "CameraBugReportScreenshots",
|
||||
column: "CameraBugReportId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "CameraBugReportLogs");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "CameraBugReportScreenshots");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "CameraBugReports");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user