using System; using BTCPayServer.Data; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; namespace BTCPayServer.Migrations { [DbContext(typeof(ApplicationDbContext))] [Migration("20180114123253_events")] public partial class events : Migration { protected override void Up(MigrationBuilder migrationBuilder) { int? maxLength = this.IsMySql(migrationBuilder.ActiveProvider) ? (int?)255 : null; migrationBuilder.CreateTable( name: "InvoiceEvents", columns: table => new { InvoiceDataId = table.Column(nullable: false, maxLength: maxLength), UniqueId = table.Column(nullable: false, maxLength: maxLength), Message = table.Column(nullable: true), Timestamp = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_InvoiceEvents", x => new { x.InvoiceDataId, x.UniqueId }); table.ForeignKey( name: "FK_InvoiceEvents_Invoices_InvoiceDataId", column: x => x.InvoiceDataId, principalTable: "Invoices", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "InvoiceEvents"); } } }