using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace SVSim.Database.Migrations { /// public partial class AddViewerBattleHistory : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "ViewerBattleHistories", columns: table => new { ViewerId = table.Column(type: "bigint", nullable: false), BattleId = table.Column(type: "bigint", nullable: false), BattleType = table.Column(type: "integer", nullable: false), DeckFormat = table.Column(type: "integer", nullable: false), TwoPickType = table.Column(type: "integer", nullable: false), IsLimitTurn = table.Column(type: "integer", nullable: false), SelfClassId = table.Column(type: "integer", nullable: false), SelfSubClassId = table.Column(type: "integer", nullable: false), SelfCharaId = table.Column(type: "integer", nullable: false), SelfRotationId = table.Column(type: "text", nullable: false), OpponentClassId = table.Column(type: "integer", nullable: false), OpponentSubClassId = table.Column(type: "integer", nullable: false), OpponentCharaId = table.Column(type: "integer", nullable: false), OpponentName = table.Column(type: "text", nullable: false), OpponentCountryCode = table.Column(type: "text", nullable: false), OpponentEmblemId = table.Column(type: "bigint", nullable: false), OpponentDegreeId = table.Column(type: "bigint", nullable: false), OpponentRotationId = table.Column(type: "text", nullable: false), IsWin = table.Column(type: "boolean", nullable: false), BattleStartTime = table.Column(type: "timestamp with time zone", nullable: false), CreateTime = table.Column(type: "timestamp with time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ViewerBattleHistories", x => new { x.ViewerId, x.BattleId }); }); migrationBuilder.CreateIndex( name: "IX_ViewerBattleHistories_ViewerId_CreateTime", table: "ViewerBattleHistories", columns: new[] { "ViewerId", "CreateTime" }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "ViewerBattleHistories"); } } }