using System; using BTCPayServer.Data; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; namespace BTCPayServer.Migrations { [DbContext(typeof(ApplicationDbContext))] [Migration("20200528200358_AddNotificationEntity")] public class AddNotificationEntity : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Notifications", columns: table => new { Id = table.Column(nullable: false), Created = table.Column(nullable: false), ApplicationUserId = table.Column(nullable: true), NotificationType = table.Column(nullable: true), Seen = table.Column(nullable: false), Blob = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_Notifications", x => x.Id); table.ForeignKey( name: "FK_Notifications_AspNetUsers_ApplicationUserId", column: x => x.ApplicationUserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_Notifications_ApplicationUserId", table: "Notifications", column: "ApplicationUserId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Notifications"); } } }