mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-20 10:40:29 +01:00
49 lines
1.9 KiB
C#
49 lines
1.9 KiB
C#
|
using System;
|
|||
|
using BTCPayServer.Data;
|
|||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|||
|
namespace BTCPayServer.Migrations
|
|||
|
{
|
|||
|
[DbContext(typeof(ApplicationDbContext))]
|
|||
|
[Migration("20200614002524_AddNotificationDataEntity")]
|
|||
|
public partial class AddNotificationDataEntity : Migration
|
|||
|
{
|
|||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.CreateTable(
|
|||
|
name: "Notifications",
|
|||
|
columns: table => new
|
|||
|
{
|
|||
|
Id = table.Column<string>(maxLength: 36, nullable: false),
|
|||
|
Created = table.Column<DateTimeOffset>(nullable: false),
|
|||
|
ApplicationUserId = table.Column<string>(maxLength: 50, nullable: true),
|
|||
|
NotificationType = table.Column<string>(maxLength: 100, 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.Cascade);
|
|||
|
});
|
|||
|
|
|||
|
migrationBuilder.CreateIndex(
|
|||
|
name: "IX_Notifications_ApplicationUserId",
|
|||
|
table: "Notifications",
|
|||
|
column: "ApplicationUserId");
|
|||
|
}
|
|||
|
|
|||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropTable(
|
|||
|
name: "Notifications");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|