Removed old support system

This commit is contained in:
Marcel Baumgartner
2023-04-21 16:38:06 +02:00
parent 2a0475bd17
commit 7f51bfd1db
11 changed files with 1099 additions and 528 deletions

View File

@@ -0,0 +1,67 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Moonlight.App.Database.Migrations
{
/// <inheritdoc />
public partial class RemovedOldSupportChatModel : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "SupportMessages");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "SupportMessages",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
RecipientId = table.Column<int>(type: "int", nullable: true),
SenderId = table.Column<int>(type: "int", nullable: true),
Answer = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
IsQuestion = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsSupport = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsSystem = table.Column<bool>(type: "tinyint(1)", nullable: false),
Message = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Type = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_SupportMessages", x => x.Id);
table.ForeignKey(
name: "FK_SupportMessages_Users_RecipientId",
column: x => x.RecipientId,
principalTable: "Users",
principalColumn: "Id");
table.ForeignKey(
name: "FK_SupportMessages_Users_SenderId",
column: x => x.SenderId,
principalTable: "Users",
principalColumn: "Id");
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_SupportMessages_RecipientId",
table: "SupportMessages",
column: "RecipientId");
migrationBuilder.CreateIndex(
name: "IX_SupportMessages_SenderId",
table: "SupportMessages",
column: "SenderId");
}
}
}