using System; using Microsoft.EntityFrameworkCore.Migrations; namespace RMuseum.Migrations { public partial class Bookmarks : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "UserBookmarks", columns: table => new { Id = table.Column(nullable: false), RAppUserId = table.Column(nullable: false), RArtifactMasterRecordId = table.Column(nullable: true), RArtifactItemRecordId = table.Column(nullable: true), DateTime = table.Column(nullable: false), RBookmarkType = table.Column(nullable: false), Note = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_UserBookmarks", x => x.Id); table.ForeignKey( name: "FK_UserBookmarks_AspNetUsers_RAppUserId", column: x => x.RAppUserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_UserBookmarks_Items_RArtifactItemRecordId", column: x => x.RArtifactItemRecordId, principalTable: "Items", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_UserBookmarks_Artifacts_RArtifactMasterRecordId", column: x => x.RArtifactMasterRecordId, principalTable: "Artifacts", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_UserBookmarks_RAppUserId", table: "UserBookmarks", column: "RAppUserId"); migrationBuilder.CreateIndex( name: "IX_UserBookmarks_RArtifactItemRecordId", table: "UserBookmarks", column: "RArtifactItemRecordId"); migrationBuilder.CreateIndex( name: "IX_UserBookmarks_RArtifactMasterRecordId", table: "UserBookmarks", column: "RArtifactMasterRecordId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "UserBookmarks"); } } }