using BTCPayServer.Data; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; namespace BTCPayServer.Migrations { [DbContext(typeof(ApplicationDbContext))] [Migration("20190802142637_WalletData")] public partial class WalletData : Migration { protected override void Up(MigrationBuilder migrationBuilder) { int? maxLength = this.IsMySql(migrationBuilder.ActiveProvider) ? (int?)255 : null; migrationBuilder.CreateTable( name: "Wallets", columns: table => new { Id = table.Column(nullable: false, maxLength: maxLength), Blob = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_Wallets", x => x.Id); }); migrationBuilder.CreateTable( name: "WalletTransactions", columns: table => new { WalletDataId = table.Column(nullable: false, maxLength: maxLength), TransactionId = table.Column(nullable: false, maxLength: maxLength), Labels = table.Column(nullable: true), Blob = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_WalletTransactions", x => new { x.WalletDataId, x.TransactionId }); table.ForeignKey( name: "FK_WalletTransactions_Wallets_WalletDataId", column: x => x.WalletDataId, principalTable: "Wallets", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "WalletTransactions"); migrationBuilder.DropTable( name: "Wallets"); } } }