0
0
mirror of https://github.com/alex289/CleanArchitecture.git synced 2025-06-30 02:31:08 +00:00
CleanArchitecture/CleanArchitecture.Infrastructure/Migrations/EventStoreDb/20230701135441_AddEventStore.cs
Alexander Konietzko 53e0966f51
Add event sourcing
2023-07-01 16:46:08 +02:00

40 lines
1.5 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CleanArchitecture.Infrastructure.Migrations.EventStoreDb
{
/// <inheritdoc />
public partial class AddEventStore : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "StoredDomainEvents",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Data = table.Column<string>(type: "nvarchar(max)", nullable: false),
User = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
CorrelationId = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
AggregateId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Action = table.Column<string>(type: "varchar(100)", nullable: false),
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_StoredDomainEvents", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "StoredDomainEvents");
}
}
}