// <auto-generated />
using System;
using FileStorageService.www.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;

#nullable disable

namespace FileStorageService.www.Data.Migrations
{
    [DbContext(typeof(ApplicationDbContext))]
    partial class ApplicationDbContextModelSnapshot : ModelSnapshot
    {
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder.HasAnnotation("ProductVersion", "9.0.0");

            modelBuilder.Entity("FileStorageService.www.Data.FileBlock", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TEXT");

                    b.Property<int>("BlockNumber")
                        .HasColumnType("INTEGER");

                    b.Property<byte[]>("Data")
                        .IsRequired()
                        .HasMaxLength(1024)
                        .HasColumnType("BLOB");

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

                    b.HasKey("Id");

                    b.HasIndex("FileHandleId");

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

            modelBuilder.Entity("FileStorageService.www.Data.FileHandle", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TEXT");

                    b.Property<int>("FileBlockCount")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(64)
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

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

            modelBuilder.Entity("FileStorageService.www.Data.FileBlock", b =>
                {
                    b.HasOne("FileStorageService.www.Data.FileHandle", "FileHandle")
                        .WithMany("FileBlocks")
                        .HasForeignKey("FileHandleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("FileStorageService.www.Data.FileHandle", b =>
                {
                    b.Navigation("FileBlocks");
                });
#pragma warning restore 612, 618
        }
    }
}
