using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace RMuseum.Migrations { public partial class ReportedUserNotes : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "ReportedUserNotes", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), NoteId = table.Column(type: "uniqueidentifier", nullable: false), ReasonText = table.Column(type: "nvarchar(max)", nullable: true), ReporterId = table.Column(type: "uniqueidentifier", nullable: true) }, constraints: table => { table.PrimaryKey("PK_ReportedUserNotes", x => x.Id); table.ForeignKey( name: "FK_ReportedUserNotes_AspNetUsers_ReporterId", column: x => x.ReporterId, principalTable: "AspNetUsers", principalColumn: "Id"); table.ForeignKey( name: "FK_ReportedUserNotes_UserNotes_NoteId", column: x => x.NoteId, principalTable: "UserNotes", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_ReportedUserNotes_NoteId", table: "ReportedUserNotes", column: "NoteId"); migrationBuilder.CreateIndex( name: "IX_ReportedUserNotes_ReporterId", table: "ReportedUserNotes", column: "ReporterId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "ReportedUserNotes"); } } }