mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-06 10:32:13 +01:00
78 lines
3.4 KiB
C#
78 lines
3.4 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("20220929132704_label")]
|
||
|
public partial class label : Migration
|
||
|
{
|
||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||
|
{
|
||
|
migrationBuilder.CreateTable(
|
||
|
name: "WalletObjects",
|
||
|
columns: table => new
|
||
|
{
|
||
|
WalletId = table.Column<string>(type: "TEXT", nullable: false),
|
||
|
Type = table.Column<string>(type: "TEXT", nullable: false),
|
||
|
Id = table.Column<string>(type: "TEXT", nullable: false),
|
||
|
Data = table.Column<string>(type: migrationBuilder.IsNpgsql() ? "JSONB" : "TEXT", nullable: true)
|
||
|
},
|
||
|
constraints: table =>
|
||
|
{
|
||
|
table.PrimaryKey("PK_WalletObjects", x => new { x.WalletId, x.Type, x.Id });
|
||
|
});
|
||
|
|
||
|
migrationBuilder.CreateTable(
|
||
|
name: "WalletObjectLinks",
|
||
|
columns: table => new
|
||
|
{
|
||
|
WalletId = table.Column<string>(type: "TEXT", nullable: false),
|
||
|
ParentType = table.Column<string>(type: "TEXT", nullable: false),
|
||
|
ParentId = table.Column<string>(type: "TEXT", nullable: false),
|
||
|
ChildType = table.Column<string>(type: "TEXT", nullable: false),
|
||
|
ChildId = table.Column<string>(type: "TEXT", nullable: false),
|
||
|
Data = table.Column<string>(type: migrationBuilder.IsNpgsql() ? "JSONB" : "TEXT", nullable: true)
|
||
|
},
|
||
|
constraints: table =>
|
||
|
{
|
||
|
table.PrimaryKey("PK_WalletObjectLinks", x => new { x.WalletId, x.ParentType, x.ParentId, x.ChildType, x.ChildId });
|
||
|
table.ForeignKey(
|
||
|
name: "FK_WalletObjectLinks_WalletObjects_WalletId_ChildType_ChildId",
|
||
|
columns: x => new { x.WalletId, x.ChildType, x.ChildId },
|
||
|
principalTable: "WalletObjects",
|
||
|
principalColumns: new[] { "WalletId", "Type", "Id" },
|
||
|
onDelete: ReferentialAction.Cascade);
|
||
|
table.ForeignKey(
|
||
|
name: "FK_WalletObjectLinks_WalletObjects_WalletId_ParentType_ParentId",
|
||
|
columns: x => new { x.WalletId, x.ParentType, x.ParentId },
|
||
|
principalTable: "WalletObjects",
|
||
|
principalColumns: new[] { "WalletId", "Type", "Id" },
|
||
|
onDelete: ReferentialAction.Cascade);
|
||
|
});
|
||
|
|
||
|
migrationBuilder.CreateIndex(
|
||
|
name: "IX_WalletObjectLinks_WalletId_ChildType_ChildId",
|
||
|
table: "WalletObjectLinks",
|
||
|
columns: new[] { "WalletId", "ChildType", "ChildId" });
|
||
|
}
|
||
|
|
||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||
|
{
|
||
|
migrationBuilder.DropTable(
|
||
|
name: "WalletObjectLinks");
|
||
|
|
||
|
migrationBuilder.DropTable(
|
||
|
name: "WalletObjects");
|
||
|
}
|
||
|
}
|
||
|
}
|