using System; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Moonlight.App.Database.Migrations { /// public partial class RemovedOldSupportChatModel : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "SupportMessages"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "SupportMessages", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), RecipientId = table.Column(type: "int", nullable: true), SenderId = table.Column(type: "int", nullable: true), Answer = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), CreatedAt = table.Column(type: "datetime(6)", nullable: false), IsQuestion = table.Column(type: "tinyint(1)", nullable: false), IsSupport = table.Column(type: "tinyint(1)", nullable: false), IsSystem = table.Column(type: "tinyint(1)", nullable: false), Message = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Type = table.Column(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"); } } }