//
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using public_valetax.Data;
#nullable disable
namespace public_valetax.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20251226122935_InitialCreate")]
partial class InitialCreate
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("public_valetax.Models.JournalEntry", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("BodyParameters")
.HasColumnType("text")
.HasColumnName("body_parameters");
b.Property("EventId")
.HasColumnType("bigint")
.HasColumnName("event_id");
b.Property("ExceptionType")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)")
.HasColumnName("exception_type");
b.Property("Message")
.IsRequired()
.HasColumnType("text")
.HasColumnName("message");
b.Property("QueryParameters")
.HasColumnType("text")
.HasColumnName("query_parameters");
b.Property("StackTrace")
.HasColumnType("text")
.HasColumnName("stack_trace");
b.Property("Timestamp")
.HasColumnType("timestamp with time zone")
.HasColumnName("timestamp");
b.HasKey("Id");
b.HasIndex("EventId")
.IsUnique();
b.ToTable("journal_entries");
});
modelBuilder.Entity("public_valetax.Models.Node", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
b.Property("Name")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)")
.HasColumnName("name");
b.Property("ParentId")
.HasColumnType("bigint")
.HasColumnName("parent_id");
b.Property("TreeId")
.HasColumnType("bigint")
.HasColumnName("tree_id");
b.HasKey("Id");
b.HasIndex("ParentId");
b.HasIndex("TreeId", "Name")
.IsUnique();
b.ToTable("nodes");
});
modelBuilder.Entity("public_valetax.Models.Tree", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
b.Property("Name")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)")
.HasColumnName("name");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique();
b.ToTable("trees");
});
modelBuilder.Entity("public_valetax.Models.Node", b =>
{
b.HasOne("public_valetax.Models.Node", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("public_valetax.Models.Tree", "Tree")
.WithMany("Nodes")
.HasForeignKey("TreeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Parent");
b.Navigation("Tree");
});
modelBuilder.Entity("public_valetax.Models.Node", b =>
{
b.Navigation("Children");
});
modelBuilder.Entity("public_valetax.Models.Tree", b =>
{
b.Navigation("Nodes");
});
#pragma warning restore 612, 618
}
}
}