// 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(nullable: false, maxLength: null), StoreDataId = table.Column(nullable: false, maxLength: null), Blob = table.Column( 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"); } } }