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

#nullable disable

namespace Fabula.Data.Migrations
{
    [DbContext(typeof(FabulaDbContext))]
    [Migration("20230727150555_ChangedConfigurations")]
    partial class ChangedConfigurations
    {
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "6.0.20")
                .HasAnnotation("Relational:MaxIdentifierLength", 128);

            SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);

            modelBuilder.Entity("ApplicationUserGenre", b =>
                {
                    b.Property<int>("FavoriteGenresId")
                        .HasColumnType("int");

                    b.Property<Guid>("FavoritesId")
                        .HasColumnType("uniqueidentifier");

                    b.HasKey("FavoriteGenresId", "FavoritesId");

                    b.HasIndex("FavoritesId");

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

            modelBuilder.Entity("CompositionGenre", b =>
                {
                    b.Property<Guid>("CompositionsId")
                        .HasColumnType("uniqueidentifier");

                    b.Property<int>("GenresId")
                        .HasColumnType("int");

                    b.HasKey("CompositionsId", "GenresId");

                    b.HasIndex("GenresId");

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

            modelBuilder.Entity("CompositionTag", b =>
                {
                    b.Property<Guid>("CompositionsId")
                        .HasColumnType("uniqueidentifier");

                    b.Property<int>("TagsId")
                        .HasColumnType("int");

                    b.HasKey("CompositionsId", "TagsId");

                    b.HasIndex("TagsId");

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

            modelBuilder.Entity("Fabula.Data.Models.ApplicationUser", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uniqueidentifier");

                    b.Property<int>("AccessFailedCount")
                        .HasColumnType("int");

                    b.Property<Guid?>("ApplicationUserId")
                        .HasColumnType("uniqueidentifier");

                    b.Property<string>("Bio")
                        .HasMaxLength(200)
                        .HasColumnType("nvarchar(200)")
                        .HasComment("User bio description");

                    b.Property<DateTime>("BirthDate")
                        .HasColumnType("datetime2")
                        .HasComment("User date of birth");

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Email")
                        .HasMaxLength(256)
                        .HasColumnType("nvarchar(256)");

                    b.Property<bool>("EmailConfirmed")
                        .HasColumnType("bit");

                    b.Property<string>("FirstName")
                        .IsRequired()
                        .HasMaxLength(150)
                        .HasColumnType("nvarchar(150)")
                        .HasComment("First name of user");

                    b.Property<string>("LastName")
                        .IsRequired()
                        .HasMaxLength(150)
                        .HasColumnType("nvarchar(150)")
                        .HasComment("Last name of user");

                    b.Property<bool>("LockoutEnabled")
                        .HasColumnType("bit");

                    b.Property<DateTimeOffset?>("LockoutEnd")
                        .HasColumnType("datetimeoffset");

                    b.Property<string>("NormalizedEmail")
                        .HasMaxLength(256)
                        .HasColumnType("nvarchar(256)");

                    b.Property<string>("NormalizedUserName")
                        .HasMaxLength(256)
                        .HasColumnType("nvarchar(256)");

                    b.Property<string>("PasswordHash")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("PhoneNumber")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("PhoneNumberConfirmed")
                        .HasColumnType("bit");

                    b.Property<string>("ProfilePictureUrl")
                        .HasMaxLength(2084)
                        .HasColumnType("nvarchar(2084)")
                        .HasComment("A url which leads to the user's profile picture");

                    b.Property<string>("SecurityStamp")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("TwoFactorEnabled")
                        .HasColumnType("bit");

                    b.Property<string>("UserName")
                        .HasMaxLength(256)
                        .HasColumnType("nvarchar(256)");

                    b.Property<string>("WebsiteURL")
                        .HasMaxLength(2084)
                        .HasColumnType("nvarchar(2084)")
                        .HasComment("User website url (social media/personal website)");

                    b.HasKey("Id");

                    b.HasIndex("ApplicationUserId");

                    b.HasIndex("NormalizedEmail")
                        .HasDatabaseName("EmailIndex");

                    b.HasIndex("NormalizedUserName")
                        .IsUnique()
                        .HasDatabaseName("UserNameIndex")
                        .HasFilter("[NormalizedUserName] IS NOT NULL");

                    b.ToTable("AspNetUsers", (string)null);

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

            modelBuilder.Entity("Fabula.Data.Models.Comment", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uniqueidentifier")
                        .HasComment("Id of the comment");

                    b.Property<Guid>("AuthorId")
                        .HasColumnType("uniqueidentifier")
                        .HasComment("Id of the comment author");

                    b.Property<Guid>("CompositionId")
                        .HasColumnType("uniqueidentifier")
                        .HasComment("Id of composition");

                    b.Property<string>("Content")
                        .IsRequired()
                        .HasMaxLength(200)
                        .HasColumnType("nvarchar(200)")
                        .HasComment("Content of the comment");

                    b.Property<DateTime?>("DeletedOn")
                        .HasColumnType("datetime2")
                        .HasComment("Date and time of deletion of the comment. Note: A nullable type is used for the purposes of documenting both whether a comment has been deleted and also when the operation took place.");

                    b.Property<DateTime>("PublishedOn")
                        .HasColumnType("datetime2")
                        .HasComment("Date of publishing");

                    b.HasKey("Id");

                    b.HasIndex("AuthorId");

                    b.HasIndex("CompositionId");

                    b.ToTable("Comments");

                    b.HasComment("Comments made by users");
                });

            modelBuilder.Entity("Fabula.Data.Models.Composition", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uniqueidentifier")
                        .HasComment("Id of the composition");

                    b.Property<Guid>("AuthorId")
                        .HasColumnType("uniqueidentifier")
                        .HasComment("Id of composition author");

                    b.Property<string>("Content")
                        .IsRequired()
                        .HasMaxLength(100000)
                        .HasColumnType("nvarchar(max)")
                        .HasComment("The composition itself");

                    b.Property<string>("CoverUrl")
                        .IsRequired()
                        .HasMaxLength(2084)
                        .HasColumnType("nvarchar(2084)")
                        .HasComment("A url which leads to the composition's cover art");

                    b.Property<DateTime?>("DeletedOn")
                        .HasColumnType("datetime2")
                        .HasComment("Date and time of deletion of the composition. Note: A nullable type is used for the purposes of documenting both whether a composition has been deleted and also when the operation took place.");

                    b.Property<Guid?>("ListId")
                        .HasColumnType("uniqueidentifier");

                    b.Property<DateTime>("PublishedOn")
                        .HasColumnType("datetime2")
                        .HasComment("Date of publishing");

                    b.Property<string>("Synopsis")
                        .IsRequired()
                        .HasMaxLength(2000)
                        .HasColumnType("nvarchar(2000)")
                        .HasComment("Synopsis of the composition");

                    b.Property<string>("Title")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("nvarchar(100)")
                        .HasComment("Title of the composition");

                    b.Property<bool>("hasAdultContent")
                        .HasColumnType("bit")
                        .HasComment("Adult content flag of the composition");

                    b.HasKey("Id");

                    b.HasIndex("AuthorId");

                    b.HasIndex("ListId");

                    b.ToTable("Compositions");

                    b.HasComment("User-written compositions");
                });

            modelBuilder.Entity("Fabula.Data.Models.Genre", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int")
                        .HasComment("Id of genre");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(75)
                        .HasColumnType("nvarchar(75)")
                        .HasComment("Name of genre");

                    b.HasKey("Id");

                    b.ToTable("Genres");

                    b.HasComment("Genre of a composition");

                    b.HasData(
                        new
                        {
                            Id = 1,
                            Name = "Mystery"
                        },
                        new
                        {
                            Id = 2,
                            Name = "Romance"
                        },
                        new
                        {
                            Id = 3,
                            Name = "Science Fiction"
                        },
                        new
                        {
                            Id = 4,
                            Name = "Fantasy"
                        },
                        new
                        {
                            Id = 5,
                            Name = "Thriller"
                        },
                        new
                        {
                            Id = 6,
                            Name = "Horror"
                        },
                        new
                        {
                            Id = 7,
                            Name = "Historical Fiction"
                        },
                        new
                        {
                            Id = 8,
                            Name = "Poetry"
                        },
                        new
                        {
                            Id = 9,
                            Name = "Drama"
                        },
                        new
                        {
                            Id = 10,
                            Name = "Comedy"
                        },
                        new
                        {
                            Id = 11,
                            Name = "Action"
                        },
                        new
                        {
                            Id = 12,
                            Name = "Adventure"
                        },
                        new
                        {
                            Id = 13,
                            Name = "Crime"
                        },
                        new
                        {
                            Id = 14,
                            Name = "Satire"
                        },
                        new
                        {
                            Id = 15,
                            Name = "Young Adult"
                        },
                        new
                        {
                            Id = 16,
                            Name = "Fairy Tale"
                        },
                        new
                        {
                            Id = 17,
                            Name = "Western"
                        },
                        new
                        {
                            Id = 18,
                            Name = "Paranormal"
                        },
                        new
                        {
                            Id = 19,
                            Name = "Urban Fantasy"
                        },
                        new
                        {
                            Id = 20,
                            Name = "Steamy Romance"
                        },
                        new
                        {
                            Id = 21,
                            Name = "Time Travel"
                        },
                        new
                        {
                            Id = 22,
                            Name = "Political Thriller"
                        },
                        new
                        {
                            Id = 23,
                            Name = "Noir"
                        },
                        new
                        {
                            Id = 24,
                            Name = "Detective"
                        },
                        new
                        {
                            Id = 25,
                            Name = "Humor"
                        },
                        new
                        {
                            Id = 26,
                            Name = "Children's"
                        },
                        new
                        {
                            Id = 27,
                            Name = "Historical Romance"
                        },
                        new
                        {
                            Id = 28,
                            Name = "Psychological"
                        },
                        new
                        {
                            Id = 29,
                            Name = "Epic"
                        },
                        new
                        {
                            Id = 30,
                            Name = "Classic"
                        },
                        new
                        {
                            Id = 31,
                            Name = "Short Story"
                        },
                        new
                        {
                            Id = 32,
                            Name = "Mythological"
                        },
                        new
                        {
                            Id = 33,
                            Name = "Space Opera"
                        },
                        new
                        {
                            Id = 34,
                            Name = "Military Fiction"
                        },
                        new
                        {
                            Id = 35,
                            Name = "Cyberpunk"
                        },
                        new
                        {
                            Id = 36,
                            Name = "Post-Apocalyptic"
                        },
                        new
                        {
                            Id = 37,
                            Name = "Chick Lit"
                        },
                        new
                        {
                            Id = 38,
                            Name = "Sports"
                        },
                        new
                        {
                            Id = 39,
                            Name = "Gothic"
                        },
                        new
                        {
                            Id = 40,
                            Name = "Art"
                        },
                        new
                        {
                            Id = 41,
                            Name = "Business"
                        },
                        new
                        {
                            Id = 42,
                            Name = "Economics"
                        },
                        new
                        {
                            Id = 43,
                            Name = "Politics"
                        });
                });

            modelBuilder.Entity("Fabula.Data.Models.List", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uniqueidentifier")
                        .HasComment("Id of list");

                    b.Property<DateTime>("CreatedOn")
                        .HasColumnType("datetime2")
                        .HasComment("Date of creation");

                    b.Property<Guid>("CreatorId")
                        .HasColumnType("uniqueidentifier")
                        .HasComment("Id of creator");

                    b.Property<DateTime?>("DeletedOn")
                        .HasColumnType("datetime2")
                        .HasComment("Date and time of deletion of the list. Note: A nullable type is used for the purposes of documenting both whether a list has been deleted and also when the operation took place.");

                    b.Property<string>("Description")
                        .IsRequired()
                        .HasMaxLength(2000)
                        .HasColumnType("nvarchar(2000)")
                        .HasComment("Description of list");

                    b.Property<string>("Title")
                        .IsRequired()
                        .HasMaxLength(75)
                        .HasColumnType("nvarchar(75)")
                        .HasComment("Title of list");

                    b.Property<bool>("hasAdultContent")
                        .HasColumnType("bit")
                        .HasComment("Adult content flag of the list");

                    b.HasKey("Id");

                    b.HasIndex("CreatorId");

                    b.ToTable("Lists");

                    b.HasComment("Reading lists");
                });

            modelBuilder.Entity("Fabula.Data.Models.Rating", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uniqueidentifier")
                        .HasComment("Id of rating");

                    b.Property<Guid>("CompositionId")
                        .HasColumnType("uniqueidentifier")
                        .HasComment("Id of composition");

                    b.Property<DateTime?>("DeletedOn")
                        .HasColumnType("datetime2")
                        .HasComment("Date and time of deletion of the rating. Note: A nullable type is used for the purposes of documenting both whether a rating has been deleted and also when the operation took place.");

                    b.Property<DateTime>("PublishedOn")
                        .HasColumnType("datetime2")
                        .HasComment("Date of publishing");

                    b.Property<Guid>("UserId")
                        .HasColumnType("uniqueidentifier")
                        .HasComment("Id of user");

                    b.Property<byte>("Value")
                        .HasColumnType("tinyint")
                        .HasComment("Value of rating");

                    b.HasKey("Id");

                    b.HasIndex("CompositionId");

                    b.HasIndex("UserId");

                    b.ToTable("Ratings");

                    b.HasComment("Rating of composition");
                });

            modelBuilder.Entity("Fabula.Data.Models.Tag", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int")
                        .HasComment("Id of tag");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(75)
                        .HasColumnType("nvarchar(75)")
                        .HasComment("Name of tag");

                    b.HasKey("Id");

                    b.ToTable("Tags");

                    b.HasComment("Tags for better categorization of literary works");

                    b.HasData(
                        new
                        {
                            Id = 1,
                            Name = "Biography"
                        },
                        new
                        {
                            Id = 2,
                            Name = "Memoir"
                        },
                        new
                        {
                            Id = 3,
                            Name = "Non-fiction"
                        },
                        new
                        {
                            Id = 4,
                            Name = "Self-Help"
                        },
                        new
                        {
                            Id = 5,
                            Name = "Travel"
                        },
                        new
                        {
                            Id = 6,
                            Name = "Science"
                        },
                        new
                        {
                            Id = 7,
                            Name = "Fiction"
                        },
                        new
                        {
                            Id = 8,
                            Name = "Satire"
                        },
                        new
                        {
                            Id = 9,
                            Name = "LGBTQ+"
                        },
                        new
                        {
                            Id = 10,
                            Name = "Graphic Novel"
                        },
                        new
                        {
                            Id = 11,
                            Name = "Food"
                        },
                        new
                        {
                            Id = 12,
                            Name = "Music"
                        },
                        new
                        {
                            Id = 13,
                            Name = "Finance"
                        },
                        new
                        {
                            Id = 14,
                            Name = "Technology"
                        },
                        new
                        {
                            Id = 15,
                            Name = "Educational"
                        },
                        new
                        {
                            Id = 16,
                            Name = "Nature"
                        },
                        new
                        {
                            Id = 17,
                            Name = "Religion"
                        },
                        new
                        {
                            Id = 18,
                            Name = "Psychology"
                        },
                        new
                        {
                            Id = 19,
                            Name = "Anthology"
                        },
                        new
                        {
                            Id = 20,
                            Name = "War"
                        },
                        new
                        {
                            Id = 21,
                            Name = "Supernatural"
                        },
                        new
                        {
                            Id = 22,
                            Name = "Coming of Age"
                        },
                        new
                        {
                            Id = 23,
                            Name = "Family"
                        },
                        new
                        {
                            Id = 24,
                            Name = "Magic"
                        },
                        new
                        {
                            Id = 25,
                            Name = "Inspirational"
                        },
                        new
                        {
                            Id = 26,
                            Name = "Suspense"
                        },
                        new
                        {
                            Id = 27,
                            Name = "Thrilling"
                        },
                        new
                        {
                            Id = 28,
                            Name = "Intrigue"
                        },
                        new
                        {
                            Id = 29,
                            Name = "Spiritual"
                        },
                        new
                        {
                            Id = 30,
                            Name = "Artistic"
                        },
                        new
                        {
                            Id = 31,
                            Name = "Meditative"
                        },
                        new
                        {
                            Id = 32,
                            Name = "Environmental"
                        },
                        new
                        {
                            Id = 33,
                            Name = "Journal"
                        },
                        new
                        {
                            Id = 34,
                            Name = "Guide"
                        },
                        new
                        {
                            Id = 35,
                            Name = "Reference"
                        },
                        new
                        {
                            Id = 36,
                            Name = "Health"
                        },
                        new
                        {
                            Id = 37,
                            Name = "Fitness"
                        },
                        new
                        {
                            Id = 38,
                            Name = "Fashion"
                        },
                        new
                        {
                            Id = 39,
                            Name = "Cookbook"
                        },
                        new
                        {
                            Id = 40,
                            Name = "Crafts"
                        },
                        new
                        {
                            Id = 41,
                            Name = "Gardening"
                        },
                        new
                        {
                            Id = 42,
                            Name = "Architecture"
                        },
                        new
                        {
                            Id = 43,
                            Name = "Design"
                        },
                        new
                        {
                            Id = 44,
                            Name = "Parenting"
                        },
                        new
                        {
                            Id = 45,
                            Name = "Relationships"
                        },
                        new
                        {
                            Id = 46,
                            Name = "Education"
                        },
                        new
                        {
                            Id = 47,
                            Name = "Philosophy"
                        },
                        new
                        {
                            Id = 48,
                            Name = "Science Fiction"
                        },
                        new
                        {
                            Id = 49,
                            Name = "Business"
                        },
                        new
                        {
                            Id = 50,
                            Name = "Crime"
                        },
                        new
                        {
                            Id = 51,
                            Name = "Historical"
                        });
                });

            modelBuilder.Entity("Fabula.Data.Models.UserFavoriteComposition", b =>
                {
                    b.Property<Guid>("UserId")
                        .HasColumnType("uniqueidentifier")
                        .HasComment("Id of user");

                    b.Property<Guid>("CompositionId")
                        .HasColumnType("uniqueidentifier")
                        .HasComment("Id of composition");

                    b.HasKey("UserId", "CompositionId");

                    b.HasIndex("CompositionId");

                    b.ToTable("UsersFavoriteCompositions");

                    b.HasComment("Mapping table for users and the compositions they've favorited");
                });

            modelBuilder.Entity("Fabula.Data.Models.UserFollowedList", b =>
                {
                    b.Property<Guid>("UserId")
                        .HasColumnType("uniqueidentifier")
                        .HasComment("Id of user");

                    b.Property<Guid>("ListId")
                        .HasColumnType("uniqueidentifier")
                        .HasComment("Id of list");

                    b.HasKey("UserId", "ListId");

                    b.HasIndex("ListId");

                    b.ToTable("UsersFollowedLists");

                    b.HasComment("Mapping table for users and the lists they've followed");
                });

            modelBuilder.Entity("Fabula.Data.Models.UserLikedComment", b =>
                {
                    b.Property<Guid>("UserId")
                        .HasColumnType("uniqueidentifier")
                        .HasComment("Id of user");

                    b.Property<Guid>("CommentId")
                        .HasColumnType("uniqueidentifier")
                        .HasComment("Id of comment");

                    b.HasKey("UserId", "CommentId");

                    b.HasIndex("CommentId");

                    b.ToTable("UsersLikedComments");

                    b.HasComment("Mapping table for users and the comments they've liked");
                });

            modelBuilder.Entity("Fabula.Data.Models.UserLikedList", b =>
                {
                    b.Property<Guid>("UserId")
                        .HasColumnType("uniqueidentifier")
                        .HasComment("Id of user");

                    b.Property<Guid>("ListId")
                        .HasColumnType("uniqueidentifier")
                        .HasComment("Id of list");

                    b.HasKey("UserId", "ListId");

                    b.HasIndex("ListId");

                    b.ToTable("UsersLikedLists");

                    b.HasComment("Mapping table for users and the lists they've liked");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole<System.Guid>", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uniqueidentifier");

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Name")
                        .HasMaxLength(256)
                        .HasColumnType("nvarchar(256)");

                    b.Property<string>("NormalizedName")
                        .HasMaxLength(256)
                        .HasColumnType("nvarchar(256)");

                    b.HasKey("Id");

                    b.HasIndex("NormalizedName")
                        .IsUnique()
                        .HasDatabaseName("RoleNameIndex")
                        .HasFilter("[NormalizedName] IS NOT NULL");

                    b.ToTable("AspNetRoles", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);

                    b.Property<string>("ClaimType")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ClaimValue")
                        .HasColumnType("nvarchar(max)");

                    b.Property<Guid>("RoleId")
                        .HasColumnType("uniqueidentifier");

                    b.HasKey("Id");

                    b.HasIndex("RoleId");

                    b.ToTable("AspNetRoleClaims", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);

                    b.Property<string>("ClaimType")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ClaimValue")
                        .HasColumnType("nvarchar(max)");

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

                    b.HasKey("Id");

                    b.HasIndex("UserId");

                    b.ToTable("AspNetUserClaims", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
                {
                    b.Property<string>("LoginProvider")
                        .HasMaxLength(128)
                        .HasColumnType("nvarchar(128)");

                    b.Property<string>("ProviderKey")
                        .HasMaxLength(128)
                        .HasColumnType("nvarchar(128)");

                    b.Property<string>("ProviderDisplayName")
                        .HasColumnType("nvarchar(max)");

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

                    b.HasKey("LoginProvider", "ProviderKey");

                    b.HasIndex("UserId");

                    b.ToTable("AspNetUserLogins", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
                {
                    b.Property<Guid>("UserId")
                        .HasColumnType("uniqueidentifier");

                    b.Property<Guid>("RoleId")
                        .HasColumnType("uniqueidentifier");

                    b.HasKey("UserId", "RoleId");

                    b.HasIndex("RoleId");

                    b.ToTable("AspNetUserRoles", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
                {
                    b.Property<Guid>("UserId")
                        .HasColumnType("uniqueidentifier");

                    b.Property<string>("LoginProvider")
                        .HasMaxLength(128)
                        .HasColumnType("nvarchar(128)");

                    b.Property<string>("Name")
                        .HasMaxLength(128)
                        .HasColumnType("nvarchar(128)");

                    b.Property<string>("Value")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("UserId", "LoginProvider", "Name");

                    b.ToTable("AspNetUserTokens", (string)null);
                });

            modelBuilder.Entity("ApplicationUserGenre", b =>
                {
                    b.HasOne("Fabula.Data.Models.Genre", null)
                        .WithMany()
                        .HasForeignKey("FavoriteGenresId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Fabula.Data.Models.ApplicationUser", null)
                        .WithMany()
                        .HasForeignKey("FavoritesId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("CompositionGenre", b =>
                {
                    b.HasOne("Fabula.Data.Models.Composition", null)
                        .WithMany()
                        .HasForeignKey("CompositionsId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Fabula.Data.Models.Genre", null)
                        .WithMany()
                        .HasForeignKey("GenresId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("CompositionTag", b =>
                {
                    b.HasOne("Fabula.Data.Models.Composition", null)
                        .WithMany()
                        .HasForeignKey("CompositionsId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Fabula.Data.Models.Tag", null)
                        .WithMany()
                        .HasForeignKey("TagsId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Fabula.Data.Models.ApplicationUser", b =>
                {
                    b.HasOne("Fabula.Data.Models.ApplicationUser", null)
                        .WithMany("Followers")
                        .HasForeignKey("ApplicationUserId");
                });

            modelBuilder.Entity("Fabula.Data.Models.Comment", b =>
                {
                    b.HasOne("Fabula.Data.Models.ApplicationUser", "Author")
                        .WithMany("WrittenComments")
                        .HasForeignKey("AuthorId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Fabula.Data.Models.Composition", "Composition")
                        .WithMany("Comments")
                        .HasForeignKey("CompositionId")
                        .OnDelete(DeleteBehavior.ClientCascade)
                        .IsRequired();

                    b.Navigation("Author");

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

            modelBuilder.Entity("Fabula.Data.Models.Composition", b =>
                {
                    b.HasOne("Fabula.Data.Models.ApplicationUser", "Author")
                        .WithMany("WrittenCompositions")
                        .HasForeignKey("AuthorId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Fabula.Data.Models.List", null)
                        .WithMany("Compositions")
                        .HasForeignKey("ListId");

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

            modelBuilder.Entity("Fabula.Data.Models.List", b =>
                {
                    b.HasOne("Fabula.Data.Models.ApplicationUser", "Creator")
                        .WithMany("CreatedLists")
                        .HasForeignKey("CreatorId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

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

            modelBuilder.Entity("Fabula.Data.Models.Rating", b =>
                {
                    b.HasOne("Fabula.Data.Models.Composition", "Composition")
                        .WithMany("Ratings")
                        .HasForeignKey("CompositionId")
                        .OnDelete(DeleteBehavior.ClientCascade)
                        .IsRequired();

                    b.HasOne("Fabula.Data.Models.ApplicationUser", "User")
                        .WithMany("Ratings")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("Composition");

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

            modelBuilder.Entity("Fabula.Data.Models.UserFavoriteComposition", b =>
                {
                    b.HasOne("Fabula.Data.Models.Composition", "Composition")
                        .WithMany("Favorites")
                        .HasForeignKey("CompositionId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Fabula.Data.Models.ApplicationUser", "User")
                        .WithMany("FavoriteCompositions")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("Composition");

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

            modelBuilder.Entity("Fabula.Data.Models.UserFollowedList", b =>
                {
                    b.HasOne("Fabula.Data.Models.List", "List")
                        .WithMany("Followers")
                        .HasForeignKey("ListId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Fabula.Data.Models.ApplicationUser", "User")
                        .WithMany("FollowedLists")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("List");

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

            modelBuilder.Entity("Fabula.Data.Models.UserLikedComment", b =>
                {
                    b.HasOne("Fabula.Data.Models.Comment", "Comment")
                        .WithMany("Likes")
                        .HasForeignKey("CommentId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Fabula.Data.Models.ApplicationUser", "User")
                        .WithMany("LikedComments")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("Comment");

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

            modelBuilder.Entity("Fabula.Data.Models.UserLikedList", b =>
                {
                    b.HasOne("Fabula.Data.Models.List", "List")
                        .WithMany("Likes")
                        .HasForeignKey("ListId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Fabula.Data.Models.ApplicationUser", "User")
                        .WithMany("LikedLists")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("List");

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole<System.Guid>", null)
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
                {
                    b.HasOne("Fabula.Data.Models.ApplicationUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
                {
                    b.HasOne("Fabula.Data.Models.ApplicationUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole<System.Guid>", null)
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Fabula.Data.Models.ApplicationUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
                {
                    b.HasOne("Fabula.Data.Models.ApplicationUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Fabula.Data.Models.ApplicationUser", b =>
                {
                    b.Navigation("CreatedLists");

                    b.Navigation("FavoriteCompositions");

                    b.Navigation("FollowedLists");

                    b.Navigation("Followers");

                    b.Navigation("LikedComments");

                    b.Navigation("LikedLists");

                    b.Navigation("Ratings");

                    b.Navigation("WrittenComments");

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

            modelBuilder.Entity("Fabula.Data.Models.Comment", b =>
                {
                    b.Navigation("Likes");
                });

            modelBuilder.Entity("Fabula.Data.Models.Composition", b =>
                {
                    b.Navigation("Comments");

                    b.Navigation("Favorites");

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

            modelBuilder.Entity("Fabula.Data.Models.List", b =>
                {
                    b.Navigation("Compositions");

                    b.Navigation("Followers");

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