using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace OnlyPrompt.Backend.Migrations { /// public partial class PromptLikes : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "PromptLikes", columns: table => new { PromptId = table.Column(type: "uuid", nullable: false), UserId = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_PromptLikes", x => new { x.PromptId, x.UserId }); table.ForeignKey( name: "FK_PromptLikes_Prompts_PromptId", column: x => x.PromptId, principalTable: "Prompts", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_PromptLikes_Users_UserId", column: x => x.UserId, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_PromptLikes_UserId", table: "PromptLikes", column: "UserId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "PromptLikes"); } } }