mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-20 10:40:29 +01:00
55 lines
1.6 KiB
C#
55 lines
1.6 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace BTCPayServer.Migrations
|
|
{
|
|
public partial class PendingInvoices : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
if (SupportDropColumn(migrationBuilder.ActiveProvider))
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "Name",
|
|
table: "PairingCodes");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "Name",
|
|
table: "PairedSINData");
|
|
}
|
|
migrationBuilder.CreateTable(
|
|
name: "PendingInvoices",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<string>(type: "TEXT", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_PendingInvoices", x => x.Id);
|
|
});
|
|
}
|
|
|
|
private bool SupportDropColumn(string activeProvider)
|
|
{
|
|
return activeProvider != "Microsoft.EntityFrameworkCore.Sqlite";
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "PendingInvoices");
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "Name",
|
|
table: "PairingCodes",
|
|
nullable: true);
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "Name",
|
|
table: "PairedSINData",
|
|
nullable: true);
|
|
}
|
|
}
|
|
}
|