Files
btcpayserver/BTCPayServer.Data/Migrations/20200528200358_AddNotificationEntity.cs
rockstardev 31e0bb43e8 Updating migration with our ef core voodoo magic
We're deleting partial designer classes and moving attributes to main class
2020-06-14 23:49:08 -05:00

49 lines
1.8 KiB
C#

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<string>(nullable: false),
Created = table.Column<DateTimeOffset>(nullable: false),
ApplicationUserId = table.Column<string>(nullable: true),
NotificationType = table.Column<string>(nullable: true),
Seen = table.Column<bool>(nullable: false),
Blob = table.Column<byte[]>(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");
}
}
}