Inclui suporte para armazenar dados JSON na tabela ProcessedInvoices usando o tipo jsonb do PostgreSQL. Implementa conversão entre JsonDocument e string JSON no modelo. Cria migração para adicionar/remover a coluna. Atualiza versão do EF Core para 9.0.0. Ajusta gravação de faturas para salvar o corpo JSON recebido.
56 lines
1.8 KiB
C#
56 lines
1.8 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
using Webhook_4docs;
|
|
|
|
#nullable disable
|
|
|
|
namespace Webhook_4docs.Migrations
|
|
{
|
|
[DbContext(typeof(WebhookDbContext))]
|
|
[Migration("20260227164052_AddJsonBodyToProcessedInvoices")]
|
|
partial class AddJsonBodyToProcessedInvoices
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "9.0.0")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("Webhook_4docs.ProcessedInvoices", b =>
|
|
{
|
|
b.Property<int>("InvoiceId")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("InvoiceId"));
|
|
|
|
b.Property<DateTime>("DateTimeProcessed")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("InvoicePath")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("JsonBody")
|
|
.HasColumnType("jsonb");
|
|
|
|
b.Property<string>("Status")
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("InvoiceId");
|
|
|
|
b.ToTable("ProcessedInvoices");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|