using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace song_of_the_day.DataMigrations { /// public partial class keeptrackofusersoickedforsubmission : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.RenameColumn( name: "Submitted", table: "SongSuggestions", newName: "UserHasSubmitted"); migrationBuilder.AddColumn( name: "WasChosenForSuggestionThisRound", table: "Users", type: "boolean", nullable: false, defaultValue: false); migrationBuilder.AddColumn( name: "HasUsedSuggestion", table: "SongSuggestions", type: "boolean", nullable: false, defaultValue: false); migrationBuilder.AddColumn( name: "SuggestionHelperId", table: "SongSuggestions", type: "integer", nullable: false, defaultValue: 0); migrationBuilder.CreateIndex( name: "IX_SongSuggestions_SuggestionHelperId", table: "SongSuggestions", column: "SuggestionHelperId"); migrationBuilder.AddForeignKey( name: "FK_SongSuggestions_SuggestionHelpers_SuggestionHelperId", table: "SongSuggestions", column: "SuggestionHelperId", principalTable: "SuggestionHelpers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_SongSuggestions_SuggestionHelpers_SuggestionHelperId", table: "SongSuggestions"); migrationBuilder.DropIndex( name: "IX_SongSuggestions_SuggestionHelperId", table: "SongSuggestions"); migrationBuilder.DropColumn( name: "WasChosenForSuggestionThisRound", table: "Users"); migrationBuilder.DropColumn( name: "HasUsedSuggestion", table: "SongSuggestions"); migrationBuilder.DropColumn( name: "SuggestionHelperId", table: "SongSuggestions"); migrationBuilder.RenameColumn( name: "UserHasSubmitted", table: "SongSuggestions", newName: "Submitted"); } } }