// 
using System;
using API.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace API.Data.Migrations
{
    [DbContext(typeof(DataContext))]
    [Migration("20201215195007_AddedLibrary")]
    partial class AddedLibrary
    {
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "5.0.1");
            modelBuilder.Entity("API.Entities.AppUser", b =>
                {
                    b.Property("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");
                    b.Property("Created")
                        .HasColumnType("TEXT");
                    b.Property("IsAdmin")
                        .HasColumnType("INTEGER");
                    b.Property("LastActive")
                        .HasColumnType("TEXT");
                    b.Property("PasswordHash")
                        .HasColumnType("BLOB");
                    b.Property("PasswordSalt")
                        .HasColumnType("BLOB");
                    b.Property("RowVersion")
                        .IsConcurrencyToken()
                        .HasColumnType("INTEGER");
                    b.Property("UserName")
                        .HasColumnType("TEXT");
                    b.HasKey("Id");
                    b.ToTable("Users");
                });
            modelBuilder.Entity("API.Entities.FolderPath", b =>
                {
                    b.Property("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");
                    b.Property("LibraryId")
                        .HasColumnType("INTEGER");
                    b.Property("Path")
                        .HasColumnType("TEXT");
                    b.HasKey("Id");
                    b.HasIndex("LibraryId");
                    b.ToTable("FolderPath");
                });
            modelBuilder.Entity("API.Entities.Library", b =>
                {
                    b.Property("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");
                    b.Property("AppUserId")
                        .HasColumnType("INTEGER");
                    b.Property("CoverImage")
                        .HasColumnType("TEXT");
                    b.Property("Name")
                        .HasColumnType("TEXT");
                    b.Property("Type")
                        .HasColumnType("INTEGER");
                    b.HasKey("Id");
                    b.HasIndex("AppUserId");
                    b.ToTable("Library");
                });
            modelBuilder.Entity("API.Entities.FolderPath", b =>
                {
                    b.HasOne("API.Entities.Library", null)
                        .WithMany("Folders")
                        .HasForeignKey("LibraryId");
                });
            modelBuilder.Entity("API.Entities.Library", b =>
                {
                    b.HasOne("API.Entities.AppUser", "AppUser")
                        .WithMany("Libraries")
                        .HasForeignKey("AppUserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                    b.Navigation("AppUser");
                });
            modelBuilder.Entity("API.Entities.AppUser", b =>
                {
                    b.Navigation("Libraries");
                });
            modelBuilder.Entity("API.Entities.Library", b =>
                {
                    b.Navigation("Folders");
                });
#pragma warning restore 612, 618
        }
    }
}