Files

71 lines
2.7 KiB
C#
Raw Permalink Normal View History

2026-01-29 00:21:23 +01:00
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace TimetableDesigner.Backend.Services.Authentication.Database.Migrations
{
/// <inheritdoc />
public partial class Outbox_Pattern_From_Nuget : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Event");
migrationBuilder.CreateTable(
name: "Events",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Payload = table.Column<string>(type: "text", nullable: false),
PayloadType = table.Column<string>(type: "text", nullable: false),
OccuredOn = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
LastRetryOn = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
RetryCount = table.Column<long>(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Events", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_Events_Id",
table: "Events",
column: "Id",
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Events");
migrationBuilder.CreateTable(
name: "Event",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
OccuredOn = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
Payload = table.Column<string>(type: "text", nullable: false),
PayloadType = table.Column<string>(type: "text", nullable: false),
ProcessedOn = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
RetryCount = table.Column<long>(type: "bigint", nullable: false),
xmin = table.Column<uint>(type: "xid", rowVersion: true, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Event", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_Event_Id",
table: "Event",
column: "Id",
unique: true);
}
}
}