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