btcpayserver/BTCPayServer.Data/Migrations/20220414132313_AddLightningAddress.cs
2024-04-15 19:08:25 +09:00

52 lines
1.8 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("20220414132313_AddLightningAddress")]
public partial class AddLightningAddress : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "LightningAddresses",
columns: table => new
{
Username = table.Column<string>(nullable: false, maxLength: null),
StoreDataId = table.Column<string>(nullable: false, maxLength: null),
Blob = table.Column<byte[]>( nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_LightningAddresses", x => x.Username);
table.ForeignKey(
name: "FK_LightningAddresses_Stores_StoreDataId",
column: x => x.StoreDataId,
principalTable: "Stores",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_LightningAddresses_StoreDataId",
table: "LightningAddresses",
column: "StoreDataId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "LightningAddresses");
}
}
}