mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-23 14:40:36 +01:00
44 lines
1.5 KiB
C#
44 lines
1.5 KiB
C#
|
using System;
|
|||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|||
|
namespace BTCPayServer.Migrations
|
|||
|
{
|
|||
|
public partial class AddFiles : Migration
|
|||
|
{
|
|||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.CreateTable(
|
|||
|
name: "Files",
|
|||
|
columns: table => new
|
|||
|
{
|
|||
|
Id = table.Column<string>(nullable: false),
|
|||
|
FileName = table.Column<string>(nullable: true),
|
|||
|
StorageFileName = table.Column<string>(nullable: true),
|
|||
|
Timestamp = table.Column<DateTime>(nullable: false),
|
|||
|
ApplicationUserId = table.Column<string>(nullable: true)
|
|||
|
},
|
|||
|
constraints: table =>
|
|||
|
{
|
|||
|
table.PrimaryKey("PK_Files", x => x.Id);
|
|||
|
table.ForeignKey(
|
|||
|
name: "FK_Files_AspNetUsers_ApplicationUserId",
|
|||
|
column: x => x.ApplicationUserId,
|
|||
|
principalTable: "AspNetUsers",
|
|||
|
principalColumn: "Id",
|
|||
|
onDelete: ReferentialAction.Restrict);
|
|||
|
});
|
|||
|
|
|||
|
migrationBuilder.CreateIndex(
|
|||
|
name: "IX_Files_ApplicationUserId",
|
|||
|
table: "Files",
|
|||
|
column: "ApplicationUserId");
|
|||
|
}
|
|||
|
|
|||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropTable(
|
|||
|
name: "Files");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|