btcpayserver/BTCPayServer.Data/Migrations/20180114123253_events.cs

43 lines
1.6 KiB
C#
Raw Normal View History

2020-06-28 21:44:35 -05:00
using System;
2020-06-28 17:55:27 +09:00
using BTCPayServer.Data;
2019-08-30 17:55:24 +09:00
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
2018-01-14 21:48:23 +09:00
namespace BTCPayServer.Migrations
{
2019-08-30 17:55:24 +09:00
[DbContext(typeof(ApplicationDbContext))]
[Migration("20180114123253_events")]
2018-01-14 21:48:23 +09:00
public partial class events : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
int? maxLength = this.IsMySql(migrationBuilder.ActiveProvider) ? (int?)255 : null;
2018-01-14 21:48:23 +09:00
migrationBuilder.CreateTable(
name: "InvoiceEvents",
columns: table => new
{
InvoiceDataId = table.Column<string>(nullable: false, maxLength: maxLength),
UniqueId = table.Column<string>(nullable: false, maxLength: maxLength),
2018-01-14 21:48:23 +09:00
Message = table.Column<string>(nullable: true),
Timestamp = table.Column<DateTimeOffset>(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");
}
}
}