Files
btcpayserver/BTCPayServer.Data/Migrations/20250415235643_AddingReferenceIdToPaymentRequest.cs
2025-04-16 10:49:08 +09:00

35 lines
1.1 KiB
C#

using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BTCPayServer.Data.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20250407133937_AddingReferenceIdToPaymentRequest")]
public partial class AddingReferenceIdToPaymentRequest : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "ReferenceId",
table: "PaymentRequests",
type: "TEXT",
nullable: true);
migrationBuilder.Sql("""
CREATE UNIQUE INDEX IX_PaymentRequests_StoreDataId_ReferenceId
ON "PaymentRequests" ("StoreDataId", "ReferenceId")
WHERE "ReferenceId" IS NOT NULL;
""");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ReferenceId",
table: "PaymentRequests");
}
}
}