using System; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; namespace ReallifeGamemode.Database.Migrations { public partial class ChatLogs : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "ChatLogs", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), UserId = table.Column(nullable: true), Text = table.Column(nullable: true), Time = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Discriminator = table.Column(nullable: false), FactionId = table.Column(nullable: true), GroupId = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_ChatLogs", x => x.Id); table.ForeignKey( name: "FK_ChatLogs_Users_UserId", column: x => x.UserId, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_ChatLogs_Factions_FactionId", column: x => x.FactionId, principalTable: "Factions", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_ChatLogs_Groups_GroupId", column: x => x.GroupId, principalTable: "Groups", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_ChatLogs_UserId", table: "ChatLogs", column: "UserId"); migrationBuilder.CreateIndex( name: "IX_ChatLogs_FactionId", table: "ChatLogs", column: "FactionId"); migrationBuilder.CreateIndex( name: "IX_ChatLogs_GroupId", table: "ChatLogs", column: "GroupId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "ChatLogs"); } } }