using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace SVSim.Database.Migrations { /// public partial class AddViewerFreePackClaims : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "ViewerFreePackClaim", columns: table => new { FreeGachaCampaignId = table.Column(type: "integer", nullable: false), ViewerId = table.Column(type: "bigint", nullable: false), ClaimCount = table.Column(type: "integer", nullable: false), LastClaimedAt = table.Column(type: "timestamp with time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ViewerFreePackClaim", x => new { x.ViewerId, x.FreeGachaCampaignId }); table.ForeignKey( name: "FK_ViewerFreePackClaim_Viewers_ViewerId", column: x => x.ViewerId, principalTable: "Viewers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "ViewerFreePackClaim"); } } }