using System; using BTCPayServer.Data; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; namespace BTCPayServer.Migrations { [DbContext(typeof(ApplicationDbContext))] [Migration("20171010082424_Tokens")] public partial class Tokens : Migration { protected override void Up(MigrationBuilder migrationBuilder) { int? maxLength = this.IsMySql(migrationBuilder.ActiveProvider) ? (int?)255 : null; migrationBuilder.CreateTable( name: "PairedSINData", columns: table => new { Id = table.Column(nullable: false, maxLength: maxLength), Facade = table.Column(nullable: true), Label = table.Column(nullable: true), Name = table.Column(nullable: true), PairingTime = table.Column(nullable: false), SIN = table.Column(nullable: true, maxLength: maxLength), StoreDataId = table.Column(nullable: true, maxLength: maxLength) }, constraints: table => { table.PrimaryKey("PK_PairedSINData", x => x.Id); }); migrationBuilder.CreateTable( name: "PairingCodes", columns: table => new { Id = table.Column(nullable: false, maxLength: maxLength), DateCreated = table.Column(nullable: false), Expiration = table.Column(nullable: false), Facade = table.Column(nullable: true), Label = table.Column(nullable: true), Name = table.Column(nullable: true), SIN = table.Column(nullable: true), StoreDataId = table.Column(nullable: true, maxLength: maxLength), TokenValue = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_PairingCodes", x => x.Id); }); migrationBuilder.CreateIndex( name: "IX_PairedSINData_SIN", table: "PairedSINData", column: "SIN"); migrationBuilder.CreateIndex( name: "IX_PairedSINData_StoreDataId", table: "PairedSINData", column: "StoreDataId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "PairedSINData"); migrationBuilder.DropTable( name: "PairingCodes"); } } }