using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace LANCommander.Migrations { /// public partial class AddGameCustomFields : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "GameCustomField", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), Name = table.Column(type: "TEXT", maxLength: 64, nullable: false), Value = table.Column(type: "TEXT", maxLength: 1024, nullable: false), GameId = table.Column(type: "TEXT", nullable: true), CreatedOn = table.Column(type: "TEXT", nullable: false), CreatedById = table.Column(type: "TEXT", nullable: true), UpdatedOn = table.Column(type: "TEXT", nullable: false), UpdatedById = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_GameCustomField", x => x.Id); table.ForeignKey( name: "FK_GameCustomField_Games_GameId", column: x => x.GameId, principalTable: "Games", principalColumn: "Id"); table.ForeignKey( name: "FK_GameCustomField_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id"); table.ForeignKey( name: "FK_GameCustomField_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id"); }); migrationBuilder.CreateIndex( name: "IX_GameCustomField_CreatedById", table: "GameCustomField", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_GameCustomField_GameId", table: "GameCustomField", column: "GameId"); migrationBuilder.CreateIndex( name: "IX_GameCustomField_UpdatedById", table: "GameCustomField", column: "UpdatedById"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "GameCustomField"); } } }