mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-20 10:40:29 +01:00
42 lines
1.4 KiB
C#
42 lines
1.4 KiB
C#
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
|
|||
|
namespace BTCPayServer.Migrations
|
|||
|
{
|
|||
|
public partial class AddressMapping : Migration
|
|||
|
{
|
|||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.CreateTable(
|
|||
|
name: "AddressInvoices",
|
|||
|
columns: table => new
|
|||
|
{
|
|||
|
Address = table.Column<string>(type: "TEXT", nullable: false),
|
|||
|
InvoiceDataId = table.Column<string>(type: "TEXT", nullable: true)
|
|||
|
},
|
|||
|
constraints: table =>
|
|||
|
{
|
|||
|
table.PrimaryKey("PK_AddressInvoices", x => x.Address);
|
|||
|
table.ForeignKey(
|
|||
|
name: "FK_AddressInvoices_Invoices_InvoiceDataId",
|
|||
|
column: x => x.InvoiceDataId,
|
|||
|
principalTable: "Invoices",
|
|||
|
principalColumn: "Id",
|
|||
|
onDelete: ReferentialAction.Restrict);
|
|||
|
});
|
|||
|
|
|||
|
migrationBuilder.CreateIndex(
|
|||
|
name: "IX_AddressInvoices_InvoiceDataId",
|
|||
|
table: "AddressInvoices",
|
|||
|
column: "InvoiceDataId");
|
|||
|
}
|
|||
|
|
|||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropTable(
|
|||
|
name: "AddressInvoices");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|