using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable #pragma warning disable CA1814 // Prefer jagged arrays over multidimensional namespace StubbedContextLib.Migrations { /// public partial class pm_apiV2 : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropPrimaryKey( name: "PK_comments", table: "comments"); migrationBuilder.DeleteData( table: "comments", keyColumns: new[] { "IdQuote", "IdUser" }, keyValues: new object[] { 1, 2 }); migrationBuilder.DeleteData( table: "comments", keyColumns: new[] { "IdQuote", "IdUser" }, keyValues: new object[] { 1, 3 }); migrationBuilder.AddPrimaryKey( name: "PK_comments", table: "comments", column: "Id"); migrationBuilder.InsertData( table: "comments", columns: new[] { "Id", "Comment", "DateCommentary", "IdQuote", "IdUser" }, values: new object[,] { { 1, "Ce film est le meilleur", new DateTime(2025, 2, 3, 0, 0, 0, 0, DateTimeKind.Unspecified), 1, 2 }, { 2, "Very good", new DateTime(2025, 3, 11, 0, 0, 0, 0, DateTimeKind.Unspecified), 1, 3 } }); migrationBuilder.CreateIndex( name: "IX_comments_IdUser", table: "comments", column: "IdUser"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropPrimaryKey( name: "PK_comments", table: "comments"); migrationBuilder.DropIndex( name: "IX_comments_IdUser", table: "comments"); migrationBuilder.DeleteData( table: "comments", keyColumn: "Id", keyValue: 1); migrationBuilder.DeleteData( table: "comments", keyColumn: "Id", keyValue: 2); migrationBuilder.AddPrimaryKey( name: "PK_comments", table: "comments", columns: new[] { "IdUser", "IdQuote" }); migrationBuilder.InsertData( table: "comments", columns: new[] { "IdQuote", "IdUser", "Comment", "DateCommentary", "Id" }, values: new object[,] { { 1, 2, "Ce film est le meilleur", new DateTime(2025, 2, 3, 0, 0, 0, 0, DateTimeKind.Unspecified), 1 }, { 1, 3, "Very good", new DateTime(2025, 3, 11, 0, 0, 0, 0, DateTimeKind.Unspecified), 2 } }); } } }