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

44 lines
1.5 KiB
C#

using System;
using BTCPayServer.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BTCPayServer.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20220610090843_AddSettingsToStore")]
public partial class AddSettingsToStore : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "StoreSettings",
columns: table => new
{
Name = table.Column<string>(nullable: false, maxLength: null),
StoreId = table.Column<string>(nullable: false, maxLength: null),
Value = table.Column<string>(type: "JSONB", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_StoreSettings", x => new { x.StoreId, x.Name });
table.ForeignKey(
name: "FK_StoreSettings_Stores_StoreId",
column: x => x.StoreId,
principalTable: "Stores",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "StoreSettings");
}
}
}