mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-15 12:20:16 +01:00
Do not drop column for sqlite
This commit is contained in:
parent
bae08b6966
commit
caca8e81c2
2 changed files with 43 additions and 36 deletions
|
@ -2,7 +2,7 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||||
<Version>1.0.0.7</Version>
|
<Version>1.0.0.8</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Remove="Build\dockerfiles\**" />
|
<Compile Remove="Build\dockerfiles\**" />
|
||||||
|
|
|
@ -4,44 +4,51 @@ using System.Collections.Generic;
|
||||||
|
|
||||||
namespace BTCPayServer.Migrations
|
namespace BTCPayServer.Migrations
|
||||||
{
|
{
|
||||||
public partial class PendingInvoices : Migration
|
public partial class PendingInvoices : Migration
|
||||||
{
|
{
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
{
|
{
|
||||||
migrationBuilder.DropColumn(
|
if(SupportDropColumn(migrationBuilder.ActiveProvider))
|
||||||
name: "Name",
|
{
|
||||||
table: "PairingCodes");
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Name",
|
||||||
|
table: "PairingCodes");
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
migrationBuilder.DropColumn(
|
||||||
name: "Name",
|
name: "Name",
|
||||||
table: "PairedSINData");
|
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);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
private bool SupportDropColumn(string activeProvider)
|
||||||
name: "PendingInvoices",
|
{
|
||||||
columns: table => new
|
return activeProvider != "Microsoft.EntityFrameworkCore.Sqlite";
|
||||||
{
|
}
|
||||||
Id = table.Column<string>(type: "TEXT", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_PendingInvoices", x => x.Id);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
{
|
{
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "PendingInvoices");
|
name: "PendingInvoices");
|
||||||
|
|
||||||
migrationBuilder.AddColumn<string>(
|
migrationBuilder.AddColumn<string>(
|
||||||
name: "Name",
|
name: "Name",
|
||||||
table: "PairingCodes",
|
table: "PairingCodes",
|
||||||
nullable: true);
|
nullable: true);
|
||||||
|
|
||||||
migrationBuilder.AddColumn<string>(
|
migrationBuilder.AddColumn<string>(
|
||||||
name: "Name",
|
name: "Name",
|
||||||
table: "PairedSINData",
|
table: "PairedSINData",
|
||||||
nullable: true);
|
nullable: true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue