// <auto-generated />
using System;
using FiscalOS.Infra.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;

#nullable disable

namespace FiscalOS.Infra.Migrations
{
  [DbContext(typeof(AppDbContext))]
  [Migration("20260201125529_AddUsernameToUsers")]
  partial class AddUsernameToUsers
  {
    /// <inheritdoc />
    protected override void BuildTargetModel(ModelBuilder modelBuilder)
    {
#pragma warning disable 612, 618
      modelBuilder.HasAnnotation("ProductVersion", "10.0.2");

      modelBuilder.Entity("FiscalOS.API.Identity.RefreshToken", b =>
          {
            b.Property<Guid>("Id")
                      .ValueGeneratedOnAdd()
                      .HasColumnType("TEXT");

            b.Property<Guid>("UserId")
                      .HasColumnType("TEXT");

            b.HasKey("Id");

            b.HasIndex("UserId");

            b.ToTable("RefreshTokens");
          });

      modelBuilder.Entity("FiscalOS.API.Identity.User", b =>
          {
            b.Property<Guid>("Id")
                      .ValueGeneratedOnAdd()
                      .HasColumnType("TEXT");

            b.Property<string>("Username")
                      .IsRequired()
                      .HasColumnType("TEXT");

            b.HasKey("Id");

            b.ToTable("Users");
          });

      modelBuilder.Entity("FiscalOS.API.Identity.RefreshToken", b =>
          {
            b.HasOne("FiscalOS.API.Identity.User", "User")
                      .WithMany("RefreshTokens")
                      .HasForeignKey("UserId")
                      .OnDelete(DeleteBehavior.Cascade)
                      .IsRequired();

            b.Navigation("User");
          });

      modelBuilder.Entity("FiscalOS.API.Identity.User", b =>
          {
            b.Navigation("RefreshTokens");
          });
#pragma warning restore 612, 618
    }
  }
}