using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace OnlyPrompt.Backend.Migrations { /// public partial class ReviewManyToMany : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropPrimaryKey( name: "PK_Reviews", table: "Reviews"); migrationBuilder.DropIndex( name: "IX_Reviews_ReviewerId_PromptId", table: "Reviews"); migrationBuilder.DropColumn( name: "Id", table: "Reviews"); migrationBuilder.DropColumn( name: "Content", table: "Prompts"); migrationBuilder.AddColumn( name: "Description", table: "Prompts", type: "character varying(1000)", maxLength: 1000, nullable: false, defaultValue: ""); migrationBuilder.AddColumn( name: "Prompt", table: "Prompts", type: "character varying(4000)", maxLength: 4000, nullable: false, defaultValue: ""); migrationBuilder.AddPrimaryKey( name: "PK_Reviews", table: "Reviews", columns: new[] { "ReviewerId", "PromptId" }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropPrimaryKey( name: "PK_Reviews", table: "Reviews"); migrationBuilder.DropColumn( name: "Description", table: "Prompts"); migrationBuilder.DropColumn( name: "Prompt", table: "Prompts"); migrationBuilder.AddColumn( name: "Id", table: "Reviews", type: "uuid", nullable: false, defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); migrationBuilder.AddColumn( name: "Content", table: "Prompts", type: "text", nullable: false, defaultValue: ""); migrationBuilder.AddPrimaryKey( name: "PK_Reviews", table: "Reviews", column: "Id"); migrationBuilder.CreateIndex( name: "IX_Reviews_ReviewerId_PromptId", table: "Reviews", columns: new[] { "ReviewerId", "PromptId" }, unique: true); } } }