using System; using BTCPayServer.Data; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace BTCPayServer.Migrations { [DbContext(typeof(ApplicationDbContext))] [Migration("20241029163147_AddingPendingTransactionsTable")] public partial class AddingPendingTransactionsTable : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "PendingTransactions", columns: table => new { TransactionId = table.Column(type: "text", nullable: false), CryptoCode = table.Column(type: "text", nullable: false), StoreId = table.Column(type: "text", nullable: true), Expiry = table.Column(type: "timestamp with time zone", nullable: true), State = table.Column(type: "integer", nullable: false), OutpointsUsed = table.Column(type: "text[]", nullable: true), Blob2 = table.Column(type: "JSONB", nullable: true) }, constraints: table => { table.PrimaryKey("PK_PendingTransactions", x => new { x.CryptoCode, x.TransactionId }); table.ForeignKey( name: "FK_PendingTransactions_Stores_StoreId", column: x => x.StoreId, principalTable: "Stores", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_PendingTransactions_StoreId", table: "PendingTransactions", column: "StoreId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "PendingTransactions"); } } }