mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-23 14:40:36 +01:00
93 lines
3.3 KiB
C#
93 lines
3.3 KiB
C#
|
// <auto-generated />
|
|||
|
using System;
|
|||
|
using BTCPayServer.Data;
|
|||
|
using Microsoft.EntityFrameworkCore;
|
|||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||
|
|
|||
|
#nullable disable
|
|||
|
|
|||
|
namespace BTCPayServer.Migrations
|
|||
|
{
|
|||
|
[DbContext(typeof(ApplicationDbContext))]
|
|||
|
[Migration("20220311135252_AddPayoutProcessors")]
|
|||
|
public partial class AddPayoutProcessors : Migration
|
|||
|
{
|
|||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.AddColumn<string>(
|
|||
|
name: "StoreDataId",
|
|||
|
table: "Payouts",
|
|||
|
type: "TEXT",
|
|||
|
nullable: true);
|
|||
|
|
|||
|
migrationBuilder.CreateTable(
|
|||
|
name: "PayoutProcessors",
|
|||
|
columns: table => new
|
|||
|
{
|
|||
|
Id = table.Column<string>(type: "TEXT", nullable: false),
|
|||
|
StoreId = table.Column<string>(type: "TEXT", nullable: true),
|
|||
|
PaymentMethod = table.Column<string>(type: "TEXT", nullable: true),
|
|||
|
Processor = table.Column<string>(type: "TEXT", nullable: true),
|
|||
|
Blob = table.Column<byte[]>(nullable: true)
|
|||
|
},
|
|||
|
constraints: table =>
|
|||
|
{
|
|||
|
table.PrimaryKey("PK_PayoutProcessors", x => x.Id);
|
|||
|
table.ForeignKey(
|
|||
|
name: "FK_PayoutProcessors_Stores_StoreId",
|
|||
|
column: x => x.StoreId,
|
|||
|
principalTable: "Stores",
|
|||
|
principalColumn: "Id",
|
|||
|
onDelete: ReferentialAction.Cascade);
|
|||
|
});
|
|||
|
|
|||
|
migrationBuilder.CreateIndex(
|
|||
|
name: "IX_Payouts_StoreDataId",
|
|||
|
table: "Payouts",
|
|||
|
column: "StoreDataId");
|
|||
|
|
|||
|
migrationBuilder.CreateIndex(
|
|||
|
name: "IX_PayoutProcessors_StoreId",
|
|||
|
table: "PayoutProcessors",
|
|||
|
column: "StoreId");
|
|||
|
if (this.SupportAddForeignKey(ActiveProvider))
|
|||
|
{
|
|||
|
migrationBuilder.AddForeignKey(
|
|||
|
name: "FK_Payouts_Stores_StoreDataId",
|
|||
|
table: "Payouts",
|
|||
|
column: "StoreDataId",
|
|||
|
principalTable: "Stores",
|
|||
|
principalColumn: "Id",
|
|||
|
onDelete: ReferentialAction.Cascade);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
if (this.SupportDropForeignKey(ActiveProvider))
|
|||
|
{
|
|||
|
|
|||
|
migrationBuilder.DropForeignKey(
|
|||
|
name: "FK_Payouts_Stores_StoreDataId",
|
|||
|
table: "Payouts");
|
|||
|
|
|||
|
migrationBuilder.DropTable(
|
|||
|
name: "PayoutProcessors");
|
|||
|
|
|||
|
migrationBuilder.DropIndex(
|
|||
|
name: "IX_Payouts_StoreDataId",
|
|||
|
table: "Payouts");
|
|||
|
}
|
|||
|
if(this.SupportDropColumn(ActiveProvider))
|
|||
|
{
|
|||
|
migrationBuilder.DropColumn(
|
|||
|
name: "StoreDataId",
|
|||
|
table: "Payouts");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|