using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore.Migrations;
using NodaTime;
#nullable disable
namespace FictionArchive.Service.ReportingService.Migrations
{
///
public partial class InitialCreate : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Jobs",
columns: table => new
{
Id = table.Column(type: "uuid", nullable: false),
ParentJobId = table.Column(type: "uuid", nullable: true),
JobType = table.Column(type: "text", nullable: false),
DisplayName = table.Column(type: "text", nullable: false),
Status = table.Column(type: "integer", nullable: false),
ErrorMessage = table.Column(type: "text", nullable: true),
Metadata = table.Column>(type: "jsonb", nullable: true),
CreatedTime = table.Column(type: "timestamp with time zone", nullable: false),
LastUpdatedTime = table.Column(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Jobs", x => x.Id);
table.ForeignKey(
name: "FK_Jobs_Jobs_ParentJobId",
column: x => x.ParentJobId,
principalTable: "Jobs",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateIndex(
name: "IX_Jobs_ParentJobId",
table: "Jobs",
column: "ParentJobId");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Jobs");
}
}
}