using System; using Microsoft.EntityFrameworkCore.Migrations; namespace BTCPayServer.Migrations { public partial class AddU2fDevices : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "Facade", table: "PairedSINData"); migrationBuilder.CreateTable( name: "U2FDevices", columns: table => new { Id = table.Column(nullable: false), Name = table.Column(nullable: true), KeyHandle = table.Column(nullable: false), PublicKey = table.Column(nullable: false), AttestationCert = table.Column(nullable: false), Counter = table.Column(nullable: false), ApplicationUserId = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_U2FDevices", x => x.Id); table.ForeignKey( name: "FK_U2FDevices_AspNetUsers_ApplicationUserId", column: x => x.ApplicationUserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_U2FDevices_ApplicationUserId", table: "U2FDevices", column: "ApplicationUserId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "U2FDevices"); migrationBuilder.AddColumn( name: "Facade", table: "PairedSINData", nullable: true); } } }