// <auto-generated />
using AfRApay.Web.Backend.Database;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;

#nullable disable

namespace AfRApay.Web.Backend.Database.Migrations
{
    [DbContext(typeof(DatabaseContext))]
    partial class DatabaseContextModelSnapshot : ModelSnapshot
    {
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder.HasAnnotation("ProductVersion", "7.0.2");

            modelBuilder.Entity("AfRApay.Web.Backend.Database.Tables.Card", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("NVarChar(255)")
                        .HasColumnName("CardId");

                    b.Property<int>("Type")
                        .HasColumnType("INTEGER")
                        .HasColumnName("CardType");

                    b.Property<long>("UserId")
                        .HasColumnType("INTEGER");

                    b.HasKey("Id");

                    b.HasIndex("UserId");

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

            modelBuilder.Entity("AfRApay.Web.Backend.Database.Tables.Config", b =>
                {
                    b.Property<string>("Name")
                        .HasColumnType("NVarChar(255)")
                        .HasColumnName("Name");

                    b.Property<string>("Value")
                        .IsRequired()
                        .HasColumnType("NVarChar(255)")
                        .HasColumnName("Value");

                    b.HasKey("Name");

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

            modelBuilder.Entity("AfRApay.Web.Backend.Database.Tables.User", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER")
                        .HasColumnName("ID");

                    b.Property<long>("Balance")
                        .HasColumnType("INTEGER")
                        .HasColumnName("Balance");

                    b.Property<string>("LastIdempotencyKey")
                        .HasColumnType("NVarChar(255)")
                        .HasColumnName("LastIdempotencyKey");

                    b.Property<string>("Nickname")
                        .IsRequired()
                        .HasColumnType("NVarChar(255)")
                        .HasColumnName("Nickname");

                    b.HasKey("Id");

                    b.HasIndex("Nickname")
                        .IsUnique();

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

            modelBuilder.Entity("AfRApay.Web.Backend.Database.Tables.Card", b =>
                {
                    b.HasOne("AfRApay.Web.Backend.Database.Tables.User", "User")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("User");
                });
#pragma warning restore 612, 618
        }
    }
}
