protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .UseCollation("SQL_Latin1_General_CP1254_CI_AS")
            .HasAnnotation("ProductVersion", "6.0.1")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

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

            modelBuilder.Entity("Kombicim.Data.Entities.ApiTokenEntity", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("smalldatetime");

                b.Property <string>("Token")
                .HasMaxLength(50)
                .IsUnicode(false)
                .HasColumnType("varchar(50)");

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

                b.HasKey("Id");

                b.HasIndex("UserId");

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

            modelBuilder.Entity("Kombicim.Data.Entities.ApiUserEntity", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

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

                b.Property <string>("Password")
                .HasMaxLength(500)
                .HasColumnType("nvarchar(500)");

                b.Property <string>("Username")
                .HasMaxLength(50)
                .HasColumnType("nvarchar(50)");

                b.HasKey("Id");

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

            modelBuilder.Entity("Kombicim.Data.Entities.CombiLogEntity", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("datetime2");

                b.Property <string>("DeviceId")
                .HasMaxLength(8)
                .IsUnicode(false)
                .HasColumnType("varchar(8)");

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

                b.HasKey("Id");

                b.HasIndex("DeviceId");

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

            modelBuilder.Entity("Kombicim.Data.Entities.CombiStateEntity", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("datetime2");

                b.Property <string>("DeviceId")
                .HasMaxLength(8)
                .IsUnicode(false)
                .HasColumnType("varchar(8)");

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

                b.HasKey("Id");

                b.HasIndex("DeviceId");

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

            modelBuilder.Entity("Kombicim.Data.Entities.DeviceEntity", b =>
            {
                b.Property <string>("Id")
                .HasMaxLength(8)
                .IsUnicode(false)
                .HasColumnType("varchar(8)");

                b.Property <string>("CenterDeviceId")
                .HasMaxLength(8)
                .IsUnicode(false)
                .HasColumnType("varchar(8)");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("datetime2");

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

                b.Property <int?>("UserId")
                .HasColumnType("int");

                b.HasKey("Id");

                b.HasIndex("UserId");

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

            modelBuilder.Entity("Kombicim.Data.Entities.LocationEntity", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("datetime");

                b.Property <string>("DeviceId")
                .HasMaxLength(8)
                .IsUnicode(false)
                .HasColumnType("varchar(8)");

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

                b.HasKey("Id");

                b.HasIndex("DeviceId");

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

            modelBuilder.Entity("Kombicim.Data.Entities.MinTemperatureEntity", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("datetime2");

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

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

                b.Property <double>("Value")
                .HasColumnType("float");

                b.HasKey("Id");

                b.HasIndex("LocationId");

                b.HasIndex("ProfileId");

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

            modelBuilder.Entity("Kombicim.Data.Entities.ProfileEntity", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("UserId");

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

            modelBuilder.Entity("Kombicim.Data.Entities.ProfilePreferenceEntity", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <int?>("ActiveProfileId")
                .HasColumnType("int");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("datetime2");

                b.Property <string>("DeviceId")
                .HasMaxLength(8)
                .IsUnicode(false)
                .HasColumnType("varchar(8)");

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

                b.HasKey("Id");

                b.HasIndex("DeviceId");

                b.HasIndex("ProfileId");

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

            modelBuilder.Entity("Kombicim.Data.Entities.SettingEntity", b =>
            {
                b.Property <string>("Id")
                .HasMaxLength(8)
                .IsUnicode(false)
                .HasColumnType("varchar(8)");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("datetime2");

                b.Property <string>("DeviceId")
                .HasMaxLength(8)
                .IsUnicode(false)
                .HasColumnType("varchar(8)");

                b.HasKey("Id");

                b.HasIndex("DeviceId");

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

            modelBuilder.Entity("Kombicim.Data.Entities.UserEntity", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <string>("DeviceId")
                .HasMaxLength(8)
                .IsUnicode(false)
                .HasColumnType("varchar(8)");

                b.Property <string>("EmailAddress")
                .HasMaxLength(50)
                .HasColumnType("nvarchar(50)");

                b.Property <string>("FirstName")
                .HasMaxLength(50)
                .HasColumnType("nvarchar(50)");

                b.Property <string>("LastName")
                .HasMaxLength(50)
                .HasColumnType("nvarchar(50)");

                b.Property <string>("Password")
                .HasMaxLength(500)
                .HasColumnType("nvarchar(500)");

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

                b.HasKey("Id");

                b.HasIndex("DeviceId");

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

            modelBuilder.Entity("Kombicim.Data.Entities.WeatherEntity", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("datetime2");

                b.Property <double>("Humidity")
                .HasColumnType("float");

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

                b.Property <double>("Temperature")
                .HasColumnType("float");

                b.HasKey("Id");

                b.HasIndex("LocationId");

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

            modelBuilder.Entity("Kombicim.Data.Entities.ApiTokenEntity", b =>
            {
                b.HasOne("Kombicim.Data.Entities.UserEntity", "User")
                .WithMany("ApiTokens")
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired()
                .HasConstraintName("FK_ApiToken_User");

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

            modelBuilder.Entity("Kombicim.Data.Entities.CombiLogEntity", b =>
            {
                b.HasOne("Kombicim.Data.Entities.DeviceEntity", "Device")
                .WithMany("CombiLogs")
                .HasForeignKey("DeviceId")
                .OnDelete(DeleteBehavior.Restrict)
                .HasConstraintName("FK_CombiLog_Device");

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

            modelBuilder.Entity("Kombicim.Data.Entities.CombiStateEntity", b =>
            {
                b.HasOne("Kombicim.Data.Entities.DeviceEntity", "Device")
                .WithMany("CombiStates")
                .HasForeignKey("DeviceId")
                .OnDelete(DeleteBehavior.Restrict)
                .HasConstraintName("FK_CombiState_Device");

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

            modelBuilder.Entity("Kombicim.Data.Entities.DeviceEntity", b =>
            {
                b.HasOne("Kombicim.Data.Entities.UserEntity", "User")
                .WithMany("Devices")
                .HasForeignKey("UserId")
                .HasConstraintName("FK_Device_User");

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

            modelBuilder.Entity("Kombicim.Data.Entities.LocationEntity", b =>
            {
                b.HasOne("Kombicim.Data.Entities.DeviceEntity", "Device")
                .WithMany("Locations")
                .HasForeignKey("DeviceId")
                .OnDelete(DeleteBehavior.Restrict)
                .HasConstraintName("FK_Location_Device");

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

            modelBuilder.Entity("Kombicim.Data.Entities.MinTemperatureEntity", b =>
            {
                b.HasOne("Kombicim.Data.Entities.LocationEntity", "Location")
                .WithMany("MinTemperatures")
                .HasForeignKey("LocationId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired()
                .HasConstraintName("FK_MinTemperature_Location");

                b.HasOne("Kombicim.Data.Entities.ProfileEntity", "Profile")
                .WithMany("MinTemperatures")
                .HasForeignKey("ProfileId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired()
                .HasConstraintName("FK_MinTemperature_Profile");

                b.Navigation("Location");

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

            modelBuilder.Entity("Kombicim.Data.Entities.ProfileEntity", b =>
            {
                b.HasOne("Kombicim.Data.Entities.UserEntity", "User")
                .WithMany("Profiles")
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired()
                .HasConstraintName("FK_Profile_User");

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

            modelBuilder.Entity("Kombicim.Data.Entities.ProfilePreferenceEntity", b =>
            {
                b.HasOne("Kombicim.Data.Entities.DeviceEntity", "Device")
                .WithMany("ProfilePreferences")
                .HasForeignKey("DeviceId")
                .OnDelete(DeleteBehavior.Restrict)
                .HasConstraintName("FK_ProfilePreference_Device");

                b.HasOne("Kombicim.Data.Entities.ProfileEntity", "Profile")
                .WithMany("ProfilePreferences")
                .HasForeignKey("ProfileId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired()
                .HasConstraintName("FK_ProfilePreference_Profile");

                b.Navigation("Device");

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

            modelBuilder.Entity("Kombicim.Data.Entities.SettingEntity", b =>
            {
                b.HasOne("Kombicim.Data.Entities.DeviceEntity", "Device")
                .WithMany("Settings")
                .HasForeignKey("DeviceId")
                .OnDelete(DeleteBehavior.Restrict)
                .HasConstraintName("FK_Setting_Device");

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

            modelBuilder.Entity("Kombicim.Data.Entities.UserEntity", b =>
            {
                b.HasOne("Kombicim.Data.Entities.DeviceEntity", "Device")
                .WithMany("Users")
                .HasForeignKey("DeviceId")
                .OnDelete(DeleteBehavior.Restrict)
                .HasConstraintName("FK_User_Device");

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

            modelBuilder.Entity("Kombicim.Data.Entities.WeatherEntity", b =>
            {
                b.HasOne("Kombicim.Data.Entities.LocationEntity", "Location")
                .WithMany("Weathers")
                .HasForeignKey("LocationId")
                .IsRequired()
                .HasConstraintName("FK_Weather_Location");

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

            modelBuilder.Entity("Kombicim.Data.Entities.DeviceEntity", b =>
            {
                b.Navigation("CombiLogs");

                b.Navigation("CombiStates");

                b.Navigation("Locations");

                b.Navigation("ProfilePreferences");

                b.Navigation("Settings");

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

            modelBuilder.Entity("Kombicim.Data.Entities.LocationEntity", b =>
            {
                b.Navigation("MinTemperatures");

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

            modelBuilder.Entity("Kombicim.Data.Entities.ProfileEntity", b =>
            {
                b.Navigation("MinTemperatures");

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

            modelBuilder.Entity("Kombicim.Data.Entities.UserEntity", b =>
            {
                b.Navigation("ApiTokens");

                b.Navigation("Devices");

                b.Navigation("Profiles");
            });
#pragma warning restore 612, 618
        }
Пример #2
0
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.0")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
            {
                b.Property <string>("Id")
                .HasColumnType("nvarchar(450)");

                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<string>", 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 <string>("RoleId")
                .IsRequired()
                .HasColumnType("nvarchar(450)");

                b.HasKey("Id");

                b.HasIndex("RoleId");

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", 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 <string>("UserId")
                .IsRequired()
                .HasColumnType("nvarchar(450)");

                b.HasKey("Id");

                b.HasIndex("UserId");

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", 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 <string>("UserId")
                .IsRequired()
                .HasColumnType("nvarchar(450)");

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

                b.HasIndex("UserId");

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
            {
                b.Property <string>("UserId")
                .HasColumnType("nvarchar(450)");

                b.Property <string>("RoleId")
                .HasColumnType("nvarchar(450)");

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

                b.HasIndex("RoleId");

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
            {
                b.Property <string>("UserId")
                .HasColumnType("nvarchar(450)");

                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("Spotkick.Models.Artist", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

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

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

                b.Property <int?>("SongkickId")
                .HasColumnType("int");

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

                b.HasKey("Id");

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

            modelBuilder.Entity("Spotkick.Models.Playlist", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <string>("OwnedById")
                .HasColumnType("nvarchar(450)");

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

                b.HasKey("Id");

                b.HasIndex("OwnedById");

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

            modelBuilder.Entity("Spotkick.Models.Spotify.User.Token", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <long>("ExpiresIn")
                .HasColumnType("bigint");

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

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

                b.HasKey("Id");

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

            modelBuilder.Entity("Spotkick.Models.User", b =>
            {
                b.Property <string>("Id")
                .HasColumnType("nvarchar(450)");

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

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

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

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

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

                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>("SecurityStamp")
                .HasColumnType("nvarchar(max)");

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

                b.Property <int?>("TokenId")
                .HasColumnType("int");

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

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

                b.HasKey("Id");

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

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

                b.HasIndex("TokenId");

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

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
            {
                b.HasOne("Spotkick.Models.User", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
            {
                b.HasOne("Spotkick.Models.User", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

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

                b.HasOne("Spotkick.Models.User", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
            {
                b.HasOne("Spotkick.Models.User", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Spotkick.Models.Playlist", b =>
            {
                b.HasOne("Spotkick.Models.User", "OwnedBy")
                .WithMany("Playlists")
                .HasForeignKey("OwnedById");

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

            modelBuilder.Entity("Spotkick.Models.User", b =>
            {
                b.HasOne("Spotkick.Models.Spotify.User.Token", "Token")
                .WithMany()
                .HasForeignKey("TokenId");

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

            modelBuilder.Entity("Spotkick.Models.User", b =>
            {
                b.Navigation("Playlists");
            });
#pragma warning restore 612, 618
        }
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.4")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

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

            modelBuilder.Entity("DXTestCafe.TestProject.Models.ContentPost", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

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

                b.Property <string>("OwnerId")
                .HasColumnType("nvarchar(450)");

                b.Property <DateTime>("PostDate")
                .HasColumnType("datetime2");

                b.Property <string>("SEOName")
                .HasMaxLength(100)
                .HasColumnType("nvarchar(100)");

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

                b.HasKey("Id");

                b.HasIndex("OwnerId");

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

            modelBuilder.Entity("DXTestCafe.TestProject.Models.ContentReply", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <string>("OwnerId")
                .HasColumnType("nvarchar(450)");

                b.Property <DateTime>("PostDate")
                .HasColumnType("datetime2");

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

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

                b.HasKey("Id");

                b.HasIndex("OwnerId");

                b.HasIndex("PostId");

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
            {
                b.Property <string>("Id")
                .HasColumnType("nvarchar(450)");

                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<string>", 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 <string>("RoleId")
                .IsRequired()
                .HasColumnType("nvarchar(450)");

                b.HasKey("Id");

                b.HasIndex("RoleId");

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
            {
                b.Property <string>("Id")
                .HasColumnType("nvarchar(450)");

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

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

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

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

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

                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>("SecurityStamp")
                .HasColumnType("nvarchar(max)");

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

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

                b.HasKey("Id");

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

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

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

                b.HasDiscriminator <string>("Discriminator").HasValue("IdentityUser");
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", 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 <string>("UserId")
                .IsRequired()
                .HasColumnType("nvarchar(450)");

                b.HasKey("Id");

                b.HasIndex("UserId");

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", 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 <string>("UserId")
                .IsRequired()
                .HasColumnType("nvarchar(450)");

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

                b.HasIndex("UserId");

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
            {
                b.Property <string>("UserId")
                .HasColumnType("nvarchar(450)");

                b.Property <string>("RoleId")
                .HasColumnType("nvarchar(450)");

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

                b.HasIndex("RoleId");

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
            {
                b.Property <string>("UserId")
                .HasColumnType("nvarchar(450)");

                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("DXTestCafe.TestProject.Models.ApplicationUser", b =>
            {
                b.HasBaseType("Microsoft.AspNetCore.Identity.IdentityUser");

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

                b.Property <string>("Nickname")
                .HasColumnType("nvarchar(450)");

                b.Property <string>("SEOName")
                .HasMaxLength(100)
                .HasColumnType("nvarchar(100)");

                b.HasIndex("Nickname")
                .IsUnique()
                .HasFilter("[Nickname] IS NOT NULL");

                b.HasIndex("SEOName")
                .IsUnique()
                .HasFilter("[SEOName] IS NOT NULL");

                b.HasDiscriminator().HasValue("ApplicationUser");
            });

            modelBuilder.Entity("DXTestCafe.TestProject.Models.ContentPost", b =>
            {
                b.HasOne("DXTestCafe.TestProject.Models.ApplicationUser", "Owner")
                .WithMany("OwnedPosts")
                .HasForeignKey("OwnerId")
                .OnDelete(DeleteBehavior.Restrict);

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

            modelBuilder.Entity("DXTestCafe.TestProject.Models.ContentReply", b =>
            {
                b.HasOne("DXTestCafe.TestProject.Models.ApplicationUser", "Owner")
                .WithMany("OwnedReplies")
                .HasForeignKey("OwnerId")
                .OnDelete(DeleteBehavior.Cascade);

                b.HasOne("DXTestCafe.TestProject.Models.ContentPost", "Post")
                .WithMany("Comments")
                .HasForeignKey("PostId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Owner");

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

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
            {
                b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
            {
                b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

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

                b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
            {
                b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("DXTestCafe.TestProject.Models.ContentPost", b =>
            {
                b.Navigation("Comments");
            });

            modelBuilder.Entity("DXTestCafe.TestProject.Models.ApplicationUser", b =>
            {
                b.Navigation("OwnedPosts");

                b.Navigation("OwnedReplies");
            });
#pragma warning restore 612, 618
        }
Пример #4
0
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.1")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

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

            modelBuilder.Entity("ProductAndServices.Models.Product", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <string>("Description")
                .IsRequired()
                .HasMaxLength(250)
                .HasColumnType("nvarchar(250)");

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

                b.Property <decimal>("Price")
                .HasColumnType("decimal(18,2)");

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

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

                b.HasKey("Id");

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

            modelBuilder.Entity("ProductAndServices.Models.Service", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <string>("Description")
                .IsRequired()
                .HasMaxLength(250)
                .HasColumnType("nvarchar(250)");

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

                b.Property <double>("Price")
                .HasColumnType("float");

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

                b.HasKey("Id");

                b.ToTable("Service", (string)null);
            });
#pragma warning restore 612, 618
        }
Пример #5
0
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.3")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

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

            modelBuilder.Entity("Telegram.Messaging.Db.FieldType", b =>
            {
                b.Property <int>("Id")
                .HasColumnType("int");

                b.Property <string>("Name")
                .IsRequired()
                .HasColumnType("nvarchar(450)");

                b.HasKey("Id");

                b.HasAlternateKey("Name");

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

            modelBuilder.Entity("Telegram.Messaging.Db.Question", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

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

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

                b.Property <DateTime>("CreatedUtc")
                .HasColumnType("datetime2");

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

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

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

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

                b.Property <string>("FollowUpSeparator")
                .HasMaxLength(10)
                .HasColumnType("nvarchar(10)");

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

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

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("FieldTypeId");

                b.HasIndex("SurveyId");

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

            modelBuilder.Entity("Telegram.Messaging.Db.Survey", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <DateTime>("CreatedUtc")
                .HasColumnType("datetime2");

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

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

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

                b.Property <DateTime>("LastInteractionUtc")
                .HasColumnType("datetime2");

                b.Property <int?>("TelegramMessageId")
                .HasColumnType("int");

                b.Property <long>("TelegramUserId")
                .HasColumnType("bigint");

                b.HasKey("Id");

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

            modelBuilder.Entity("Telegram.Messaging.Db.Question", b =>
            {
                b.HasOne("Telegram.Messaging.Db.FieldType", "FieldType")
                .WithMany()
                .HasForeignKey("FieldTypeId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Telegram.Messaging.Db.Survey", "Survey")
                .WithMany("Questions")
                .HasForeignKey("SurveyId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("FieldType");

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

            modelBuilder.Entity("Telegram.Messaging.Db.Survey", b =>
            {
                b.Navigation("Questions");
            });
#pragma warning restore 612, 618
        }
Пример #6
0
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.1")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

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

            modelBuilder.Entity("RDMG.Core.Domain.Dungeon", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

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

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

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

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

                b.Property <byte[]>("Timestamp")
                .IsConcurrencyToken()
                .ValueGeneratedOnAddOrUpdate()
                .HasColumnType("rowversion");

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

                b.HasKey("Id");

                b.HasIndex("DungeonOptionId");

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

            modelBuilder.Entity("RDMG.Core.Domain.DungeonOption", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <DateTime>("Created")
                .HasColumnType("datetime2");

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

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

                b.Property <string>("DungeonName")
                .HasColumnType("nvarchar(450)");

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

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

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

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

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

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

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

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

                b.Property <byte[]>("Timestamp")
                .IsConcurrencyToken()
                .ValueGeneratedOnAddOrUpdate()
                .HasColumnType("rowversion");

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

                b.Property <double>("TreasureValue")
                .HasColumnType("float");

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

                b.HasKey("Id");

                b.HasIndex("UserId");

                b.HasIndex("DungeonName", "UserId")
                .IsUnique()
                .HasFilter("[DungeonName] IS NOT NULL");

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

            modelBuilder.Entity("RDMG.Core.Domain.Option", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <string>("Key")
                .IsRequired()
                .HasColumnType("nvarchar(450)");

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

                b.Property <byte[]>("Timestamp")
                .IsConcurrencyToken()
                .ValueGeneratedOnAddOrUpdate()
                .HasColumnType("rowversion");

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

                b.HasKey("Id");

                b.HasIndex("Key", "Name")
                .IsUnique()
                .HasFilter("[Name] IS NOT NULL");

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

            modelBuilder.Entity("RDMG.Core.Domain.User", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

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

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

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

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

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

                b.Property <byte[]>("Timestamp")
                .IsConcurrencyToken()
                .ValueGeneratedOnAddOrUpdate()
                .HasColumnType("rowversion");

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

                b.HasKey("Id");

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

            modelBuilder.Entity("RDMG.Core.Domain.Dungeon", b =>
            {
                b.HasOne("RDMG.Core.Domain.DungeonOption", "DungeonOption")
                .WithMany()
                .HasForeignKey("DungeonOptionId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("RDMG.Core.Domain.DungeonOption", b =>
            {
                b.HasOne("RDMG.Core.Domain.User", "User")
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("User");
            });
#pragma warning restore 612, 618
        }
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.0")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

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

            modelBuilder.HasSequence("catalog_brand_hilo")
            .IncrementsBy(10);

            modelBuilder.HasSequence("catalog_hilo")
            .IncrementsBy(10);

            modelBuilder.HasSequence("catalog_type_hilo")
            .IncrementsBy(10);

            modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.Basket", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.HasKey("Id");

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

            modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.BasketItem", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

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

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

                b.Property <decimal>("UnitPrice")
                .HasColumnType("decimal(18,2)");

                b.HasKey("Id");

                b.HasIndex("BasketId");

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

            modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogBrand", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseHiLo(b.Property <int>("Id"), "catalog_brand_hilo");

                b.Property <string>("Brand")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("nvarchar(100)");

                b.HasKey("Id");

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

            modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogItem", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseHiLo(b.Property <int>("Id"), "catalog_hilo");

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

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

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

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

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

                b.Property <decimal>("Price")
                .HasColumnType("decimal(18,2)");

                b.HasKey("Id");

                b.HasIndex("CatalogBrandId");

                b.HasIndex("CatalogTypeId");

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

            modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogType", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseHiLo(b.Property <int>("Id"), "catalog_type_hilo");

                b.Property <string>("Type")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("nvarchar(100)");

                b.HasKey("Id");

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

            modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Order", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

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

                b.HasKey("Id");

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

            modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.OrderItem", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <int?>("OrderId")
                .HasColumnType("int");

                b.Property <decimal>("UnitPrice")
                .HasColumnType("decimal(18,2)");

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

                b.HasKey("Id");

                b.HasIndex("OrderId");

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

            modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.BasketItem", b =>
            {
                b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.Basket", null)
                .WithMany("Items")
                .HasForeignKey("BasketId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogItem", b =>
            {
                b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogBrand", "CatalogBrand")
                .WithMany()
                .HasForeignKey("CatalogBrandId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.CatalogType", "CatalogType")
                .WithMany()
                .HasForeignKey("CatalogTypeId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("CatalogBrand");

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

            modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Order", b =>
            {
                b.OwnsOne("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Address", "ShipToAddress", b1 =>
                {
                    b1.Property <int>("OrderId")
                    .HasColumnType("int");

                    b1.Property <string>("City")
                    .IsRequired()
                    .HasMaxLength(100)
                    .HasColumnType("nvarchar(100)");

                    b1.Property <string>("Country")
                    .IsRequired()
                    .HasMaxLength(90)
                    .HasColumnType("nvarchar(90)");

                    b1.Property <string>("State")
                    .HasMaxLength(60)
                    .HasColumnType("nvarchar(60)");

                    b1.Property <string>("Street")
                    .IsRequired()
                    .HasMaxLength(180)
                    .HasColumnType("nvarchar(180)");

                    b1.Property <string>("ZipCode")
                    .IsRequired()
                    .HasMaxLength(18)
                    .HasColumnType("nvarchar(18)");

                    b1.HasKey("OrderId");

                    b1.ToTable("Orders");

                    b1.WithOwner()
                    .HasForeignKey("OrderId");
                });

                b.Navigation("ShipToAddress")
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.OrderItem", b =>
            {
                b.HasOne("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Order", null)
                .WithMany("OrderItems")
                .HasForeignKey("OrderId");

                b.OwnsOne("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.CatalogItemOrdered", "ItemOrdered", b1 =>
                {
                    b1.Property <int>("OrderItemId")
                    .HasColumnType("int");

                    b1.Property <int>("CatalogItemId")
                    .HasColumnType("int");

                    b1.Property <string>("PictureUri")
                    .HasColumnType("nvarchar(max)");

                    b1.Property <string>("ProductName")
                    .IsRequired()
                    .HasMaxLength(50)
                    .HasColumnType("nvarchar(50)");

                    b1.HasKey("OrderItemId");

                    b1.ToTable("OrderItems");

                    b1.WithOwner()
                    .HasForeignKey("OrderItemId");
                });

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

            modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate.Basket", b =>
            {
                b.Navigation("Items");
            });

            modelBuilder.Entity("Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate.Order", b =>
            {
                b.Navigation("OrderItems");
            });
#pragma warning restore 612, 618
        }
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.0")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

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

            modelBuilder.Entity("Application_Database.TblApiRequest", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <string>("Path")
                .HasMaxLength(100)
                .HasColumnType("nvarchar(100)");

                b.Property <string>("QueryString")
                .HasMaxLength(500)
                .HasColumnType("nvarchar(500)");

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

                b.Property <DateTime?>("RequestDate")
                .ValueGeneratedOnAdd()
                .HasColumnType("datetime")
                .HasDefaultValueSql("(getdate())");

                b.Property <string>("Scheme")
                .HasMaxLength(100)
                .HasColumnType("nvarchar(100)");

                b.Property <int?>("Userid")
                .HasColumnType("int");

                b.HasKey("Id");

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

            modelBuilder.Entity("Application_Database.TblApiResponse", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <int?>("RequestId")
                .HasColumnType("int");

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

                b.Property <DateTime?>("ResponseDate")
                .HasColumnType("datetime");

                b.Property <int?>("UserId")
                .HasColumnType("int");

                b.HasKey("Id");

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

            modelBuilder.Entity("Application_Database.TblNotification", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <DateTime?>("CreatedDate")
                .ValueGeneratedOnAdd()
                .HasColumnType("datetime")
                .HasDefaultValueSql("(getdate())");

                b.Property <string>("FailDetails")
                .HasMaxLength(2000)
                .HasColumnType("nvarchar(2000)");

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

                b.Property <string>("MsgCc")
                .HasMaxLength(500)
                .HasColumnType("nvarchar(500)")
                .HasColumnName("MsgCC");

                b.Property <string>("MsgFrom")
                .HasMaxLength(200)
                .HasColumnType("nvarchar(200)");

                b.Property <string>("MsgSatus")
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnType("nvarchar(50)");

                b.Property <string>("MsgSubject")
                .IsRequired()
                .HasMaxLength(1000)
                .HasColumnType("nvarchar(1000)");

                b.Property <string>("MsgTo")
                .HasMaxLength(500)
                .HasColumnType("nvarchar(500)");

                b.Property <string>("MsgType")
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnType("nvarchar(50)");

                b.Property <DateTime?>("UpdatedDate")
                .HasColumnType("datetime");

                b.HasKey("Id");

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

            modelBuilder.Entity("Application_Database.TblRightmaster", b =>
            {
                b.Property <int>("RightId")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

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

                b.Property <DateTime>("CreatedOn")
                .HasColumnType("datetime2");

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

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

                b.Property <DateTime>("DeletedOn")
                .HasColumnType("datetime2");

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

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

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

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

                b.Property <DateTime>("ModifiedOn")
                .HasColumnType("datetime2");

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

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

                b.Property <DateTime>("RecordLockedOn")
                .HasColumnType("datetime2");

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

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

                b.HasKey("RightId");

                b.HasIndex(new[] { "RoleId" }, "IX_tbl_rightmaster_RoleId");

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

            modelBuilder.Entity("Application_Database.TblRolemaster", b =>
            {
                b.Property <int>("RoleId")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <DateTime>("CreatedOn")
                .HasColumnType("datetime2");

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

                b.Property <DateTime>("DeletedOn")
                .HasColumnType("datetime2");

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

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

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

                b.Property <DateTime>("ModifiedOn")
                .HasColumnType("datetime2");

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

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

                b.Property <DateTime>("RecordLockedOn")
                .HasColumnType("datetime2");

                b.Property <string>("RoleNmae")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("nvarchar(100)");

                b.HasKey("RoleId");

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

            modelBuilder.Entity("Application_Database.TblUsermaster", b =>
            {
                b.Property <int>("UserId")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <DateTime>("CreatedOn")
                .HasColumnType("datetime2");

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

                b.Property <DateTime>("DeletedOn")
                .HasColumnType("datetime2");

                b.Property <string>("EmailId")
                .IsRequired()
                .HasMaxLength(500)
                .HasColumnType("nvarchar(500)");

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

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

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

                b.Property <DateTime>("ModifiedOn")
                .HasColumnType("datetime2");

                b.Property <string>("Password")
                .IsRequired()
                .HasMaxLength(500)
                .HasColumnType("nvarchar(500)");

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

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

                b.Property <DateTime>("RecordLockedOn")
                .HasColumnType("datetime2");

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

                b.HasKey("UserId");

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

            modelBuilder.Entity("Application_Database.TblRightmaster", b =>
            {
                b.HasOne("Application_Database.TblRolemaster", "Role")
                .WithMany("TblRightmaster")
                .HasForeignKey("RoleId")
                .IsRequired()
                .HasConstraintName("FK_RoleRights_RoleId");

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

            modelBuilder.Entity("Application_Database.TblRolemaster", b =>
            {
                b.Navigation("TblRightmaster");
            });
#pragma warning restore 612, 618
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.1")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

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

            modelBuilder.Entity("Enrollment.Data.Entities.Academic", b =>
            {
                b.Property <int>("UserId")
                .HasColumnType("int");

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

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

                b.Property <DateTime>("FromDate")
                .HasColumnType("datetime2");

                b.Property <DateTime?>("GedDate")
                .HasColumnType("datetime2");

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

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

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

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

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

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

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

                b.Property <DateTime>("ToDate")
                .HasColumnType("datetime2");

                b.HasKey("UserId");

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

            modelBuilder.Entity("Enrollment.Data.Entities.Admissions", b =>
            {
                b.Property <int>("UserId")
                .HasColumnType("int");

                b.Property <string>("EnrollmentTerm")
                .IsRequired()
                .HasMaxLength(6)
                .HasColumnType("nvarchar(6)");

                b.Property <string>("EnrollmentYear")
                .IsRequired()
                .HasMaxLength(4)
                .HasColumnType("nvarchar(4)");

                b.Property <string>("EnteringStatus")
                .IsRequired()
                .HasMaxLength(1)
                .HasColumnType("nvarchar(1)");

                b.Property <string>("Program")
                .IsRequired()
                .HasMaxLength(55)
                .HasColumnType("nvarchar(55)");

                b.Property <string>("ProgramType")
                .IsRequired()
                .HasMaxLength(55)
                .HasColumnType("nvarchar(55)");

                b.HasKey("UserId");

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

            modelBuilder.Entity("Enrollment.Data.Entities.Certification", b =>
            {
                b.Property <int>("UserId")
                .HasColumnType("int");

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

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

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

                b.HasKey("UserId");

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

            modelBuilder.Entity("Enrollment.Data.Entities.ContactInfo", b =>
            {
                b.Property <int>("UserId")
                .HasColumnType("int");

                b.Property <DateTime>("DateOfBirth")
                .HasColumnType("datetime2");

                b.Property <string>("EnergencyContactFirstName")
                .IsRequired()
                .HasMaxLength(30)
                .HasColumnType("nvarchar(30)");

                b.Property <string>("EnergencyContactLastName")
                .IsRequired()
                .HasMaxLength(30)
                .HasColumnType("nvarchar(30)");

                b.Property <string>("EnergencyContactPhoneNumber")
                .IsRequired()
                .HasMaxLength(12)
                .HasColumnType("nvarchar(12)");

                b.Property <string>("EnergencyContactRelationship")
                .IsRequired()
                .HasMaxLength(30)
                .HasColumnType("nvarchar(30)");

                b.Property <string>("Ethnicity")
                .IsRequired()
                .HasMaxLength(3)
                .HasColumnType("nvarchar(3)");

                b.Property <string>("FormerFirstName")
                .HasMaxLength(30)
                .HasColumnType("nvarchar(30)");

                b.Property <string>("FormerLastName")
                .HasMaxLength(30)
                .HasColumnType("nvarchar(30)");

                b.Property <string>("FormerMiddleName")
                .HasMaxLength(30)
                .HasColumnType("nvarchar(30)");

                b.Property <string>("Gender")
                .IsRequired()
                .HasMaxLength(1)
                .HasColumnType("nvarchar(1)");

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

                b.Property <string>("Race")
                .IsRequired()
                .HasMaxLength(3)
                .HasColumnType("nvarchar(3)");

                b.Property <string>("SocialSecurityNumber")
                .IsRequired()
                .HasMaxLength(11)
                .HasColumnType("nvarchar(11)");

                b.HasKey("UserId");

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

            modelBuilder.Entity("Enrollment.Data.Entities.Institution", b =>
            {
                b.Property <int>("InstitutionId")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <string>("EndYear")
                .IsRequired()
                .HasMaxLength(4)
                .HasColumnType("nvarchar(4)");

                b.Property <string>("HighestDegreeEarned")
                .IsRequired()
                .HasMaxLength(4)
                .HasColumnType("nvarchar(4)");

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

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

                b.Property <DateTime?>("MonthYearGraduated")
                .HasColumnType("datetime2");

                b.Property <string>("StartYear")
                .IsRequired()
                .HasMaxLength(4)
                .HasColumnType("nvarchar(4)");

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

                b.HasKey("InstitutionId");

                b.HasIndex("UserId");

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

            modelBuilder.Entity("Enrollment.Data.Entities.LookUps", b =>
            {
                b.Property <int>("LookUpsID")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <string>("CharValue")
                .HasColumnType("nvarchar(1)");

                b.Property <DateTime?>("DateTimeValue")
                .HasColumnType("datetime2");

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

                b.Property <string>("ListName")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("nvarchar(100)");

                b.Property <double?>("NumericValue")
                .HasColumnType("float");

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

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

                b.Property <TimeSpan?>("TimeSpanValue")
                .HasColumnType("time");

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

                b.HasKey("LookUpsID");

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

            modelBuilder.Entity("Enrollment.Data.Entities.MoreInfo", b =>
            {
                b.Property <int>("UserId")
                .HasColumnType("int");

                b.Property <string>("GovernmentBenefits")
                .HasMaxLength(10)
                .HasColumnType("nvarchar(10)");

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

                b.Property <string>("MilitaryBranch")
                .HasMaxLength(4)
                .HasColumnType("nvarchar(4)");

                b.Property <string>("MilitaryStatus")
                .HasMaxLength(4)
                .HasColumnType("nvarchar(4)");

                b.Property <string>("OverallEducationalGoal")
                .IsRequired()
                .HasMaxLength(4)
                .HasColumnType("nvarchar(4)");

                b.Property <string>("ReasonForAttending")
                .IsRequired()
                .HasMaxLength(4)
                .HasColumnType("nvarchar(4)");

                b.Property <string>("VeteranType")
                .HasMaxLength(4)
                .HasColumnType("nvarchar(4)");

                b.HasKey("UserId");

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

            modelBuilder.Entity("Enrollment.Data.Entities.Personal", b =>
            {
                b.Property <int>("UserId")
                .HasColumnType("int");

                b.Property <string>("Address1")
                .IsRequired()
                .HasMaxLength(30)
                .HasColumnType("nvarchar(30)");

                b.Property <string>("Address2")
                .HasMaxLength(30)
                .HasColumnType("nvarchar(30)");

                b.Property <string>("CellPhone")
                .HasMaxLength(15)
                .HasColumnType("nvarchar(15)");

                b.Property <string>("City")
                .IsRequired()
                .HasMaxLength(30)
                .HasColumnType("nvarchar(30)");

                b.Property <string>("County")
                .HasMaxLength(25)
                .HasColumnType("nvarchar(25)");

                b.Property <string>("FirstName")
                .IsRequired()
                .HasMaxLength(30)
                .HasColumnType("nvarchar(30)");

                b.Property <string>("LastName")
                .IsRequired()
                .HasMaxLength(30)
                .HasColumnType("nvarchar(30)");

                b.Property <string>("MiddleName")
                .HasMaxLength(20)
                .HasColumnType("nvarchar(20)");

                b.Property <string>("OtherPhone")
                .HasMaxLength(15)
                .HasColumnType("nvarchar(15)");

                b.Property <string>("PrimaryEmail")
                .HasMaxLength(40)
                .HasColumnType("nvarchar(40)");

                b.Property <string>("State")
                .IsRequired()
                .HasMaxLength(25)
                .HasColumnType("nvarchar(25)");

                b.Property <string>("Suffix")
                .HasMaxLength(6)
                .HasColumnType("nvarchar(6)");

                b.Property <string>("ZipCode")
                .IsRequired()
                .HasMaxLength(5)
                .HasColumnType("nvarchar(5)");

                b.HasKey("UserId");

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

            modelBuilder.Entity("Enrollment.Data.Entities.Residency", b =>
            {
                b.Property <int>("UserId")
                .HasColumnType("int");

                b.Property <string>("CitizenshipStatus")
                .IsRequired()
                .HasMaxLength(6)
                .HasColumnType("nvarchar(6)");

                b.Property <string>("CountryOfCitizenship")
                .HasMaxLength(55)
                .HasColumnType("nvarchar(55)");

                b.Property <string>("DriversLicenseNumber")
                .HasMaxLength(25)
                .HasColumnType("nvarchar(25)");

                b.Property <string>("DriversLicenseState")
                .HasMaxLength(10)
                .HasColumnType("nvarchar(10)");

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

                b.Property <string>("ImmigrationStatus")
                .HasMaxLength(6)
                .HasColumnType("nvarchar(6)");

                b.Property <string>("ResidentState")
                .IsRequired()
                .HasMaxLength(55)
                .HasColumnType("nvarchar(55)");

                b.HasKey("UserId");

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

            modelBuilder.Entity("Enrollment.Data.Entities.StateLivedIn", b =>
            {
                b.Property <int>("StateLivedInId")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <string>("State")
                .IsRequired()
                .HasMaxLength(25)
                .HasColumnType("nvarchar(25)");

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

                b.HasKey("StateLivedInId");

                b.HasIndex("UserId");

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

            modelBuilder.Entity("Enrollment.Data.Entities.User", b =>
            {
                b.Property <int>("UserId")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.HasKey("UserId");

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

            modelBuilder.Entity("Enrollment.Data.Entities.Academic", b =>
            {
                b.HasOne("Enrollment.Data.Entities.User", "User")
                .WithOne("Academic")
                .HasForeignKey("Enrollment.Data.Entities.Academic", "UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Enrollment.Data.Entities.Admissions", b =>
            {
                b.HasOne("Enrollment.Data.Entities.User", "User")
                .WithOne("Admissions")
                .HasForeignKey("Enrollment.Data.Entities.Admissions", "UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Enrollment.Data.Entities.Certification", b =>
            {
                b.HasOne("Enrollment.Data.Entities.User", "User")
                .WithOne("Certification")
                .HasForeignKey("Enrollment.Data.Entities.Certification", "UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Enrollment.Data.Entities.ContactInfo", b =>
            {
                b.HasOne("Enrollment.Data.Entities.User", "User")
                .WithOne("ContactInfo")
                .HasForeignKey("Enrollment.Data.Entities.ContactInfo", "UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Enrollment.Data.Entities.Institution", b =>
            {
                b.HasOne("Enrollment.Data.Entities.Academic", "Academic")
                .WithMany("Institutions")
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Enrollment.Data.Entities.MoreInfo", b =>
            {
                b.HasOne("Enrollment.Data.Entities.User", "User")
                .WithOne("MoreInfo")
                .HasForeignKey("Enrollment.Data.Entities.MoreInfo", "UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Enrollment.Data.Entities.Personal", b =>
            {
                b.HasOne("Enrollment.Data.Entities.User", "User")
                .WithOne("Personal")
                .HasForeignKey("Enrollment.Data.Entities.Personal", "UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Enrollment.Data.Entities.Residency", b =>
            {
                b.HasOne("Enrollment.Data.Entities.User", "User")
                .WithOne("Residency")
                .HasForeignKey("Enrollment.Data.Entities.Residency", "UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Enrollment.Data.Entities.StateLivedIn", b =>
            {
                b.HasOne("Enrollment.Data.Entities.Residency", "Residency")
                .WithMany("StatesLivedIn")
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Enrollment.Data.Entities.Academic", b =>
            {
                b.Navigation("Institutions");
            });

            modelBuilder.Entity("Enrollment.Data.Entities.Residency", b =>
            {
                b.Navigation("StatesLivedIn");
            });

            modelBuilder.Entity("Enrollment.Data.Entities.User", b =>
            {
                b.Navigation("Academic");

                b.Navigation("Admissions");

                b.Navigation("Certification");

                b.Navigation("ContactInfo");

                b.Navigation("MoreInfo");

                b.Navigation("Personal");

                b.Navigation("Residency");
            });
#pragma warning restore 612, 618
        }
Пример #10
0
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasDefaultSchema("dbo")
            .HasAnnotation("ProductVersion", "1.1.2");

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

            modelBuilder.Entity("ATag.Core.Tag", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int")
                .HasColumnName("Id");

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

                b.Property <int>("CreatedByUserId")
                .HasColumnType("int")
                .HasColumnName("CreatedByUserId");

                b.Property <DateTime>("CreatedOn")
                .HasColumnType("datetime2")
                .HasColumnName("CreatedOn");

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

                b.Property <int?>("ModifiedByUserId")
                .HasColumnType("int")
                .HasColumnName("ModifiedByUserId");

                b.Property <DateTime?>("ModifiedOn")
                .HasColumnType("datetime2")
                .HasColumnName("ModifiedOn");

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

                b.Property <string>("OwnerId")
                .HasMaxLength(30)
                .IsUnicode(false)
                .HasColumnType("varchar(30)")
                .HasColumnName("OwnerId");

                b.Property <int>("OwnerType")
                .HasColumnType("int")
                .HasColumnName("OwnerType");

                b.HasKey("Id");

                b.HasIndex("OwnerType", "OwnerId")
                .HasDatabaseName("IX_Tag_OwnerType_OwnerId");

                b.ToTable("Tag", "dbo");
            });

            modelBuilder.Entity("ATag.Core.TaggedEntity", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int")
                .HasColumnName("Id");

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

                b.Property <int>("CreatedByUserId")
                .HasColumnType("int")
                .HasColumnName("CreatedByUserId");

                b.Property <DateTime>("CreatedOn")
                .HasColumnType("datetime2")
                .HasColumnName("CreatedOn");

                b.Property <string>("EntityKey")
                .HasMaxLength(20)
                .IsUnicode(false)
                .HasColumnType("varchar(20)")
                .HasColumnName("EntityKey");

                b.Property <string>("EntityType")
                .HasMaxLength(30)
                .IsUnicode(false)
                .HasColumnType("varchar(30)")
                .HasColumnName("EntityType");

                b.Property <int>("TagId")
                .HasColumnType("int")
                .HasColumnName("TagId");

                b.HasKey("Id");

                b.HasIndex("TagId");

                b.HasIndex("EntityType", "EntityKey", "TagId")
                .HasDatabaseName("IX_TaggedEntity_EntityType_EntityKey_TagId");

                b.ToTable("TaggedEntity", "dbo");
            });

            modelBuilder.Entity("ATag.Core.TagNote", b =>
            {
                b.Property <int>("Id")
                .HasColumnType("int")
                .HasColumnName("Id");

                b.Property <int>("CreatedByUserId")
                .HasColumnType("int")
                .HasColumnName("CreatedByUserId");

                b.Property <DateTime>("CreatedOn")
                .HasColumnType("datetime2")
                .HasColumnName("CreatedOn");

                b.Property <int?>("ModifiedByUserId")
                .HasColumnType("int")
                .HasColumnName("ModifiedByUserId");

                b.Property <DateTime?>("ModifiedOn")
                .HasColumnType("datetime2")
                .HasColumnName("ModifiedOn");

                b.Property <string>("Note")
                .HasMaxLength(1000)
                .HasColumnType("nvarchar(1000)")
                .HasColumnName("Note");

                b.HasKey("Id");

                b.ToTable("TagNote", "dbo");
            });

            modelBuilder.Entity("ATag.Core.TaggedEntity", b =>
            {
                b.HasOne("ATag.Core.Tag", "Tag")
                .WithMany("TaggedEntities")
                .HasForeignKey("TagId")
                .OnDelete(DeleteBehavior.Cascade);

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

            modelBuilder.Entity("ATag.Core.TagNote", b =>
            {
                b.HasOne("ATag.Core.TaggedEntity", "TaggedEntity")
                .WithOne("TagNote")
                .HasForeignKey("ATag.Core.TagNote", "Id")
                .OnDelete(DeleteBehavior.Cascade);

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

            modelBuilder.Entity("ATag.Core.Tag", b =>
            {
                b.Navigation("TaggedEntities");
            });

            modelBuilder.Entity("ATag.Core.TaggedEntity", b =>
            {
                b.Navigation("TagNote");
            });
#pragma warning restore 612, 618
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.1")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

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

            modelBuilder.Entity("WebAppWithAppInsights.Data.Book", b =>
            {
                b.Property <int>("BookId")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <string>("Publisher")
                .HasMaxLength(25)
                .HasColumnType("nvarchar(25)");

                b.Property <string>("Title")
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnType("nvarchar(50)");

                b.HasKey("BookId");

                b.ToTable("Books");

                b.HasData(
                    new
                {
                    BookId    = 1,
                    Publisher = "Sample Pub",
                    Title     = "book 1"
                },
                    new
                {
                    BookId    = 2,
                    Publisher = "Sample Pub",
                    Title     = "book 2"
                },
                    new
                {
                    BookId    = 3,
                    Publisher = "Sample Pub",
                    Title     = "book 3"
                },
                    new
                {
                    BookId    = 4,
                    Publisher = "Sample Pub",
                    Title     = "book 4"
                },
                    new
                {
                    BookId    = 5,
                    Publisher = "Sample Pub",
                    Title     = "book 5"
                },
                    new
                {
                    BookId    = 6,
                    Publisher = "Sample Pub",
                    Title     = "book 6"
                },
                    new
                {
                    BookId    = 7,
                    Publisher = "Sample Pub",
                    Title     = "book 7"
                },
                    new
                {
                    BookId    = 8,
                    Publisher = "Sample Pub",
                    Title     = "book 8"
                },
                    new
                {
                    BookId    = 9,
                    Publisher = "Sample Pub",
                    Title     = "book 9"
                },
                    new
                {
                    BookId    = 10,
                    Publisher = "Sample Pub",
                    Title     = "book 10"
                },
                    new
                {
                    BookId    = 11,
                    Publisher = "Sample Pub",
                    Title     = "book 11"
                },
                    new
                {
                    BookId    = 12,
                    Publisher = "Sample Pub",
                    Title     = "book 12"
                },
                    new
                {
                    BookId    = 13,
                    Publisher = "Sample Pub",
                    Title     = "book 13"
                },
                    new
                {
                    BookId    = 14,
                    Publisher = "Sample Pub",
                    Title     = "book 14"
                },
                    new
                {
                    BookId    = 15,
                    Publisher = "Sample Pub",
                    Title     = "book 15"
                },
                    new
                {
                    BookId    = 16,
                    Publisher = "Sample Pub",
                    Title     = "book 16"
                },
                    new
                {
                    BookId    = 17,
                    Publisher = "Sample Pub",
                    Title     = "book 17"
                },
                    new
                {
                    BookId    = 18,
                    Publisher = "Sample Pub",
                    Title     = "book 18"
                },
                    new
                {
                    BookId    = 19,
                    Publisher = "Sample Pub",
                    Title     = "book 19"
                },
                    new
                {
                    BookId    = 20,
                    Publisher = "Sample Pub",
                    Title     = "book 20"
                },
                    new
                {
                    BookId    = 21,
                    Publisher = "Sample Pub",
                    Title     = "book 21"
                },
                    new
                {
                    BookId    = 22,
                    Publisher = "Sample Pub",
                    Title     = "book 22"
                },
                    new
                {
                    BookId    = 23,
                    Publisher = "Sample Pub",
                    Title     = "book 23"
                },
                    new
                {
                    BookId    = 24,
                    Publisher = "Sample Pub",
                    Title     = "book 24"
                },
                    new
                {
                    BookId    = 25,
                    Publisher = "Sample Pub",
                    Title     = "book 25"
                },
                    new
                {
                    BookId    = 26,
                    Publisher = "Sample Pub",
                    Title     = "book 26"
                },
                    new
                {
                    BookId    = 27,
                    Publisher = "Sample Pub",
                    Title     = "book 27"
                },
                    new
                {
                    BookId    = 28,
                    Publisher = "Sample Pub",
                    Title     = "book 28"
                },
                    new
                {
                    BookId    = 29,
                    Publisher = "Sample Pub",
                    Title     = "book 29"
                },
                    new
                {
                    BookId    = 30,
                    Publisher = "Sample Pub",
                    Title     = "book 30"
                },
                    new
                {
                    BookId    = 31,
                    Publisher = "Sample Pub",
                    Title     = "book 31"
                },
                    new
                {
                    BookId    = 32,
                    Publisher = "Sample Pub",
                    Title     = "book 32"
                },
                    new
                {
                    BookId    = 33,
                    Publisher = "Sample Pub",
                    Title     = "book 33"
                },
                    new
                {
                    BookId    = 34,
                    Publisher = "Sample Pub",
                    Title     = "book 34"
                },
                    new
                {
                    BookId    = 35,
                    Publisher = "Sample Pub",
                    Title     = "book 35"
                },
                    new
                {
                    BookId    = 36,
                    Publisher = "Sample Pub",
                    Title     = "book 36"
                },
                    new
                {
                    BookId    = 37,
                    Publisher = "Sample Pub",
                    Title     = "book 37"
                },
                    new
                {
                    BookId    = 38,
                    Publisher = "Sample Pub",
                    Title     = "book 38"
                },
                    new
                {
                    BookId    = 39,
                    Publisher = "Sample Pub",
                    Title     = "book 39"
                },
                    new
                {
                    BookId    = 40,
                    Publisher = "Sample Pub",
                    Title     = "book 40"
                },
                    new
                {
                    BookId    = 41,
                    Publisher = "Sample Pub",
                    Title     = "book 41"
                },
                    new
                {
                    BookId    = 42,
                    Publisher = "Sample Pub",
                    Title     = "book 42"
                },
                    new
                {
                    BookId    = 43,
                    Publisher = "Sample Pub",
                    Title     = "book 43"
                },
                    new
                {
                    BookId    = 44,
                    Publisher = "Sample Pub",
                    Title     = "book 44"
                },
                    new
                {
                    BookId    = 45,
                    Publisher = "Sample Pub",
                    Title     = "book 45"
                },
                    new
                {
                    BookId    = 46,
                    Publisher = "Sample Pub",
                    Title     = "book 46"
                },
                    new
                {
                    BookId    = 47,
                    Publisher = "Sample Pub",
                    Title     = "book 47"
                },
                    new
                {
                    BookId    = 48,
                    Publisher = "Sample Pub",
                    Title     = "book 48"
                },
                    new
                {
                    BookId    = 49,
                    Publisher = "Sample Pub",
                    Title     = "book 49"
                },
                    new
                {
                    BookId    = 50,
                    Publisher = "Sample Pub",
                    Title     = "book 50"
                },
                    new
                {
                    BookId    = 51,
                    Publisher = "Sample Pub",
                    Title     = "book 51"
                },
                    new
                {
                    BookId    = 52,
                    Publisher = "Sample Pub",
                    Title     = "book 52"
                },
                    new
                {
                    BookId    = 53,
                    Publisher = "Sample Pub",
                    Title     = "book 53"
                },
                    new
                {
                    BookId    = 54,
                    Publisher = "Sample Pub",
                    Title     = "book 54"
                },
                    new
                {
                    BookId    = 55,
                    Publisher = "Sample Pub",
                    Title     = "book 55"
                },
                    new
                {
                    BookId    = 56,
                    Publisher = "Sample Pub",
                    Title     = "book 56"
                },
                    new
                {
                    BookId    = 57,
                    Publisher = "Sample Pub",
                    Title     = "book 57"
                },
                    new
                {
                    BookId    = 58,
                    Publisher = "Sample Pub",
                    Title     = "book 58"
                },
                    new
                {
                    BookId    = 59,
                    Publisher = "Sample Pub",
                    Title     = "book 59"
                },
                    new
                {
                    BookId    = 60,
                    Publisher = "Sample Pub",
                    Title     = "book 60"
                },
                    new
                {
                    BookId    = 61,
                    Publisher = "Sample Pub",
                    Title     = "book 61"
                },
                    new
                {
                    BookId    = 62,
                    Publisher = "Sample Pub",
                    Title     = "book 62"
                },
                    new
                {
                    BookId    = 63,
                    Publisher = "Sample Pub",
                    Title     = "book 63"
                },
                    new
                {
                    BookId    = 64,
                    Publisher = "Sample Pub",
                    Title     = "book 64"
                },
                    new
                {
                    BookId    = 65,
                    Publisher = "Sample Pub",
                    Title     = "book 65"
                },
                    new
                {
                    BookId    = 66,
                    Publisher = "Sample Pub",
                    Title     = "book 66"
                },
                    new
                {
                    BookId    = 67,
                    Publisher = "Sample Pub",
                    Title     = "book 67"
                },
                    new
                {
                    BookId    = 68,
                    Publisher = "Sample Pub",
                    Title     = "book 68"
                },
                    new
                {
                    BookId    = 69,
                    Publisher = "Sample Pub",
                    Title     = "book 69"
                },
                    new
                {
                    BookId    = 70,
                    Publisher = "Sample Pub",
                    Title     = "book 70"
                },
                    new
                {
                    BookId    = 71,
                    Publisher = "Sample Pub",
                    Title     = "book 71"
                },
                    new
                {
                    BookId    = 72,
                    Publisher = "Sample Pub",
                    Title     = "book 72"
                },
                    new
                {
                    BookId    = 73,
                    Publisher = "Sample Pub",
                    Title     = "book 73"
                },
                    new
                {
                    BookId    = 74,
                    Publisher = "Sample Pub",
                    Title     = "book 74"
                },
                    new
                {
                    BookId    = 75,
                    Publisher = "Sample Pub",
                    Title     = "book 75"
                },
                    new
                {
                    BookId    = 76,
                    Publisher = "Sample Pub",
                    Title     = "book 76"
                },
                    new
                {
                    BookId    = 77,
                    Publisher = "Sample Pub",
                    Title     = "book 77"
                },
                    new
                {
                    BookId    = 78,
                    Publisher = "Sample Pub",
                    Title     = "book 78"
                },
                    new
                {
                    BookId    = 79,
                    Publisher = "Sample Pub",
                    Title     = "book 79"
                },
                    new
                {
                    BookId    = 80,
                    Publisher = "Sample Pub",
                    Title     = "book 80"
                },
                    new
                {
                    BookId    = 81,
                    Publisher = "Sample Pub",
                    Title     = "book 81"
                },
                    new
                {
                    BookId    = 82,
                    Publisher = "Sample Pub",
                    Title     = "book 82"
                },
                    new
                {
                    BookId    = 83,
                    Publisher = "Sample Pub",
                    Title     = "book 83"
                },
                    new
                {
                    BookId    = 84,
                    Publisher = "Sample Pub",
                    Title     = "book 84"
                },
                    new
                {
                    BookId    = 85,
                    Publisher = "Sample Pub",
                    Title     = "book 85"
                },
                    new
                {
                    BookId    = 86,
                    Publisher = "Sample Pub",
                    Title     = "book 86"
                },
                    new
                {
                    BookId    = 87,
                    Publisher = "Sample Pub",
                    Title     = "book 87"
                },
                    new
                {
                    BookId    = 88,
                    Publisher = "Sample Pub",
                    Title     = "book 88"
                },
                    new
                {
                    BookId    = 89,
                    Publisher = "Sample Pub",
                    Title     = "book 89"
                },
                    new
                {
                    BookId    = 90,
                    Publisher = "Sample Pub",
                    Title     = "book 90"
                },
                    new
                {
                    BookId    = 91,
                    Publisher = "Sample Pub",
                    Title     = "book 91"
                },
                    new
                {
                    BookId    = 92,
                    Publisher = "Sample Pub",
                    Title     = "book 92"
                },
                    new
                {
                    BookId    = 93,
                    Publisher = "Sample Pub",
                    Title     = "book 93"
                },
                    new
                {
                    BookId    = 94,
                    Publisher = "Sample Pub",
                    Title     = "book 94"
                },
                    new
                {
                    BookId    = 95,
                    Publisher = "Sample Pub",
                    Title     = "book 95"
                },
                    new
                {
                    BookId    = 96,
                    Publisher = "Sample Pub",
                    Title     = "book 96"
                },
                    new
                {
                    BookId    = 97,
                    Publisher = "Sample Pub",
                    Title     = "book 97"
                },
                    new
                {
                    BookId    = 98,
                    Publisher = "Sample Pub",
                    Title     = "book 98"
                },
                    new
                {
                    BookId    = 99,
                    Publisher = "Sample Pub",
                    Title     = "book 99"
                },
                    new
                {
                    BookId    = 100,
                    Publisher = "Sample Pub",
                    Title     = "book 100"
                });
            });
#pragma warning restore 612, 618
        }
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.2")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

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

            modelBuilder.Entity("FootballManager.Data.Models.Player", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <string>("Description")
                .IsRequired()
                .HasMaxLength(200)
                .HasColumnType("nvarchar(200)");

                b.Property <byte>("Endurance")
                .HasColumnType("tinyint");

                b.Property <string>("FullName")
                .IsRequired()
                .HasMaxLength(80)
                .HasColumnType("nvarchar(80)");

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

                b.Property <string>("Position")
                .IsRequired()
                .HasMaxLength(20)
                .HasColumnType("nvarchar(20)");

                b.Property <byte>("Speed")
                .HasColumnType("tinyint");

                b.HasKey("Id");

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

            modelBuilder.Entity("FootballManager.Data.Models.User", b =>
            {
                b.Property <string>("Id")
                .HasColumnType("nvarchar(450)");

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

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

                b.Property <string>("Username")
                .IsRequired()
                .HasMaxLength(20)
                .HasColumnType("nvarchar(20)");

                b.HasKey("Id");

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

            modelBuilder.Entity("FootballManager.Data.Models.UserPlayer", b =>
            {
                b.Property <string>("UserId")
                .HasColumnType("nvarchar(450)");

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

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

                b.HasIndex("PlayerId");

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

            modelBuilder.Entity("FootballManager.Data.Models.UserPlayer", b =>
            {
                b.HasOne("FootballManager.Data.Models.Player", "Player")
                .WithMany("UserPlayers")
                .HasForeignKey("PlayerId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("FootballManager.Data.Models.User", "User")
                .WithMany("UserPlayers")
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Player");

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

            modelBuilder.Entity("FootballManager.Data.Models.Player", b =>
            {
                b.Navigation("UserPlayers");
            });

            modelBuilder.Entity("FootballManager.Data.Models.User", b =>
            {
                b.Navigation("UserPlayers");
            });
#pragma warning restore 612, 618
        }
Пример #13
0
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.3")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

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

            modelBuilder.Entity("CSRO.Server.Entities.Entity.Role", b =>
            {
                b.Property <string>("Name")
                .HasMaxLength(50)
                .HasColumnType("nvarchar(50)");

                b.Property <DateTime?>("CreatedAt")
                .HasColumnType("datetime2");

                b.Property <string>("CreatedBy")
                .HasMaxLength(500)
                .HasColumnType("nvarchar(500)");

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

                b.Property <DateTime?>("ModifiedAt")
                .HasColumnType("datetime2");

                b.Property <string>("ModifiedBy")
                .HasMaxLength(500)
                .HasColumnType("nvarchar(500)");

                b.Property <byte[]>("RowVersion")
                .IsConcurrencyToken()
                .ValueGeneratedOnAddOrUpdate()
                .HasColumnType("rowversion");

                b.HasKey("Name");

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

                b.ToTable("Roles");

                b.HasData(
                    new
                {
                    Name      = "Admin",
                    CreatedAt = new DateTime(2021, 4, 16, 0, 0, 0, 0, DateTimeKind.Unspecified),
                    CreatedBy = "Script",
                    Id        = 1
                },
                    new
                {
                    Name      = "Contributor",
                    CreatedAt = new DateTime(2021, 4, 16, 0, 0, 0, 0, DateTimeKind.Unspecified),
                    CreatedBy = "Script",
                    Id        = 3
                },
                    new
                {
                    Name      = "User",
                    CreatedAt = new DateTime(2021, 4, 16, 0, 0, 0, 0, DateTimeKind.Unspecified),
                    CreatedBy = "Script",
                    Id        = 5
                },
                    new
                {
                    Name      = "Reader",
                    CreatedAt = new DateTime(2021, 4, 16, 0, 0, 0, 0, DateTimeKind.Unspecified),
                    CreatedBy = "Script",
                    Id        = 4
                });
            });

            modelBuilder.Entity("CSRO.Server.Entities.Entity.User", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <DateTime?>("CreatedAt")
                .HasColumnType("datetime2");

                b.Property <string>("CreatedBy")
                .HasMaxLength(500)
                .HasColumnType("nvarchar(500)");

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

                b.Property <DateTime?>("ModifiedAt")
                .HasColumnType("datetime2");

                b.Property <string>("ModifiedBy")
                .HasMaxLength(500)
                .HasColumnType("nvarchar(500)");

                b.Property <byte[]>("RowVersion")
                .IsConcurrencyToken()
                .ValueGeneratedOnAddOrUpdate()
                .HasColumnType("rowversion");

                b.Property <string>("Username")
                .IsRequired()
                .HasMaxLength(200)
                .HasColumnType("nvarchar(200)");

                b.HasKey("Id");

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

                b.ToTable("Users");

                b.HasData(
                    new
                {
                    Id       = 1,
                    Username = "******"
                },
                    new
                {
                    Id       = 2,
                    Username = "******"
                });
            });

            modelBuilder.Entity("CSRO.Server.Entities.Entity.UserClaim", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <DateTime?>("CreatedAt")
                .HasColumnType("datetime2");

                b.Property <string>("CreatedBy")
                .HasMaxLength(500)
                .HasColumnType("nvarchar(500)");

                b.Property <DateTime?>("ModifiedAt")
                .HasColumnType("datetime2");

                b.Property <string>("ModifiedBy")
                .HasMaxLength(500)
                .HasColumnType("nvarchar(500)");

                b.Property <byte[]>("RowVersion")
                .IsConcurrencyToken()
                .ValueGeneratedOnAddOrUpdate()
                .HasColumnType("rowversion");

                b.Property <string>("Type")
                .IsRequired()
                .HasMaxLength(250)
                .HasColumnType("nvarchar(250)");

                b.Property <string>("UserName")
                .IsRequired()
                .HasColumnType("nvarchar(200)");

                b.Property <string>("Value")
                .IsRequired()
                .HasMaxLength(250)
                .HasColumnType("nvarchar(250)");

                b.HasKey("Id");

                b.HasIndex("UserName");

                b.ToTable("UserClaims");

                b.HasData(
                    new
                {
                    Id       = 1,
                    Type     = "CanApproveAdoRequest-Csro-Claim",
                    UserName = "******",
                    Value    = "True"
                },
                    new
                {
                    Id       = 2,
                    Type     = "CanReadAdoRequest-Csro-Claim",
                    UserName = "******",
                    Value    = "True"
                },
                    new
                {
                    Id       = 3,
                    Type     = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress",
                    UserName = "******",
                    Value    = "*****@*****.**"
                },
                    new
                {
                    Id       = 4,
                    Type     = "http://schemas.microsoft.com/ws/2008/06/identity/claims/role",
                    UserName = "******",
                    Value    = "Admin"
                },
                    new
                {
                    Id       = 21,
                    Type     = "CanReadAdoRequest-Csro-Claim",
                    UserName = "******",
                    Value    = "True"
                },
                    new
                {
                    Id       = 22,
                    Type     = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress",
                    UserName = "******",
                    Value    = "*****@*****.**"
                });
            });

            modelBuilder.Entity("CSRO.Server.Entities.Entity.UserRole", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <DateTime?>("CreatedAt")
                .HasColumnType("datetime2");

                b.Property <string>("CreatedBy")
                .HasMaxLength(500)
                .HasColumnType("nvarchar(500)");

                b.Property <DateTime?>("ModifiedAt")
                .HasColumnType("datetime2");

                b.Property <string>("ModifiedBy")
                .HasMaxLength(500)
                .HasColumnType("nvarchar(500)");

                b.Property <string>("RoleName")
                .HasColumnType("nvarchar(50)");

                b.Property <byte[]>("RowVersion")
                .IsConcurrencyToken()
                .ValueGeneratedOnAddOrUpdate()
                .HasColumnType("rowversion");

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

                b.HasKey("Id");

                b.HasIndex("RoleName");

                b.HasIndex("UserName");

                b.ToTable("UserRoles");

                b.HasData(
                    new
                {
                    Id       = 1,
                    RoleName = "Admin",
                    UserName = "******"
                });
            });

            modelBuilder.Entity("CSRO.Server.Entities.Entity.UserClaim", b =>
            {
                b.HasOne("CSRO.Server.Entities.Entity.User", "User")
                .WithMany("UserClaims")
                .HasForeignKey("UserName")
                .HasPrincipalKey("Username")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("CSRO.Server.Entities.Entity.UserRole", b =>
            {
                b.HasOne("CSRO.Server.Entities.Entity.Role", "Role")
                .WithMany()
                .HasForeignKey("RoleName");

                b.HasOne("CSRO.Server.Entities.Entity.User", "User")
                .WithMany("UserRoles")
                .HasForeignKey("UserName")
                .HasPrincipalKey("Username");

                b.Navigation("Role");

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

            modelBuilder.Entity("CSRO.Server.Entities.Entity.User", b =>
            {
                b.Navigation("UserClaims");

                b.Navigation("UserRoles");
            });
#pragma warning restore 612, 618
        }
Пример #14
0
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.3")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

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

            modelBuilder.Entity("APICatalogo.Models.Categoria", b =>
            {
                b.Property <int>("CategoriaId")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

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

                b.HasKey("CategoriaId");

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

            modelBuilder.Entity("APICatalogo.Models.Produto", b =>
            {
                b.Property <int>("ProdutoId")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <DateTime>("DataCadastro")
                .HasColumnType("datetime2");

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

                b.Property <float>("Estoque")
                .HasColumnType("real");

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

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

                b.Property <decimal>("Preco")
                .HasColumnType("decimal(18,2)");

                b.HasKey("ProdutoId");

                b.HasIndex("CategoriaId");

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

            modelBuilder.Entity("APICatalogo.Models.Produto", b =>
            {
                b.HasOne("APICatalogo.Models.Categoria", "Categoria")
                .WithMany("Produtos")
                .HasForeignKey("CategoriaId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("APICatalogo.Models.Categoria", b =>
            {
                b.Navigation("Produtos");
            });
#pragma warning restore 612, 618
        }
Пример #15
0
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.1")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

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

            modelBuilder.Entity("HintLib.Hint", b =>
            {
                b.Property <int>("HintId")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

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

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

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

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

                b.HasKey("HintId");

                b.HasIndex("HintDataId");

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

            modelBuilder.Entity("HintLib.HintProject", b =>
            {
                b.Property <int>("HintProjectId")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <string>("ProjectName")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("nvarchar(100)");

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

                b.HasKey("HintProjectId");

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

            modelBuilder.Entity("HintLib.ProjectFilename", b =>
            {
                b.Property <int>("ProjectFilenameId")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

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

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

                b.HasKey("ProjectFilenameId");

                b.HasIndex("HintProjectId");

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

            modelBuilder.Entity("HintLib.Hint", b =>
            {
                b.HasOne("HintLib.HintProject", "HintData")
                .WithMany("Data")
                .HasForeignKey("HintDataId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("HintLib.ProjectFilename", b =>
            {
                b.HasOne("HintLib.HintProject", "HintProject")
                .WithMany("ProjectFilenames")
                .HasForeignKey("HintProjectId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("HintLib.HintProject", b =>
            {
                b.Navigation("Data");

                b.Navigation("ProjectFilenames");
            });
#pragma warning restore 612, 618
        }
Пример #16
0
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.1")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

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

            modelBuilder.Entity("hitmanstat.us.Models.Event", b =>
            {
                b.Property <int>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <DateTime>("Date")
                .ValueGeneratedOnAdd()
                .HasColumnType("datetime2")
                .HasDefaultValueSql("getdate()");

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

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

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

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

                b.HasKey("ID");

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

            modelBuilder.Entity("hitmanstat.us.Models.UserReport", b =>
            {
                b.Property <int>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <DateTime>("Date")
                .ValueGeneratedOnAdd()
                .HasColumnType("datetime2")
                .HasDefaultValueSql("getdate()");

                b.Property <string>("Fingerprint")
                .IsRequired()
                .HasMaxLength(32)
                .HasColumnType("nvarchar(32)");

                b.Property <byte[]>("IPAddressBytes")
                .IsRequired()
                .HasMaxLength(16)
                .HasColumnType("varbinary(16)");

                b.Property <double>("Latitude")
                .HasColumnType("float");

                b.Property <double>("Longitude")
                .HasColumnType("float");

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

                b.HasKey("ID");

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

            modelBuilder.Entity("hitmanstat.us.Models.UserReportCounter", b =>
            {
                b.Property <int>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <DateTime>("Date")
                .ValueGeneratedOnAdd()
                .HasColumnType("date")
                .HasDefaultValueSql("getdate()");

                b.Property <int>("H1pc")
                .ValueGeneratedOnAdd()
                .HasColumnType("int")
                .HasDefaultValue(0);

                b.Property <int>("H1ps")
                .ValueGeneratedOnAdd()
                .HasColumnType("int")
                .HasDefaultValue(0);

                b.Property <int>("H1xb")
                .ValueGeneratedOnAdd()
                .HasColumnType("int")
                .HasDefaultValue(0);

                b.Property <int>("H2pc")
                .ValueGeneratedOnAdd()
                .HasColumnType("int")
                .HasDefaultValue(0);

                b.Property <int>("H2ps")
                .ValueGeneratedOnAdd()
                .HasColumnType("int")
                .HasDefaultValue(0);

                b.Property <int>("H2xb")
                .ValueGeneratedOnAdd()
                .HasColumnType("int")
                .HasDefaultValue(0);

                b.Property <int>("H3epic")
                .ValueGeneratedOnAdd()
                .HasColumnType("int")
                .HasDefaultValue(0);

                b.Property <int>("H3ps")
                .ValueGeneratedOnAdd()
                .HasColumnType("int")
                .HasDefaultValue(0);

                b.Property <int>("H3st")
                .ValueGeneratedOnAdd()
                .HasColumnType("int")
                .HasDefaultValue(0);

                b.Property <int>("H3steam")
                .ValueGeneratedOnAdd()
                .HasColumnType("int")
                .HasDefaultValue(0);

                b.Property <int>("H3sw")
                .ValueGeneratedOnAdd()
                .HasColumnType("int")
                .HasDefaultValue(0);

                b.Property <int>("H3xb")
                .ValueGeneratedOnAdd()
                .HasColumnType("int")
                .HasDefaultValue(0);

                b.HasKey("ID");

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

                b.ToTable("UserReportCounter", (string)null);
            });
#pragma warning restore 612, 618
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.1")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

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

            modelBuilder.Entity("WorkoutTracker.Domain.Exercises.ExecutedExercise", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <byte>("ActualRepCount")
                .HasColumnType("tinyint");

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

                b.Property <DateTime>("CreatedDateTime")
                .HasColumnType("datetime2");

                b.Property <int?>("Duration")
                .HasColumnType("int");

                b.Property <int?>("ExecutedWorkoutId")
                .HasColumnType("int");

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

                b.Property <byte>("FormRating")
                .HasColumnType("tinyint");

                b.Property <int?>("ModifiedByUserId")
                .HasColumnType("int");

                b.Property <DateTime?>("ModifiedDateTime")
                .HasColumnType("datetime2");

                b.Property <string>("Notes")
                .HasMaxLength(4096)
                .HasColumnType("nvarchar(max)");

                b.Property <byte>("RangeOfMotionRating")
                .HasColumnType("tinyint");

                b.Property <decimal>("ResistanceAmount")
                .HasColumnType("decimal(18,2)");

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

                b.Property <byte>("Sequence")
                .HasColumnType("tinyint");

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

                b.Property <byte>("TargetRepCount")
                .HasColumnType("tinyint");

                b.HasKey("Id");

                b.HasIndex("ExecutedWorkoutId");

                b.HasIndex("ExerciseId");

                b.HasIndex("Sequence");

                b.HasIndex("CreatedByUserId", "CreatedDateTime", "ModifiedByUserId", "ModifiedDateTime");

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

            modelBuilder.Entity("WorkoutTracker.Domain.Exercises.Exercise", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

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

                b.Property <DateTime>("CreatedDateTime")
                .HasColumnType("datetime2");

                b.Property <string>("Description")
                .IsRequired()
                .HasMaxLength(4096)
                .HasColumnType("nvarchar(max)");

                b.Property <int?>("ModifiedByUserId")
                .HasColumnType("int");

                b.Property <DateTime?>("ModifiedDateTime")
                .HasColumnType("datetime2");

                b.Property <string>("Movement")
                .IsRequired()
                .HasMaxLength(4096)
                .HasColumnType("nvarchar(max)");

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

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

                b.Property <string>("PointsToRemember")
                .HasMaxLength(4096)
                .HasColumnType("nvarchar(max)");

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

                b.Property <string>("Setup")
                .HasMaxLength(4096)
                .HasColumnType("nvarchar(max)");

                b.HasKey("Id");

                b.HasIndex("Name");

                b.HasIndex("CreatedByUserId", "CreatedDateTime", "ModifiedByUserId", "ModifiedDateTime");

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

            modelBuilder.Entity("WorkoutTracker.Domain.Exercises.ExerciseInWorkout", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <DateTime>("CreatedDateTime")
                .HasColumnType("datetime2");

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

                b.Property <int?>("ModifiedByUserId")
                .HasColumnType("int");

                b.Property <DateTime?>("ModifiedDateTime")
                .HasColumnType("datetime2");

                b.Property <byte>("NumberOfSets")
                .HasColumnType("tinyint");

                b.Property <byte>("Sequence")
                .HasColumnType("tinyint");

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

                b.Property <int?>("WorkoutId")
                .HasColumnType("int");

                b.HasKey("Id");

                b.HasIndex("ExerciseId");

                b.HasIndex("WorkoutId");

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

            modelBuilder.Entity("WorkoutTracker.Domain.Exercises.ExerciseTargetAreaLink", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <DateTime>("CreatedDateTime")
                .HasColumnType("datetime2");

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

                b.Property <int?>("ModifiedByUserId")
                .HasColumnType("int");

                b.Property <DateTime?>("ModifiedDateTime")
                .HasColumnType("datetime2");

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

                b.HasKey("Id");

                b.HasIndex("ExerciseId");

                b.HasIndex("TargetAreaId");

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

            modelBuilder.Entity("WorkoutTracker.Domain.Exercises.TargetArea", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <DateTime>("CreatedDateTime")
                .HasColumnType("datetime2");

                b.Property <int?>("ModifiedByUserId")
                .HasColumnType("int");

                b.Property <DateTime?>("ModifiedDateTime")
                .HasColumnType("datetime2");

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

                b.HasKey("Id");

                b.HasIndex("Name");

                b.HasIndex("CreatedByUserId", "CreatedDateTime", "ModifiedByUserId", "ModifiedDateTime");

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

            modelBuilder.Entity("WorkoutTracker.Domain.Resistances.Resistance", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <decimal>("Amount")
                .HasColumnType("decimal(18,2)");

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

                b.Property <DateTime>("CreatedDateTime")
                .HasColumnType("datetime2");

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

                b.Property <int?>("ExecutedExerciseId")
                .HasColumnType("int");

                b.Property <int?>("ModifiedByUserId")
                .HasColumnType("int");

                b.Property <DateTime?>("ModifiedDateTime")
                .HasColumnType("datetime2");

                b.HasKey("Id");

                b.HasIndex("ExecutedExerciseId");

                b.HasIndex("CreatedByUserId", "CreatedDateTime", "ModifiedByUserId", "ModifiedDateTime");

                b.ToTable("Resistances");

                b.HasDiscriminator <string>("Discriminator").HasValue("Resistance");
            });

            modelBuilder.Entity("WorkoutTracker.Domain.Resistances.ResistanceBand", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <string>("Color")
                .IsRequired()
                .HasMaxLength(25)
                .HasColumnType("nvarchar(25)");

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

                b.Property <DateTime>("CreatedDateTime")
                .HasColumnType("datetime2");

                b.Property <decimal>("MaxResistanceAmount")
                .HasColumnType("decimal(18,2)");

                b.Property <int?>("ModifiedByUserId")
                .HasColumnType("int");

                b.Property <DateTime?>("ModifiedDateTime")
                .HasColumnType("datetime2");

                b.Property <short>("NumberAvailable")
                .HasColumnType("smallint");

                b.HasKey("Id");

                b.HasIndex("Color");

                b.HasIndex("CreatedByUserId", "CreatedDateTime", "ModifiedByUserId", "ModifiedDateTime");

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

            modelBuilder.Entity("WorkoutTracker.Domain.Sets.ExecutedSet", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <DateTime>("CreatedDateTime")
                .HasColumnType("datetime2");

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

                b.Property <int?>("ExecutedExerciseId")
                .HasColumnType("int");

                b.Property <int?>("ModifiedByUserId")
                .HasColumnType("int");

                b.Property <DateTime?>("ModifiedDateTime")
                .HasColumnType("datetime2");

                b.HasKey("Id");

                b.HasIndex("ExecutedExerciseId");

                b.HasIndex("CreatedByUserId", "CreatedDateTime", "ModifiedByUserId", "ModifiedDateTime");

                b.ToTable("ExecutedSets");

                b.HasDiscriminator <string>("Discriminator").HasValue("ExecutedSet");
            });

            modelBuilder.Entity("WorkoutTracker.Domain.Users.User", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <DateTime>("CreatedDateTime")
                .HasColumnType("datetime2");

                b.Property <string>("HashedPassword")
                .HasMaxLength(1024)
                .HasColumnType("nvarchar(1024)");

                b.Property <int?>("ModifiedByUserId")
                .HasColumnType("int");

                b.Property <DateTime?>("ModifiedDateTime")
                .HasColumnType("datetime2");

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

                b.Property <string>("ProfilePic")
                .HasMaxLength(4096)
                .HasColumnType("nvarchar(max)");

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

                b.HasKey("Id");

                b.HasIndex("Name");

                b.HasIndex("CreatedByUserId", "CreatedDateTime", "ModifiedByUserId", "ModifiedDateTime");

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

            modelBuilder.Entity("WorkoutTracker.Domain.Users.UserMinMaxReps", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <DateTime>("CreatedDateTime")
                .HasColumnType("datetime2");

                b.Property <int?>("Duration")
                .HasColumnType("int");

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

                b.Property <byte>("MaxReps")
                .HasColumnType("tinyint");

                b.Property <byte>("MinReps")
                .HasColumnType("tinyint");

                b.Property <int?>("ModifiedByUserId")
                .HasColumnType("int");

                b.Property <DateTime?>("ModifiedDateTime")
                .HasColumnType("datetime2");

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

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

                b.HasKey("Id");

                b.HasIndex("UserSettingsId");

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

            modelBuilder.Entity("WorkoutTracker.Domain.Users.UserSettings", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <DateTime>("CreatedDateTime")
                .HasColumnType("datetime2");

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

                b.Property <int?>("ModifiedByUserId")
                .HasColumnType("int");

                b.Property <DateTime?>("ModifiedDateTime")
                .HasColumnType("datetime2");

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

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

                b.HasKey("Id");

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

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

            modelBuilder.Entity("WorkoutTracker.Domain.Workouts.ExecutedWorkout", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <DateTime>("CreatedDateTime")
                .HasColumnType("datetime2");

                b.Property <DateTime?>("EndDateTime")
                .HasColumnType("datetime2");

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

                b.Property <int?>("ModifiedByUserId")
                .HasColumnType("int");

                b.Property <DateTime?>("ModifiedDateTime")
                .HasColumnType("datetime2");

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

                b.Property <DateTime?>("StartDateTime")
                .HasColumnType("datetime2");

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

                b.HasKey("Id");

                b.HasIndex("WorkoutId");

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

            modelBuilder.Entity("WorkoutTracker.Domain.Workouts.Workout", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <bool>("Active")
                .ValueGeneratedOnAdd()
                .HasColumnType("bit")
                .HasDefaultValue(true);

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

                b.Property <DateTime>("CreatedDateTime")
                .HasColumnType("datetime2");

                b.Property <int?>("ModifiedByUserId")
                .HasColumnType("int");

                b.Property <DateTime?>("ModifiedDateTime")
                .HasColumnType("datetime2");

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

                b.HasKey("Id");

                b.HasIndex("CreatedByUserId", "CreatedDateTime", "ModifiedByUserId", "ModifiedDateTime");

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

            modelBuilder.Entity("WorkoutTracker.Domain.Resistances.BandResistance", b =>
            {
                b.HasBaseType("WorkoutTracker.Domain.Resistances.Resistance");

                b.Property <string>("Color")
                .IsRequired()
                .HasMaxLength(25)
                .HasColumnType("nvarchar(25)");

                b.HasIndex("Amount");

                b.HasIndex("Color");

                b.HasDiscriminator().HasValue("BandResistance");
            });

            modelBuilder.Entity("WorkoutTracker.Domain.Sets.ExecutedRepetitionSet", b =>
            {
                b.HasBaseType("WorkoutTracker.Domain.Sets.ExecutedSet");

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

                b.HasDiscriminator().HasValue("ExecutedRepetitionSet");
            });

            modelBuilder.Entity("WorkoutTracker.Domain.Sets.ExecutedTimedSet", b =>
            {
                b.HasBaseType("WorkoutTracker.Domain.Sets.ExecutedSet");

                b.Property <TimeSpan>("ExecutedTime")
                .HasColumnType("time");

                b.HasDiscriminator().HasValue("ExecutedTimedSet");
            });

            modelBuilder.Entity("WorkoutTracker.Domain.Exercises.ExecutedExercise", b =>
            {
                b.HasOne("WorkoutTracker.Domain.Workouts.ExecutedWorkout", null)
                .WithMany("Exercises")
                .HasForeignKey("ExecutedWorkoutId");

                b.HasOne("WorkoutTracker.Domain.Exercises.Exercise", "Exercise")
                .WithMany()
                .HasForeignKey("ExerciseId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("WorkoutTracker.Domain.Exercises.ExerciseInWorkout", b =>
            {
                b.HasOne("WorkoutTracker.Domain.Exercises.Exercise", "Exercise")
                .WithMany()
                .HasForeignKey("ExerciseId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("WorkoutTracker.Domain.Workouts.Workout", null)
                .WithMany("Exercises")
                .HasForeignKey("WorkoutId");

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

            modelBuilder.Entity("WorkoutTracker.Domain.Exercises.ExerciseTargetAreaLink", b =>
            {
                b.HasOne("WorkoutTracker.Domain.Exercises.Exercise", "Exercise")
                .WithMany("ExerciseTargetAreaLinks")
                .HasForeignKey("ExerciseId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("WorkoutTracker.Domain.Exercises.TargetArea", "TargetArea")
                .WithMany()
                .HasForeignKey("TargetAreaId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Exercise");

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

            modelBuilder.Entity("WorkoutTracker.Domain.Resistances.Resistance", b =>
            {
                b.HasOne("WorkoutTracker.Domain.Exercises.ExecutedExercise", null)
                .WithMany("Resistances")
                .HasForeignKey("ExecutedExerciseId");
            });

            modelBuilder.Entity("WorkoutTracker.Domain.Sets.ExecutedSet", b =>
            {
                b.HasOne("WorkoutTracker.Domain.Exercises.ExecutedExercise", "ExecutedExercise")
                .WithMany()
                .HasForeignKey("ExecutedExerciseId");

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

            modelBuilder.Entity("WorkoutTracker.Domain.Users.UserMinMaxReps", b =>
            {
                b.HasOne("WorkoutTracker.Domain.Users.UserSettings", null)
                .WithMany("RepSettings")
                .HasForeignKey("UserSettingsId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("WorkoutTracker.Domain.Users.UserSettings", b =>
            {
                b.HasOne("WorkoutTracker.Domain.Users.User", null)
                .WithOne("Settings")
                .HasForeignKey("WorkoutTracker.Domain.Users.UserSettings", "UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("WorkoutTracker.Domain.Workouts.ExecutedWorkout", b =>
            {
                b.HasOne("WorkoutTracker.Domain.Workouts.Workout", "Workout")
                .WithMany()
                .HasForeignKey("WorkoutId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("WorkoutTracker.Domain.Exercises.ExecutedExercise", b =>
            {
                b.Navigation("Resistances");
            });

            modelBuilder.Entity("WorkoutTracker.Domain.Exercises.Exercise", b =>
            {
                b.Navigation("ExerciseTargetAreaLinks");
            });

            modelBuilder.Entity("WorkoutTracker.Domain.Users.User", b =>
            {
                b.Navigation("Settings");
            });

            modelBuilder.Entity("WorkoutTracker.Domain.Users.UserSettings", b =>
            {
                b.Navigation("RepSettings");
            });

            modelBuilder.Entity("WorkoutTracker.Domain.Workouts.ExecutedWorkout", b =>
            {
                b.Navigation("Exercises");
            });

            modelBuilder.Entity("WorkoutTracker.Domain.Workouts.Workout", b =>
            {
                b.Navigation("Exercises");
            });
#pragma warning restore 612, 618
        }
Пример #18
0
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.3")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

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

            modelBuilder.Entity("TodoApi.Models.Project", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.HasKey("Id");

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

            modelBuilder.Entity("TodoApi.Models.TodoItem", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

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

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

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

                b.Property <int?>("ProjectId")
                .HasColumnType("int");

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

                b.HasKey("Id");

                b.HasIndex("ProjectId");

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

            modelBuilder.Entity("TodoApi.Models.TodoItem", b =>
            {
                b.HasOne("TodoApi.Models.Project", null)
                .WithMany("TodoItems")
                .HasForeignKey("ProjectId");
            });

            modelBuilder.Entity("TodoApi.Models.Project", b =>
            {
                b.Navigation("TodoItems");
            });
#pragma warning restore 612, 618
        }
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.3")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResource", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <string>("AllowedAccessTokenSigningAlgorithms")
                .HasMaxLength(100)
                .HasColumnType("nvarchar(100)");

                b.Property <DateTime>("Created")
                .HasColumnType("datetime2");

                b.Property <string>("Description")
                .HasMaxLength(1000)
                .HasColumnType("nvarchar(1000)");

                b.Property <string>("DisplayName")
                .HasMaxLength(200)
                .HasColumnType("nvarchar(200)");

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

                b.Property <DateTime?>("LastAccessed")
                .HasColumnType("datetime2");

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

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

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

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

                b.Property <DateTime?>("Updated")
                .HasColumnType("datetime2");

                b.HasKey("Id");

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

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceClaim", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <string>("Type")
                .IsRequired()
                .HasMaxLength(200)
                .HasColumnType("nvarchar(200)");

                b.HasKey("Id");

                b.HasIndex("ApiResourceId", "Type")
                .IsUnique();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceProperty", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <string>("Key")
                .IsRequired()
                .HasMaxLength(250)
                .HasColumnType("nvarchar(250)");

                b.Property <string>("Value")
                .IsRequired()
                .HasMaxLength(2000)
                .HasColumnType("nvarchar(2000)");

                b.HasKey("Id");

                b.HasIndex("ApiResourceId", "Key")
                .IsUnique();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceScope", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <string>("Scope")
                .IsRequired()
                .HasMaxLength(200)
                .HasColumnType("nvarchar(200)");

                b.HasKey("Id");

                b.HasIndex("ApiResourceId", "Scope")
                .IsUnique();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceSecret", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <DateTime>("Created")
                .HasColumnType("datetime2");

                b.Property <string>("Description")
                .HasMaxLength(1000)
                .HasColumnType("nvarchar(1000)");

                b.Property <DateTime?>("Expiration")
                .HasColumnType("datetime2");

                b.Property <string>("Type")
                .IsRequired()
                .HasMaxLength(250)
                .HasColumnType("nvarchar(250)");

                b.Property <string>("Value")
                .IsRequired()
                .HasMaxLength(4000)
                .HasColumnType("nvarchar(4000)");

                b.HasKey("Id");

                b.HasIndex("ApiResourceId");

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiScope", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <DateTime>("Created")
                .HasColumnType("datetime2");

                b.Property <string>("Description")
                .HasMaxLength(1000)
                .HasColumnType("nvarchar(1000)");

                b.Property <string>("DisplayName")
                .HasMaxLength(200)
                .HasColumnType("nvarchar(200)");

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

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

                b.Property <DateTime?>("LastAccessed")
                .HasColumnType("datetime2");

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

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

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

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

                b.Property <DateTime?>("Updated")
                .HasColumnType("datetime2");

                b.HasKey("Id");

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

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiScopeClaim", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <string>("Type")
                .IsRequired()
                .HasMaxLength(200)
                .HasColumnType("nvarchar(200)");

                b.HasKey("Id");

                b.HasIndex("ScopeId", "Type")
                .IsUnique();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiScopeProperty", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <string>("Key")
                .IsRequired()
                .HasMaxLength(250)
                .HasColumnType("nvarchar(250)");

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

                b.Property <string>("Value")
                .IsRequired()
                .HasMaxLength(2000)
                .HasColumnType("nvarchar(2000)");

                b.HasKey("Id");

                b.HasIndex("ScopeId", "Key")
                .IsUnique();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.Client", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

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

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

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

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

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

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

                b.Property <string>("AllowedIdentityTokenSigningAlgorithms")
                .HasMaxLength(100)
                .HasColumnType("nvarchar(100)");

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

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

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

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

                b.Property <string>("BackChannelLogoutUri")
                .HasMaxLength(2000)
                .HasColumnType("nvarchar(2000)");

                b.Property <int?>("CibaLifetime")
                .HasColumnType("int");

                b.Property <string>("ClientClaimsPrefix")
                .HasMaxLength(200)
                .HasColumnType("nvarchar(200)");

                b.Property <string>("ClientId")
                .IsRequired()
                .HasMaxLength(200)
                .HasColumnType("nvarchar(200)");

                b.Property <string>("ClientName")
                .HasMaxLength(200)
                .HasColumnType("nvarchar(200)");

                b.Property <string>("ClientUri")
                .HasMaxLength(2000)
                .HasColumnType("nvarchar(2000)");

                b.Property <int?>("ConsentLifetime")
                .HasColumnType("int");

                b.Property <DateTime>("Created")
                .HasColumnType("datetime2");

                b.Property <string>("Description")
                .HasMaxLength(1000)
                .HasColumnType("nvarchar(1000)");

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

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

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

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

                b.Property <string>("FrontChannelLogoutUri")
                .HasMaxLength(2000)
                .HasColumnType("nvarchar(2000)");

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

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

                b.Property <DateTime?>("LastAccessed")
                .HasColumnType("datetime2");

                b.Property <string>("LogoUri")
                .HasMaxLength(2000)
                .HasColumnType("nvarchar(2000)");

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

                b.Property <string>("PairWiseSubjectSalt")
                .HasMaxLength(200)
                .HasColumnType("nvarchar(200)");

                b.Property <int?>("PollingInterval")
                .HasColumnType("int");

                b.Property <string>("ProtocolType")
                .IsRequired()
                .HasMaxLength(200)
                .HasColumnType("nvarchar(200)");

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

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

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

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

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

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

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

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

                b.Property <DateTime?>("Updated")
                .HasColumnType("datetime2");

                b.Property <string>("UserCodeType")
                .HasMaxLength(100)
                .HasColumnType("nvarchar(100)");

                b.Property <int?>("UserSsoLifetime")
                .HasColumnType("int");

                b.HasKey("Id");

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

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientClaim", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <string>("Type")
                .IsRequired()
                .HasMaxLength(250)
                .HasColumnType("nvarchar(250)");

                b.Property <string>("Value")
                .IsRequired()
                .HasMaxLength(250)
                .HasColumnType("nvarchar(250)");

                b.HasKey("Id");

                b.HasIndex("ClientId", "Type", "Value")
                .IsUnique();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientCorsOrigin", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <string>("Origin")
                .IsRequired()
                .HasMaxLength(150)
                .HasColumnType("nvarchar(150)");

                b.HasKey("Id");

                b.HasIndex("ClientId", "Origin")
                .IsUnique();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientGrantType", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <string>("GrantType")
                .IsRequired()
                .HasMaxLength(250)
                .HasColumnType("nvarchar(250)");

                b.HasKey("Id");

                b.HasIndex("ClientId", "GrantType")
                .IsUnique();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientIdPRestriction", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <string>("Provider")
                .IsRequired()
                .HasMaxLength(200)
                .HasColumnType("nvarchar(200)");

                b.HasKey("Id");

                b.HasIndex("ClientId", "Provider")
                .IsUnique();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientPostLogoutRedirectUri", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <string>("PostLogoutRedirectUri")
                .IsRequired()
                .HasMaxLength(400)
                .HasColumnType("nvarchar(400)");

                b.HasKey("Id");

                b.HasIndex("ClientId", "PostLogoutRedirectUri")
                .IsUnique();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientProperty", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <string>("Key")
                .IsRequired()
                .HasMaxLength(250)
                .HasColumnType("nvarchar(250)");

                b.Property <string>("Value")
                .IsRequired()
                .HasMaxLength(2000)
                .HasColumnType("nvarchar(2000)");

                b.HasKey("Id");

                b.HasIndex("ClientId", "Key")
                .IsUnique();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientRedirectUri", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <string>("RedirectUri")
                .IsRequired()
                .HasMaxLength(400)
                .HasColumnType("nvarchar(400)");

                b.HasKey("Id");

                b.HasIndex("ClientId", "RedirectUri")
                .IsUnique();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientScope", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <string>("Scope")
                .IsRequired()
                .HasMaxLength(200)
                .HasColumnType("nvarchar(200)");

                b.HasKey("Id");

                b.HasIndex("ClientId", "Scope")
                .IsUnique();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientSecret", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <DateTime>("Created")
                .HasColumnType("datetime2");

                b.Property <string>("Description")
                .HasMaxLength(2000)
                .HasColumnType("nvarchar(2000)");

                b.Property <DateTime?>("Expiration")
                .HasColumnType("datetime2");

                b.Property <string>("Type")
                .IsRequired()
                .HasMaxLength(250)
                .HasColumnType("nvarchar(250)");

                b.Property <string>("Value")
                .IsRequired()
                .HasMaxLength(4000)
                .HasColumnType("nvarchar(4000)");

                b.HasKey("Id");

                b.HasIndex("ClientId");

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.IdentityProvider", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <DateTime>("Created")
                .HasColumnType("datetime2");

                b.Property <string>("DisplayName")
                .HasMaxLength(200)
                .HasColumnType("nvarchar(200)");

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

                b.Property <DateTime?>("LastAccessed")
                .HasColumnType("datetime2");

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

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

                b.Property <string>("Scheme")
                .IsRequired()
                .HasMaxLength(200)
                .HasColumnType("nvarchar(200)");

                b.Property <string>("Type")
                .IsRequired()
                .HasMaxLength(20)
                .HasColumnType("nvarchar(20)");

                b.Property <DateTime?>("Updated")
                .HasColumnType("datetime2");

                b.HasKey("Id");

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

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.IdentityResource", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <DateTime>("Created")
                .HasColumnType("datetime2");

                b.Property <string>("Description")
                .HasMaxLength(1000)
                .HasColumnType("nvarchar(1000)");

                b.Property <string>("DisplayName")
                .HasMaxLength(200)
                .HasColumnType("nvarchar(200)");

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

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

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

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

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

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

                b.Property <DateTime?>("Updated")
                .HasColumnType("datetime2");

                b.HasKey("Id");

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

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.IdentityResourceClaim", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <string>("Type")
                .IsRequired()
                .HasMaxLength(200)
                .HasColumnType("nvarchar(200)");

                b.HasKey("Id");

                b.HasIndex("IdentityResourceId", "Type")
                .IsUnique();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.IdentityResourceProperty", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <string>("Key")
                .IsRequired()
                .HasMaxLength(250)
                .HasColumnType("nvarchar(250)");

                b.Property <string>("Value")
                .IsRequired()
                .HasMaxLength(2000)
                .HasColumnType("nvarchar(2000)");

                b.HasKey("Id");

                b.HasIndex("IdentityResourceId", "Key")
                .IsUnique();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceClaim", b =>
            {
                b.HasOne("Duende.IdentityServer.EntityFramework.Entities.ApiResource", "ApiResource")
                .WithMany("UserClaims")
                .HasForeignKey("ApiResourceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceProperty", b =>
            {
                b.HasOne("Duende.IdentityServer.EntityFramework.Entities.ApiResource", "ApiResource")
                .WithMany("Properties")
                .HasForeignKey("ApiResourceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceScope", b =>
            {
                b.HasOne("Duende.IdentityServer.EntityFramework.Entities.ApiResource", "ApiResource")
                .WithMany("Scopes")
                .HasForeignKey("ApiResourceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceSecret", b =>
            {
                b.HasOne("Duende.IdentityServer.EntityFramework.Entities.ApiResource", "ApiResource")
                .WithMany("Secrets")
                .HasForeignKey("ApiResourceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiScopeClaim", b =>
            {
                b.HasOne("Duende.IdentityServer.EntityFramework.Entities.ApiScope", "Scope")
                .WithMany("UserClaims")
                .HasForeignKey("ScopeId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiScopeProperty", b =>
            {
                b.HasOne("Duende.IdentityServer.EntityFramework.Entities.ApiScope", "Scope")
                .WithMany("Properties")
                .HasForeignKey("ScopeId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientClaim", b =>
            {
                b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
                .WithMany("Claims")
                .HasForeignKey("ClientId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientCorsOrigin", b =>
            {
                b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
                .WithMany("AllowedCorsOrigins")
                .HasForeignKey("ClientId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientGrantType", b =>
            {
                b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
                .WithMany("AllowedGrantTypes")
                .HasForeignKey("ClientId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientIdPRestriction", b =>
            {
                b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
                .WithMany("IdentityProviderRestrictions")
                .HasForeignKey("ClientId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientPostLogoutRedirectUri", b =>
            {
                b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
                .WithMany("PostLogoutRedirectUris")
                .HasForeignKey("ClientId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientProperty", b =>
            {
                b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
                .WithMany("Properties")
                .HasForeignKey("ClientId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientRedirectUri", b =>
            {
                b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
                .WithMany("RedirectUris")
                .HasForeignKey("ClientId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientScope", b =>
            {
                b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
                .WithMany("AllowedScopes")
                .HasForeignKey("ClientId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientSecret", b =>
            {
                b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
                .WithMany("ClientSecrets")
                .HasForeignKey("ClientId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.IdentityResourceClaim", b =>
            {
                b.HasOne("Duende.IdentityServer.EntityFramework.Entities.IdentityResource", "IdentityResource")
                .WithMany("UserClaims")
                .HasForeignKey("IdentityResourceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.IdentityResourceProperty", b =>
            {
                b.HasOne("Duende.IdentityServer.EntityFramework.Entities.IdentityResource", "IdentityResource")
                .WithMany("Properties")
                .HasForeignKey("IdentityResourceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResource", b =>
            {
                b.Navigation("Properties");

                b.Navigation("Scopes");

                b.Navigation("Secrets");

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiScope", b =>
            {
                b.Navigation("Properties");

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.Client", b =>
            {
                b.Navigation("AllowedCorsOrigins");

                b.Navigation("AllowedGrantTypes");

                b.Navigation("AllowedScopes");

                b.Navigation("Claims");

                b.Navigation("ClientSecrets");

                b.Navigation("IdentityProviderRestrictions");

                b.Navigation("PostLogoutRedirectUris");

                b.Navigation("Properties");

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

            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.IdentityResource", b =>
            {
                b.Navigation("Properties");

                b.Navigation("UserClaims");
            });
#pragma warning restore 612, 618
        }
Пример #20
0
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.1")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

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

            modelBuilder.Entity("BlogSystem.Data.Models.ApplicationRole", b =>
            {
                b.Property <string>("Id")
                .HasColumnType("nvarchar(450)");

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

                b.Property <DateTime>("CreatedOn")
                .HasColumnType("datetime2");

                b.Property <DateTime?>("DeletedOn")
                .HasColumnType("datetime2");

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

                b.Property <DateTime?>("ModifiedOn")
                .HasColumnType("datetime2");

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

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

                b.HasKey("Id");

                b.HasIndex("IsDeleted");

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

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

            modelBuilder.Entity("BlogSystem.Data.Models.ApplicationUser", b =>
            {
                b.Property <string>("Id")
                .HasColumnType("nvarchar(450)");

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

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

                b.Property <DateTime>("CreatedOn")
                .HasColumnType("datetime2");

                b.Property <DateTime?>("DeletedOn")
                .HasColumnType("datetime2");

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

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

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

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

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

                b.Property <DateTime?>("ModifiedOn")
                .HasColumnType("datetime2");

                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>("SecurityStamp")
                .HasColumnType("nvarchar(max)");

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

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

                b.HasKey("Id");

                b.HasIndex("IsDeleted");

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

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

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

            modelBuilder.Entity("BlogSystem.Data.Models.BlogPost", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <DateTime>("CreatedOn")
                .HasColumnType("datetime2");

                b.Property <DateTime?>("DeletedOn")
                .HasColumnType("datetime2");

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

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

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

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

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

                b.Property <DateTime?>("ModifiedOn")
                .HasColumnType("datetime2");

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

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

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

                b.HasKey("Id");

                b.HasIndex("IsDeleted");

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

            modelBuilder.Entity("BlogSystem.Data.Models.Feed", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <DateTime>("CreatedOn")
                .HasColumnType("datetime2");

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

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

                b.Property <DateTime?>("LastUpdate")
                .HasColumnType("datetime2");

                b.Property <DateTime?>("ModifiedOn")
                .HasColumnType("datetime2");

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

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

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

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

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

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

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

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

                b.HasKey("Id");

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

            modelBuilder.Entity("BlogSystem.Data.Models.FeedItem", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <DateTime>("CreatedOn")
                .HasColumnType("datetime2");

                b.Property <DateTime?>("DeletedOn")
                .HasColumnType("datetime2");

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

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

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

                b.Property <DateTime?>("ModifiedOn")
                .HasColumnType("datetime2");

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

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

                b.HasKey("Id");

                b.HasIndex("FeedId");

                b.HasIndex("IsDeleted");

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

            modelBuilder.Entity("BlogSystem.Data.Models.Page", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

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

                b.Property <DateTime>("CreatedOn")
                .HasColumnType("datetime2");

                b.Property <DateTime?>("DeletedOn")
                .HasColumnType("datetime2");

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

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

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

                b.Property <DateTime?>("ModifiedOn")
                .HasColumnType("datetime2");

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

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

                b.HasKey("Id");

                b.HasIndex("IsDeleted");

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

            modelBuilder.Entity("BlogSystem.Data.Models.Setting", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <DateTime>("CreatedOn")
                .HasColumnType("datetime2");

                b.Property <DateTime?>("DeletedOn")
                .HasColumnType("datetime2");

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

                b.Property <DateTime?>("ModifiedOn")
                .HasColumnType("datetime2");

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

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

                b.HasKey("Id");

                b.HasIndex("IsDeleted");

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

            modelBuilder.Entity("BlogSystem.Data.Models.Video", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

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

                b.Property <DateTime>("CreatedOn")
                .HasColumnType("datetime2");

                b.Property <DateTime?>("DeletedOn")
                .HasColumnType("datetime2");

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

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

                b.Property <DateTime?>("ModifiedOn")
                .HasColumnType("datetime2");

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

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

                b.HasKey("Id");

                b.HasIndex("IsDeleted");

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", 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 <string>("RoleId")
                .IsRequired()
                .HasColumnType("nvarchar(450)");

                b.HasKey("Id");

                b.HasIndex("RoleId");

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", 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 <string>("UserId")
                .IsRequired()
                .HasColumnType("nvarchar(450)");

                b.HasKey("Id");

                b.HasIndex("UserId");

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

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

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

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

                b.Property <string>("UserId")
                .IsRequired()
                .HasColumnType("nvarchar(450)");

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

                b.HasIndex("UserId");

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
            {
                b.Property <string>("UserId")
                .HasColumnType("nvarchar(450)");

                b.Property <string>("RoleId")
                .HasColumnType("nvarchar(450)");

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

                b.HasIndex("RoleId");

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
            {
                b.Property <string>("UserId")
                .HasColumnType("nvarchar(450)");

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

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

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

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

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

            modelBuilder.Entity("BlogSystem.Data.Models.FeedItem", b =>
            {
                b.HasOne("BlogSystem.Data.Models.Feed", "Feed")
                .WithMany("Items")
                .HasForeignKey("FeedId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
            {
                b.HasOne("BlogSystem.Data.Models.ApplicationRole", null)
                .WithMany()
                .HasForeignKey("RoleId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
            {
                b.HasOne("BlogSystem.Data.Models.ApplicationUser", null)
                .WithMany("Claims")
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
            {
                b.HasOne("BlogSystem.Data.Models.ApplicationUser", null)
                .WithMany("Logins")
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
            {
                b.HasOne("BlogSystem.Data.Models.ApplicationRole", null)
                .WithMany()
                .HasForeignKey("RoleId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();

                b.HasOne("BlogSystem.Data.Models.ApplicationUser", null)
                .WithMany("Roles")
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();
            });

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

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

                b.Navigation("Logins");

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

            modelBuilder.Entity("BlogSystem.Data.Models.Feed", b =>
            {
                b.Navigation("Items");
            });
#pragma warning restore 612, 618
        }
Пример #21
0
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.1")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
            {
                b.Property <string>("Id")
                .HasColumnType("nvarchar(450)");

                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("Roles", (string)null);
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", 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 <string>("RoleId")
                .IsRequired()
                .HasColumnType("nvarchar(450)");

                b.HasKey("Id");

                b.HasIndex("RoleId");

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", 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 <string>("UserId")
                .IsRequired()
                .HasColumnType("nvarchar(450)");

                b.HasKey("Id");

                b.HasIndex("UserId");

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

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

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

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

                b.Property <string>("UserId")
                .IsRequired()
                .HasColumnType("nvarchar(450)");

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

                b.HasIndex("UserId");

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
            {
                b.Property <string>("UserId")
                .HasColumnType("nvarchar(450)");

                b.Property <string>("RoleId")
                .HasColumnType("nvarchar(450)");

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

                b.HasIndex("RoleId");

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
            {
                b.Property <string>("UserId")
                .HasColumnType("nvarchar(450)");

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

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

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

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

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

            modelBuilder.Entity("SharpForum.Domain.Category", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uniqueidentifier");

                b.Property <DateTime>("CreatedOn")
                .HasColumnType("datetime2");

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

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

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

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

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

                b.Property <DateTime>("UpdatedOn")
                .HasColumnType("datetime2");

                b.HasKey("Id");

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

            modelBuilder.Entity("SharpForum.Domain.Reply", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uniqueidentifier");

                b.Property <string>("AuthorId")
                .HasColumnType("nvarchar(450)");

                b.Property <DateTime>("CreatedOn")
                .HasColumnType("datetime2");

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

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

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

                b.Property <DateTime>("UpdatedOn")
                .HasColumnType("datetime2");

                b.HasKey("Id");

                b.HasIndex("AuthorId");

                b.HasIndex("TopicId");

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

            modelBuilder.Entity("SharpForum.Domain.Topic", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uniqueidentifier");

                b.Property <string>("AuthorId")
                .HasColumnType("nvarchar(450)");

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

                b.Property <DateTime>("CreatedOn")
                .HasColumnType("datetime2");

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

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

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

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

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

                b.Property <DateTime>("UpdatedOn")
                .HasColumnType("datetime2");

                b.HasKey("Id");

                b.HasIndex("AuthorId");

                b.HasIndex("CategoryId");

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

            modelBuilder.Entity("SharpForum.Domain.User", b =>
            {
                b.Property <string>("Id")
                .HasColumnType("nvarchar(450)");

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

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

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

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

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

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

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

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

                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>("SecurityStamp")
                .HasColumnType("nvarchar(max)");

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

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

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

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

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

                b.HasKey("Id");

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

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

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

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
            {
                b.HasOne("SharpForum.Domain.User", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
            {
                b.HasOne("SharpForum.Domain.User", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

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

                b.HasOne("SharpForum.Domain.User", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
            {
                b.HasOne("SharpForum.Domain.User", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("SharpForum.Domain.Reply", b =>
            {
                b.HasOne("SharpForum.Domain.User", "Author")
                .WithMany("Replies")
                .HasForeignKey("AuthorId");

                b.HasOne("SharpForum.Domain.Topic", "Topic")
                .WithMany("Replies")
                .HasForeignKey("TopicId");

                b.Navigation("Author");

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

            modelBuilder.Entity("SharpForum.Domain.Topic", b =>
            {
                b.HasOne("SharpForum.Domain.User", "Author")
                .WithMany("Topics")
                .HasForeignKey("AuthorId");

                b.HasOne("SharpForum.Domain.Category", null)
                .WithMany("Topics")
                .HasForeignKey("CategoryId");

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

            modelBuilder.Entity("SharpForum.Domain.Category", b =>
            {
                b.Navigation("Topics");
            });

            modelBuilder.Entity("SharpForum.Domain.Topic", b =>
            {
                b.Navigation("Replies");
            });

            modelBuilder.Entity("SharpForum.Domain.User", b =>
            {
                b.Navigation("Replies");

                b.Navigation("Topics");
            });
#pragma warning restore 612, 618
        }
Пример #22
0
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.5")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

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

            modelBuilder.Entity("BrewHelper.Data.Entities.Fermentable", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

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

                b.Property <double>("Color")
                .HasColumnType("float");

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

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

                b.Property <long>("StockAmount")
                .HasColumnType("bigint");

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

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

                b.Property <double>("Yield")
                .HasColumnType("float");

                b.HasKey("Id");

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

            modelBuilder.Entity("BrewHelper.Data.Entities.Hop", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

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

                b.Property <double>("Alpha")
                .HasColumnType("float");

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

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

                b.Property <long>("StockAmount")
                .HasColumnType("bigint");

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

                b.HasKey("Id");

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

            modelBuilder.Entity("BrewHelper.Data.Entities.Misc", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

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

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

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

                b.Property <long>("StockAmount")
                .HasColumnType("bigint");

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

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

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

                b.HasKey("Id");

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

            modelBuilder.Entity("BrewHelper.Data.Entities.Recipe", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

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

                b.Property <double>("BatchSize")
                .HasColumnType("float");

                b.Property <double>("BoilSize")
                .HasColumnType("float");

                b.Property <double>("BoilTime")
                .HasColumnType("float");

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

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

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

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

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

                b.HasKey("Id");

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

            modelBuilder.Entity("BrewHelper.Data.Entities.Water", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

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

                b.Property <double>("Bicarbonate")
                .HasColumnType("float");

                b.Property <double>("Calcium")
                .HasColumnType("float");

                b.Property <double>("Chloride")
                .HasColumnType("float");

                b.Property <double>("Magnesium")
                .HasColumnType("float");

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

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

                b.Property <double>("Sodium")
                .HasColumnType("float");

                b.Property <double>("Sulfate")
                .HasColumnType("float");

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

                b.HasKey("Id");

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

            modelBuilder.Entity("BrewHelper.Data.Entities.Yeast", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

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

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

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

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

                b.Property <long>("StockAmount")
                .HasColumnType("bigint");

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

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

                b.HasKey("Id");

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

            modelBuilder.Entity("BrewHelper.Data.Entities.Recipe", b =>
            {
                b.OwnsMany("BrewHelper.Data.Entities.HopIngredient", "Hops", b1 =>
                {
                    b1.Property <long>("RecipeId")
                    .HasColumnType("bigint");

                    b1.Property <int>("Id")
                    .ValueGeneratedOnAdd()
                    .HasColumnType("int");

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

                    b1.Property <double>("Amount")
                    .HasColumnType("float");

                    b1.Property <long>("IngredientId")
                    .HasColumnType("bigint");

                    b1.Property <double?>("Time")
                    .HasColumnType("float");

                    b1.Property <int>("Use")
                    .HasColumnType("int");

                    b1.HasKey("RecipeId", "Id");

                    b1.HasIndex("IngredientId");

                    b1.ToTable("HopIngredient");

                    b1.HasOne("BrewHelper.Data.Entities.Hop", "Ingredient")
                    .WithMany()
                    .HasForeignKey("IngredientId")
                    .OnDelete(DeleteBehavior.Cascade)
                    .IsRequired();

                    b1.WithOwner()
                    .HasForeignKey("RecipeId");

                    b1.Navigation("Ingredient");
                });

                b.OwnsOne("BrewHelper.Data.Entities.Mash", "Mash", b1 =>
                {
                    b1.Property <long>("RecipeId")
                    .HasColumnType("bigint");

                    b1.Property <double>("GrainTemp")
                    .HasColumnType("float");

                    b1.Property <long>("Id")
                    .HasColumnType("bigint");

                    b1.Property <string>("Name")
                    .IsRequired()
                    .HasColumnType("nvarchar(max)");

                    b1.Property <string>("Notes")
                    .IsRequired()
                    .HasColumnType("nvarchar(max)");

                    b1.Property <int>("Version")
                    .HasColumnType("int");

                    b1.HasKey("RecipeId");

                    b1.ToTable("Recipes");

                    b1.WithOwner()
                    .HasForeignKey("RecipeId");

                    b1.OwnsMany("BrewHelper.Data.Entities.MashStep", "MashSteps", b2 =>
                    {
                        b2.Property <long>("MashRecipeId")
                        .HasColumnType("bigint");

                        b2.Property <long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                        SqlServerPropertyBuilderExtensions.UseIdentityColumn(b2.Property <long>("Id"), 1L, 1);

                        b2.Property <double?>("InfuseAmount")
                        .HasColumnType("float");

                        b2.Property <string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                        b2.Property <string>("Notes")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                        b2.Property <double>("StepTemp")
                        .HasColumnType("float");

                        b2.Property <int>("StepTime")
                        .HasColumnType("int");

                        b2.Property <int>("Type")
                        .HasColumnType("int");

                        b2.Property <int>("Version")
                        .HasColumnType("int");

                        b2.HasKey("MashRecipeId", "Id");

                        b2.ToTable("MashStep");

                        b2.WithOwner()
                        .HasForeignKey("MashRecipeId");
                    });

                    b1.Navigation("MashSteps");
                });

                b.OwnsMany("BrewHelper.Data.Entities.RecipeIngredient<BrewHelper.Data.Entities.Fermentable>", "Fermentables", b1 =>
                {
                    b1.Property <long>("RecipeId")
                    .HasColumnType("bigint");

                    b1.Property <int>("Id")
                    .ValueGeneratedOnAdd()
                    .HasColumnType("int");

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

                    b1.Property <double>("Amount")
                    .HasColumnType("float");

                    b1.Property <long>("IngredientId")
                    .HasColumnType("bigint");

                    b1.Property <double?>("Time")
                    .HasColumnType("float");

                    b1.HasKey("RecipeId", "Id");

                    b1.HasIndex("IngredientId");

                    b1.ToTable("RecipeIngredient<Fermentable>");

                    b1.HasOne("BrewHelper.Data.Entities.Fermentable", "Ingredient")
                    .WithMany()
                    .HasForeignKey("IngredientId")
                    .OnDelete(DeleteBehavior.Cascade)
                    .IsRequired();

                    b1.WithOwner()
                    .HasForeignKey("RecipeId");

                    b1.Navigation("Ingredient");
                });

                b.OwnsMany("BrewHelper.Data.Entities.RecipeIngredient<BrewHelper.Data.Entities.Misc>", "Miscs", b1 =>
                {
                    b1.Property <long>("RecipeId")
                    .HasColumnType("bigint");

                    b1.Property <int>("Id")
                    .ValueGeneratedOnAdd()
                    .HasColumnType("int");

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

                    b1.Property <double>("Amount")
                    .HasColumnType("float");

                    b1.Property <long>("IngredientId")
                    .HasColumnType("bigint");

                    b1.Property <double?>("Time")
                    .HasColumnType("float");

                    b1.HasKey("RecipeId", "Id");

                    b1.HasIndex("IngredientId");

                    b1.ToTable("RecipeIngredient<Misc>");

                    b1.HasOne("BrewHelper.Data.Entities.Misc", "Ingredient")
                    .WithMany()
                    .HasForeignKey("IngredientId")
                    .OnDelete(DeleteBehavior.Cascade)
                    .IsRequired();

                    b1.WithOwner()
                    .HasForeignKey("RecipeId");

                    b1.Navigation("Ingredient");
                });

                b.OwnsMany("BrewHelper.Data.Entities.RecipeIngredient<BrewHelper.Data.Entities.Water>", "Waters", b1 =>
                {
                    b1.Property <long>("RecipeId")
                    .HasColumnType("bigint");

                    b1.Property <int>("Id")
                    .ValueGeneratedOnAdd()
                    .HasColumnType("int");

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

                    b1.Property <double>("Amount")
                    .HasColumnType("float");

                    b1.Property <long>("IngredientId")
                    .HasColumnType("bigint");

                    b1.Property <double?>("Time")
                    .HasColumnType("float");

                    b1.HasKey("RecipeId", "Id");

                    b1.HasIndex("IngredientId");

                    b1.ToTable("RecipeIngredient<Water>");

                    b1.HasOne("BrewHelper.Data.Entities.Water", "Ingredient")
                    .WithMany()
                    .HasForeignKey("IngredientId")
                    .OnDelete(DeleteBehavior.Cascade)
                    .IsRequired();

                    b1.WithOwner()
                    .HasForeignKey("RecipeId");

                    b1.Navigation("Ingredient");
                });

                b.OwnsMany("BrewHelper.Data.Entities.RecipeIngredient<BrewHelper.Data.Entities.Yeast>", "Yeasts", b1 =>
                {
                    b1.Property <long>("RecipeId")
                    .HasColumnType("bigint");

                    b1.Property <int>("Id")
                    .ValueGeneratedOnAdd()
                    .HasColumnType("int");

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

                    b1.Property <double>("Amount")
                    .HasColumnType("float");

                    b1.Property <long>("IngredientId")
                    .HasColumnType("bigint");

                    b1.Property <double?>("Time")
                    .HasColumnType("float");

                    b1.HasKey("RecipeId", "Id");

                    b1.HasIndex("IngredientId");

                    b1.ToTable("RecipeIngredient<Yeast>");

                    b1.HasOne("BrewHelper.Data.Entities.Yeast", "Ingredient")
                    .WithMany()
                    .HasForeignKey("IngredientId")
                    .OnDelete(DeleteBehavior.Cascade)
                    .IsRequired();

                    b1.WithOwner()
                    .HasForeignKey("RecipeId");

                    b1.Navigation("Ingredient");
                });

                b.OwnsOne("BrewHelper.Data.Entities.Style", "Style", b1 =>
                {
                    b1.Property <long>("RecipeId")
                    .HasColumnType("bigint");

                    b1.Property <string>("Category")
                    .IsRequired()
                    .HasColumnType("nvarchar(max)");

                    b1.Property <string>("CategoryNumber")
                    .IsRequired()
                    .HasColumnType("nvarchar(max)");

                    b1.Property <double>("ColorMax")
                    .HasColumnType("float");

                    b1.Property <double>("ColorMin")
                    .HasColumnType("float");

                    b1.Property <double>("IBU_Max")
                    .HasColumnType("float");

                    b1.Property <double>("IBU_Min")
                    .HasColumnType("float");

                    b1.Property <long>("Id")
                    .HasColumnType("bigint");

                    b1.Property <string>("Name")
                    .IsRequired()
                    .HasColumnType("nvarchar(max)");

                    b1.Property <string>("Notes")
                    .IsRequired()
                    .HasColumnType("nvarchar(max)");

                    b1.Property <double>("OG_Max")
                    .HasColumnType("float");

                    b1.Property <double>("OG_Min")
                    .HasColumnType("float");

                    b1.Property <string>("StyleGuide")
                    .IsRequired()
                    .HasColumnType("nvarchar(max)");

                    b1.Property <string>("StyleLetter")
                    .IsRequired()
                    .HasColumnType("nvarchar(max)");

                    b1.Property <int>("Type")
                    .HasColumnType("int");

                    b1.Property <int>("Version")
                    .HasColumnType("int");

                    b1.HasKey("RecipeId");

                    b1.ToTable("Styles");

                    b1.WithOwner()
                    .HasForeignKey("RecipeId");
                });

                b.Navigation("Fermentables");

                b.Navigation("Hops");

                b.Navigation("Mash")
                .IsRequired();

                b.Navigation("Miscs");

                b.Navigation("Style")
                .IsRequired();

                b.Navigation("Waters");

                b.Navigation("Yeasts");
            });
#pragma warning restore 612, 618
        }
Пример #23
0
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.1")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

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

            modelBuilder.Entity("vkaudioposter_ef.Model.Configuration", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int")
                .HasColumnName("id");

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

                b.Property <string>("AccessToken")
                .HasColumnType("nvarchar(max)")
                .HasComment("add tracks to attachments =добавить фото и музыку вложения на стену. Приложение группы доступ к группе, получается в самом приложении в ручную Standalone приложение");

                b.Property <int>("AdminId")
                .HasColumnType("int")
                .HasComment("VK account to send log messages");

                b.Property <string>("AntiCaptchaSecretKey")
                .HasColumnType("nvarchar(max)")
                .HasComment("Anticaptcha secret key");

                b.Property <string>("ApiUrl")
                .HasColumnType("nvarchar(max)")
                .HasComment("Search vk tracks api");

                b.Property <string>("ConsoleHub")
                .HasColumnType("nvarchar(max)")
                .HasComment("SignalR Hub");

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

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

                b.Property <int>("GroupId")
                .HasColumnType("int")
                .HasComment("VK community id");

                b.Property <decimal>("GroupIdSpotyShare")
                .HasColumnType("decimal(20,0)")
                .HasComment("VK community id");

                b.Property <int>("HoursPeriod")
                .HasColumnType("int")
                .HasComment("Postponed post addition time");

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

                b.Property <int>("MinutesPeriod")
                .HasColumnType("int")
                .HasComment("Postponed post time");

                b.Property <int>("OwnerId")
                .HasColumnType("int")
                .HasComment("VK account");

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

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

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

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

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

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

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

                b.Property <string>("TGAccessToken")
                .HasColumnType("nvarchar(max)")
                .HasComment("Access token bot");

                b.Property <string>("Token")
                .HasColumnType("nvarchar(max)")
                .HasComment("Загрузка фото + публикация треков (сделать через свое приложение)");

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

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

                b.Property <bool>("USEApiWS")
                .HasColumnType("bit")
                .HasComment("VK Audio api api-vk.com");

                b.Property <bool>("UseProxy")
                .HasColumnType("bit");

                b.Property <string>("UserAccesToken")
                .HasColumnType("nvarchar(max)");

                b.Property <string>("VKCommunityAccessToken")
                .HasColumnType("nvarchar(max)");

                b.Property <string>("VKCommunityAccessTokenProd")
                .HasColumnType("nvarchar(max)");

                b.Property <string>("VKLogin")
                .HasColumnType("nvarchar(max)");

                b.Property <string>("VKPassword")
                .HasColumnType("nvarchar(max)");

                b.HasKey("Id");

                b.ToTable("Configurations");
            });

            modelBuilder.Entity("vkaudioposter_ef.Model.FoundTracks", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), (int)1L, 1);

                b.Property <long?>("MediaId")
                .HasColumnType("bigint");

                b.Property <long?>("OwnerId")
                .HasColumnType("bigint");

                b.Property <string>("Trackname")
                .HasMaxLength(1024)
                .HasColumnType("nvarchar(1024)")
                .HasComment("Fulltrackname");

                b.HasKey("Id");

                b.ToTable("FoundTracks");
            });

            modelBuilder.Entity("vkaudioposter_ef.Model.ParserXpath", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), (int)1L, 1);

                b.Property <string>("Xpath")
                .HasMaxLength(1024)
                .HasColumnType("nvarchar(1024)")
                .HasComment("nodContainer for parsing (outer)");

                b.Property <string>("XpathInner")
                .HasMaxLength(1024)
                .HasColumnType("nvarchar(1024)")
                .HasComment("nodContainer for parsing (inner if need to go inside)");

                b.HasKey("Id");

                b.ToTable("ParserXpaths");
            });

            modelBuilder.Entity("vkaudioposter_ef.Model.Post", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), (int)1L, 1);

                b.Property <string>("Message")
                .HasColumnType("nvarchar(max)");

                b.Property <long?>("OwnerId")
                .HasColumnType("bigint");

                b.Property <long>("PostId")
                .HasColumnType("bigint");

                b.Property <DateTime>("PublishDate")
                .HasColumnType("DATETIME");

                b.HasKey("Id");

                b.ToTable("Posts");
            });

            modelBuilder.Entity("vkaudioposter_ef.Model.PostedPhoto", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), (int)1L, 1);

                b.Property <int?>("PostId")
                .HasColumnType("int");

                b.Property <string>("Url")
                .HasMaxLength(2056)
                .HasColumnType("varchar(2056)");

                b.HasKey("Id");

                b.HasIndex("PostId");

                b.ToTable("PostedPhotos");
            });

            modelBuilder.Entity("vkaudioposter_ef.Model.SpotyToVkShareBackendConfig", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int")
                .HasColumnName("id");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), (int)1L, 1);

                b.Property <string>("AntiCaptchaSecretKey")
                .HasColumnType("nvarchar(max)")
                .HasComment("Anticaptcha secret key");

                b.Property <decimal>("GroupIdSpotyShare")
                .HasColumnType("decimal(20,0)")
                .HasComment("VK community id");

                b.Property <string>("KateMobileToken")
                .HasColumnType("nvarchar(max)")
                .HasComment("Загрузка треков");

                b.Property <string>("RollbarBackendToken")
                .HasColumnType("nvarchar(max)");

                b.Property <string>("SpotifyClientId")
                .IsRequired()
                .HasColumnType("nvarchar(max)");

                b.Property <string>("SpotifyClientSecret")
                .IsRequired()
                .HasColumnType("nvarchar(max)");

                b.Property <string>("VKCommunityAccessTokenProd")
                .HasColumnType("nvarchar(max)");

                b.HasKey("Id");

                b.ToTable("SpotyToVkShareBackendConfigs");
            });

            modelBuilder.Entity("vkaudioposter_ef.Model.SpotyVKUser", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uniqueidentifier");

                b.Property <bool>("HasSubscription")
                .HasColumnType("bit");

                b.Property <long>("VKID")
                .HasColumnType("bigint");

                b.HasKey("Id");

                b.ToTable("SpotyVKUsers");
            });

            modelBuilder.Entity("vkaudioposter_ef.Model.TelegramUser", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), (int)1L, 1);

                b.Property <long>("ChatId")
                .HasColumnType("bigint");

                b.Property <string>("UUID")
                .HasColumnType("nvarchar(max)");

                b.HasKey("Id");

                b.ToTable("TelegramUsers");
            });

            modelBuilder.Entity("vkaudioposter_ef.Model.VKAccounts", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), (int)1L, 1);

                b.Property <bool>("Status")
                .HasColumnType("bit")
                .HasComment("Can user auth?");

                b.Property <string>("VKLogin")
                .HasColumnType("nvarchar(max)");

                b.Property <string>("VKPassword")
                .HasColumnType("nvarchar(max)");

                b.HasKey("Id");

                b.ToTable("VKAccounts");
            });

            modelBuilder.Entity("vkaudioposter_ef.parser.ConsolePhotostock", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int")
                .HasColumnName("id");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), (int)1L, 1);

                b.Property <int?>("ParserXpathId")
                .HasColumnType("int");

                b.Property <int>("Status")
                .HasColumnType("int")
                .HasComment("Enabled status. If = 0 - not included, if = 1 - included in parsing");

                b.Property <DateTime>("UpdateDate")
                .HasColumnType("datetime2")
                .HasComment("Update Date");

                b.Property <string>("Url")
                .IsRequired()
                .HasMaxLength(200)
                .HasColumnType("varchar(200)")
                .HasColumnName("URL");

                b.HasKey("Id");

                b.HasIndex("ParserXpathId");

                b.ToTable("console_Photostocks");
            });

            modelBuilder.Entity("vkaudioposter_ef.parser.Playlist", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int")
                .HasColumnName("id");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), (int)1L, 1);

                b.Property <int?>("Count")
                .HasColumnType("int");

                b.Property <int?>("FollowersTotal")
                .HasColumnType("int");

                b.Property <string>("ImageUrl")
                .HasColumnType("nvarchar(max)");

                b.Property <string>("PlaylistId")
                .IsRequired()
                .HasMaxLength(45)
                .HasColumnType("varchar(45)")
                .HasColumnName("Playlist_ID")
                .HasComment("Spotify URI");

                b.Property <string>("PlaylistName")
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnType("nvarchar(50)")
                .HasColumnName("Playlist_Name")
                .HasComment("Name of playlist");

                b.Property <int>("Status")
                .HasColumnType("int")
                .HasComment("Enabled status. If = 0 - not included, if = 1 - included in parsing");

                b.Property <DateTime>("UpdateDate")
                .HasColumnType("datetime2")
                .HasComment("Update Date");

                b.HasKey("Id");

                b.ToTable("Playlists");
            });

            modelBuilder.Entity("vkaudioposter_ef.parser.PostedTrack", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int")
                .HasColumnName("id");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), (int)1L, 1);

                b.Property <DateTime>("Date")
                .HasColumnType("DATETIME");

                b.Property <long?>("MediaId")
                .HasColumnType("bigint");

                b.Property <long?>("OwnerId")
                .HasColumnType("bigint");

                b.Property <int?>("PlaylistId")
                .HasColumnType("int");

                b.Property <int?>("PostId")
                .HasColumnType("int");

                b.Property <string>("PreviewUrl")
                .HasColumnType("nvarchar(max)");

                b.Property <string>("Trackname")
                .IsRequired()
                .HasMaxLength(1024)
                .HasColumnType("nvarchar(1024)");

                b.Property <string>("Url")
                .HasColumnType("nvarchar(max)");

                b.HasKey("Id");

                b.HasIndex("PlaylistId");

                b.HasIndex("PostId");

                b.ToTable("PostedTracks");
            });

            modelBuilder.Entity("vkaudioposter_ef.parser.UnfoundTrack", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int")
                .HasColumnName("id");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), (int)1L, 1);

                b.Property <int?>("PlaylistId")
                .HasColumnType("int");

                b.Property <string>("Trackname")
                .IsRequired()
                .HasMaxLength(150)
                .HasColumnType("nvarchar(150)")
                .HasColumnName("trackname");

                b.HasKey("Id");

                b.HasIndex("PlaylistId");

                b.ToTable("UnfoundTracks");
            });

            modelBuilder.Entity("vkaudioposter_ef.Model.PostedPhoto", b =>
            {
                b.HasOne("vkaudioposter_ef.Model.Post", "Post")
                .WithMany("PostedPhotos")
                .HasForeignKey("PostId");

                b.Navigation("Post");
            });

            modelBuilder.Entity("vkaudioposter_ef.parser.ConsolePhotostock", b =>
            {
                b.HasOne("vkaudioposter_ef.Model.ParserXpath", "ParserXpath")
                .WithMany("ConsolePhotostock")
                .HasForeignKey("ParserXpathId");

                b.Navigation("ParserXpath");
            });

            modelBuilder.Entity("vkaudioposter_ef.parser.PostedTrack", b =>
            {
                b.HasOne("vkaudioposter_ef.parser.Playlist", "Playlist")
                .WithMany("PostedTracks")
                .HasForeignKey("PlaylistId");

                b.HasOne("vkaudioposter_ef.Model.Post", "Post")
                .WithMany("PostedTracks")
                .HasForeignKey("PostId");

                b.Navigation("Playlist");

                b.Navigation("Post");
            });

            modelBuilder.Entity("vkaudioposter_ef.parser.UnfoundTrack", b =>
            {
                b.HasOne("vkaudioposter_ef.parser.Playlist", "Playlist")
                .WithMany("UnfoundTracks")
                .HasForeignKey("PlaylistId");

                b.Navigation("Playlist");
            });

            modelBuilder.Entity("vkaudioposter_ef.Model.ParserXpath", b =>
            {
                b.Navigation("ConsolePhotostock");
            });

            modelBuilder.Entity("vkaudioposter_ef.Model.Post", b =>
            {
                b.Navigation("PostedPhotos");

                b.Navigation("PostedTracks");
            });

            modelBuilder.Entity("vkaudioposter_ef.parser.Playlist", b =>
            {
                b.Navigation("PostedTracks");

                b.Navigation("UnfoundTracks");
            });
#pragma warning restore 612, 618
        }
Пример #24
0
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.2")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

            SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);

            modelBuilder.Entity("CaducaRest.Models.Caducidad", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <int>("Cantidad")
                .HasColumnType("int");

                b.Property <int>("ClienteId")
                .HasColumnType("int");

                b.Property <DateTime>("Fecha")
                .HasColumnType("datetime");

                b.Property <int>("ProductoId")
                .HasColumnType("int");

                b.HasKey("Id");

                b.HasIndex("ProductoId");

                b.HasIndex("ClienteId", "ProductoId", "Fecha")
                .IsUnique()
                .HasDatabaseName("UI_ClienteProducto");

                b.ToTable("Caducidad");
            });

            modelBuilder.Entity("CaducaRest.Models.Categoria", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <int>("Clave")
                .HasColumnType("int");

                b.Property <string>("Nombre")
                .IsRequired()
                .HasMaxLength(80)
                .HasColumnType("VARCHAR(80)");

                b.HasKey("Id");

                b.HasIndex("Clave")
                .IsUnique()
                .HasDatabaseName("UI_CategoriaClave");

                b.HasIndex("Nombre")
                .IsUnique()
                .HasDatabaseName("UI_CategoriaNombre");

                b.ToTable("Categoria");
            });

            modelBuilder.Entity("CaducaRest.Models.Cliente", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <bool>("Activo")
                .HasColumnType("bit");

                b.Property <string>("Celular")
                .HasColumnType("VARCHAR(20)");

                b.Property <int>("Clave")
                .HasColumnType("int");

                b.Property <string>("Direccion")
                .IsRequired()
                .HasColumnType("VARCHAR(200)");

                b.Property <string>("Email")
                .HasColumnType("VARCHAR(150)");

                b.Property <string>("NombreComercial")
                .IsRequired()
                .HasColumnType("VARCHAR(250)");

                b.Property <string>("RFC")
                .HasColumnType("VARCHAR(15)");

                b.Property <string>("RazonSocial")
                .IsRequired()
                .HasColumnType("VARCHAR(250)");

                b.Property <string>("SitioWeb")
                .HasColumnType("VARCHAR(20)");

                b.Property <string>("Telefono")
                .HasColumnType("VARCHAR(20)");

                b.HasKey("Id");

                b.HasIndex("Clave")
                .IsUnique()
                .HasDatabaseName("UI_ClienteCategoriaClave");

                b.HasIndex("RazonSocial")
                .IsUnique()
                .HasDatabaseName("UI_ClienteCategoriaNombre");

                b.ToTable("Cliente");
            });

            modelBuilder.Entity("CaducaRest.Models.ClienteCategoria", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <int>("CategoriaId")
                .HasColumnType("int");

                b.Property <int>("ClienteId")
                .HasColumnType("int");

                b.HasKey("Id");

                b.HasIndex("CategoriaId");

                b.HasIndex("ClienteId", "CategoriaId")
                .IsUnique()
                .HasDatabaseName("UI_ClienteCategoria");

                b.ToTable("ClienteCategoria");
            });

            modelBuilder.Entity("CaducaRest.Models.Errores", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <DateTime>("Fecha")
                .HasColumnType("datetime");

                b.Property <string>("Mensaje")
                .HasColumnType("nvarchar(max)");

                b.HasKey("Id");

                b.ToTable("Errorres");
            });

            modelBuilder.Entity("CaducaRest.Models.Historial", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <int>("Actividad")
                .HasColumnType("int");

                b.Property <DateTime>("FechaHora")
                .HasColumnType("datetime");

                b.Property <string>("Observa")
                .HasMaxLength(250)
                .HasColumnType("VARCHAR(250)");

                b.Property <int>("OrigenId")
                .HasColumnType("int");

                b.Property <int>("TablaId")
                .HasColumnType("int");

                b.Property <int?>("UsuarioId")
                .IsRequired()
                .HasColumnType("int");

                b.HasKey("Id");

                b.HasIndex("TablaId")
                .HasDatabaseName("IX_HistorialTabla");

                b.HasIndex("UsuarioId")
                .HasDatabaseName("IX_ctrUsuario");

                b.HasIndex("Actividad", "TablaId", "FechaHora")
                .HasDatabaseName("IX_Actividad");

                b.HasIndex("TablaId", "OrigenId", "Actividad")
                .HasDatabaseName("IX_Historial");

                b.ToTable("Historial");
            });

            modelBuilder.Entity("CaducaRest.Models.Permiso", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <int>("Clave")
                .HasColumnType("int");

                b.Property <string>("Nombre")
                .HasColumnType("VARCHAR(100)");

                b.HasKey("Id");

                b.HasIndex("Clave")
                .IsUnique()
                .HasDatabaseName("UI_PermisoClave");

                b.ToTable("Permiso");

                b.HasData(
                    new
                {
                    Id     = 1,
                    Clave  = 1,
                    Nombre = "Crear"
                },
                    new
                {
                    Id     = 2,
                    Clave  = 2,
                    Nombre = "Modificar"
                },
                    new
                {
                    Id     = 3,
                    Clave  = 3,
                    Nombre = "Borrar"
                },
                    new
                {
                    Id     = 4,
                    Clave  = 4,
                    Nombre = "Consultar"
                });
            });

            modelBuilder.Entity("CaducaRest.Models.Producto", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <int?>("CaducidadId")
                .HasColumnType("int");

                b.Property <int>("CategoriaId")
                .HasColumnType("int");

                b.Property <int>("Clave")
                .HasColumnType("int");

                b.Property <string>("Nombre")
                .IsRequired()
                .HasColumnType("VARCHAR(80)");

                b.HasKey("Id");

                b.HasIndex("CaducidadId");

                b.HasIndex("CategoriaId")
                .HasDatabaseName("IX_ProductoCategoria");

                b.HasIndex("Clave")
                .IsUnique()
                .HasDatabaseName("UI_ProductoClave");

                b.HasIndex("Nombre")
                .IsUnique()
                .HasDatabaseName("UI_ProductoNombre");

                b.ToTable("Producto");
            });

            modelBuilder.Entity("CaducaRest.Models.Rol", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <string>("Nombre")
                .IsRequired()
                .HasColumnType("VARCHAR(50)");

                b.HasKey("Id");

                b.ToTable("Rol");

                b.HasData(
                    new
                {
                    Id     = 1,
                    Nombre = "Administrador"
                },
                    new
                {
                    Id     = 2,
                    Nombre = "Vendedor"
                },
                    new
                {
                    Id     = 3,
                    Nombre = "Cliente"
                },
                    new
                {
                    Id     = 4,
                    Nombre = "Supervisor"
                });
            });

            modelBuilder.Entity("CaducaRest.Models.RolTablaPermiso", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <int>("RolId")
                .HasColumnType("int");

                b.Property <int>("TablaPermisoId")
                .HasColumnType("int");

                b.Property <bool>("TienePermiso")
                .HasColumnType("bit");

                b.HasKey("Id");

                b.HasIndex("RolId");

                b.HasIndex("TablaPermisoId", "RolId")
                .IsUnique()
                .HasDatabaseName("UI_RolTablaPermiso");

                b.ToTable("RolTablaPermiso");

                b.HasData(
                    new
                {
                    Id             = 1,
                    RolId          = 4,
                    TablaPermisoId = 1,
                    TienePermiso   = true
                },
                    new
                {
                    Id             = 2,
                    RolId          = 4,
                    TablaPermisoId = 2,
                    TienePermiso   = true
                },
                    new
                {
                    Id             = 3,
                    RolId          = 4,
                    TablaPermisoId = 3,
                    TienePermiso   = true
                },
                    new
                {
                    Id             = 4,
                    RolId          = 4,
                    TablaPermisoId = 4,
                    TienePermiso   = true
                },
                    new
                {
                    Id             = 5,
                    RolId          = 2,
                    TablaPermisoId = 4,
                    TienePermiso   = true
                },
                    new
                {
                    Id             = 6,
                    RolId          = 3,
                    TablaPermisoId = 4,
                    TienePermiso   = true
                },
                    new
                {
                    Id             = 7,
                    RolId          = 4,
                    TablaPermisoId = 5,
                    TienePermiso   = true
                },
                    new
                {
                    Id             = 8,
                    RolId          = 4,
                    TablaPermisoId = 6,
                    TienePermiso   = true
                },
                    new
                {
                    Id             = 9,
                    RolId          = 4,
                    TablaPermisoId = 7,
                    TienePermiso   = true
                },
                    new
                {
                    Id             = 10,
                    RolId          = 4,
                    TablaPermisoId = 8,
                    TienePermiso   = true
                },
                    new
                {
                    Id             = 11,
                    RolId          = 2,
                    TablaPermisoId = 8,
                    TienePermiso   = true
                },
                    new
                {
                    Id             = 12,
                    RolId          = 4,
                    TablaPermisoId = 9,
                    TienePermiso   = true
                },
                    new
                {
                    Id             = 13,
                    RolId          = 4,
                    TablaPermisoId = 10,
                    TienePermiso   = true
                },
                    new
                {
                    Id             = 14,
                    RolId          = 4,
                    TablaPermisoId = 11,
                    TienePermiso   = true
                },
                    new
                {
                    Id             = 15,
                    RolId          = 4,
                    TablaPermisoId = 12,
                    TienePermiso   = true
                },
                    new
                {
                    Id             = 16,
                    RolId          = 2,
                    TablaPermisoId = 12,
                    TienePermiso   = true
                },
                    new
                {
                    Id             = 17,
                    RolId          = 3,
                    TablaPermisoId = 12,
                    TienePermiso   = true
                });
            });

            modelBuilder.Entity("CaducaRest.Models.Tabla", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <string>("Descripción")
                .IsRequired()
                .HasMaxLength(40)
                .HasColumnType("VARCHAR(40)");

                b.Property <string>("Nombre")
                .IsRequired()
                .HasMaxLength(40)
                .HasColumnType("VARCHAR(40)");

                b.HasKey("Id");

                b.ToTable("Tabla");

                b.HasData(
                    new
                {
                    Id          = 1,
                    Descripción = "Permite registrar las fechas de caducidad de los productos",
                    Nombre      = "Caducidad"
                },
                    new
                {
                    Id          = 2,
                    Descripción = "Permite registrar las categorias de los productos",
                    Nombre      = "Categoria"
                },
                    new
                {
                    Id          = 3,
                    Descripción = "Permite registrar los clientes",
                    Nombre      = "Cliente"
                },
                    new
                {
                    Id          = 4,
                    Descripción = "Permite registrar las categorías de productos de cada cliente",
                    Nombre      = "ClienteCategoria"
                },
                    new
                {
                    Id          = 5,
                    Descripción = "Permite registrar los productos",
                    Nombre      = "Producto"
                },
                    new
                {
                    Id          = 6,
                    Descripción = "Permite registrar los permisos para el sistema",
                    Nombre      = "Permiso"
                },
                    new
                {
                    Id          = 7,
                    Descripción = "Permite registrar los productos",
                    Nombre      = "Producto"
                },
                    new
                {
                    Id          = 8,
                    Descripción = "Permite registrar los roles de los usuarios",
                    Nombre      = "Rol"
                },
                    new
                {
                    Id          = 9,
                    Descripción = "Permite registrar los usuarios del sistema",
                    Nombre      = "Usuario"
                },
                    new
                {
                    Id          = 10,
                    Descripción = "Permite registrar las categorias de los usuarios del sistema",
                    Nombre      = "UsuarioCategoria"
                },
                    new
                {
                    Id          = 11,
                    Descripción = "Permite registrar los clientes para los usuarios del sistema",
                    Nombre      = "UsuarioCliente"
                },
                    new
                {
                    Id          = 12,
                    Descripción = "Permite registrar los roles para los usuarios del sistema",
                    Nombre      = "UsuarioRol"
                });
            });

            modelBuilder.Entity("CaducaRest.Models.TablaPermiso", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <int>("PermisoId")
                .HasColumnType("int");

                b.Property <int>("TablaId")
                .HasColumnType("int");

                b.HasKey("Id");

                b.HasIndex("PermisoId");

                b.HasIndex("TablaId", "PermisoId")
                .IsUnique()
                .HasDatabaseName("UI_TablaPermiso");

                b.ToTable("TablaPermiso");

                b.HasData(
                    new
                {
                    Id        = 1,
                    PermisoId = 1,
                    TablaId   = 2
                },
                    new
                {
                    Id        = 2,
                    PermisoId = 2,
                    TablaId   = 2
                },
                    new
                {
                    Id        = 3,
                    PermisoId = 3,
                    TablaId   = 2
                },
                    new
                {
                    Id        = 4,
                    PermisoId = 4,
                    TablaId   = 2
                },
                    new
                {
                    Id        = 5,
                    PermisoId = 1,
                    TablaId   = 3
                },
                    new
                {
                    Id        = 6,
                    PermisoId = 2,
                    TablaId   = 3
                },
                    new
                {
                    Id        = 7,
                    PermisoId = 3,
                    TablaId   = 3
                },
                    new
                {
                    Id        = 8,
                    PermisoId = 4,
                    TablaId   = 3
                },
                    new
                {
                    Id        = 9,
                    PermisoId = 1,
                    TablaId   = 5
                },
                    new
                {
                    Id        = 10,
                    PermisoId = 2,
                    TablaId   = 5
                },
                    new
                {
                    Id        = 11,
                    PermisoId = 3,
                    TablaId   = 5
                },
                    new
                {
                    Id        = 12,
                    PermisoId = 4,
                    TablaId   = 5
                });
            });

            modelBuilder.Entity("CaducaRest.Models.Usuario", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <bool>("Activo")
                .HasColumnType("bit");

                b.Property <string>("Adicional1")
                .IsRequired()
                .HasColumnType("nvarchar(max)");

                b.Property <string>("Clave")
                .IsRequired()
                .HasMaxLength(15)
                .HasColumnType("VARCHAR(15)");

                b.Property <int>("Codigo")
                .HasColumnType("int");

                b.Property <string>("Email")
                .IsRequired()
                .HasMaxLength(80)
                .HasColumnType("VARCHAR(80)");

                b.Property <int>("Intentos")
                .HasColumnType("int");

                b.Property <string>("Nombre")
                .IsRequired()
                .HasMaxLength(200)
                .HasColumnType("VARCHAR(200)");

                b.Property <string>("Password")
                .IsRequired()
                .HasMaxLength(255)
                .HasColumnType("VARCHAR(255)");

                b.HasKey("Id");

                b.HasIndex("Clave")
                .IsUnique()
                .HasDatabaseName("UI_UsuarioClave");

                b.ToTable("Usuario");

                b.HasData(
                    new
                {
                    Id         = 1,
                    Activo     = true,
                    Adicional1 = "2a3efe03a96840478bde71ae36a20f2e",
                    Clave      = "Juan",
                    Codigo     = 0,
                    Email      = "*****@*****.**",
                    Intentos   = 0,
                    Nombre     = "Juan Peréz",
                    Password   = "******"
                },
                    new
                {
                    Id         = 2,
                    Activo     = true,
                    Adicional1 = "37b93bbd77b2d7a586cc7d5032f83808",
                    Clave      = "Maria",
                    Codigo     = 0,
                    Email      = "*****@*****.**",
                    Intentos   = 0,
                    Nombre     = "Maria Lopez",
                    Password   = "******"
                },
                    new
                {
                    Id         = 3,
                    Activo     = true,
                    Adicional1 = "5dd69f799e8ac1fd877460c4d461eb74",
                    Clave      = "Carlos",
                    Codigo     = 0,
                    Email      = "*****@*****.**",
                    Intentos   = 0,
                    Nombre     = "Carlos Hernández",
                    Password   = "******"
                });
            });

            modelBuilder.Entity("CaducaRest.Models.UsuarioAcceso", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <bool>("Activo")
                .HasColumnType("bit");

                b.Property <string>("Ciudad")
                .IsRequired()
                .HasMaxLength(300)
                .HasColumnType("VARCHAR(300)");

                b.Property <string>("Estado")
                .IsRequired()
                .HasMaxLength(300)
                .HasColumnType("VARCHAR(300)");

                b.Property <DateTime>("Fecha")
                .HasColumnType("datetime");

                b.Property <DateTime>("FechaRefresh")
                .HasColumnType("datetime");

                b.Property <bool>("MantenerSesion")
                .HasColumnType("bit");

                b.Property <string>("Navegador")
                .IsRequired()
                .HasColumnType("VARCHAR(200)");

                b.Property <string>("RefreshToken")
                .IsRequired()
                .HasColumnType("VARCHAR(200)");

                b.Property <string>("SistemaOperativo")
                .IsRequired()
                .HasColumnType("VARCHAR(200)");

                b.Property <string>("Token")
                .IsRequired()
                .HasColumnType("VARCHAR(500)");

                b.Property <int>("UsuarioId")
                .HasColumnType("int");

                b.HasKey("Id");

                b.HasIndex("RefreshToken")
                .IsUnique()
                .HasDatabaseName("UI_RefreshToken");

                b.HasIndex("UsuarioId", "Token")
                .IsUnique()
                .HasDatabaseName("UI_Token");

                b.ToTable("UsuarioAcceso");
            });

            modelBuilder.Entity("CaducaRest.Models.UsuarioCategoria", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <int>("CategoriaId")
                .HasColumnType("int");

                b.Property <int>("UsuarioId")
                .HasColumnType("int");

                b.HasKey("Id");

                b.HasIndex("CategoriaId");

                b.HasIndex("UsuarioId", "CategoriaId")
                .IsUnique()
                .HasDatabaseName("UI_UsuarioCategoria");

                b.ToTable("UsuarioCategoria");
            });

            modelBuilder.Entity("CaducaRest.Models.UsuarioCliente", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <int>("ClienteId")
                .HasColumnType("int");

                b.Property <int>("UsuarioId")
                .HasColumnType("int");

                b.HasKey("Id");

                b.HasIndex("ClienteId");

                b.HasIndex("UsuarioId", "ClienteId")
                .IsUnique()
                .HasDatabaseName("UI_UsuarioCliente");

                b.ToTable("UsuarioCliente");
            });

            modelBuilder.Entity("CaducaRest.Models.UsuarioRol", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <int>("RolId")
                .HasColumnType("int");

                b.Property <int>("UsuarioId")
                .HasColumnType("int");

                b.HasKey("Id");

                b.HasIndex("RolId");

                b.HasIndex("UsuarioId", "RolId")
                .IsUnique()
                .HasDatabaseName("UI_UsuarioRol");

                b.ToTable("UsuarioRol");

                b.HasData(
                    new
                {
                    Id        = 1,
                    RolId     = 3,
                    UsuarioId = 1
                },
                    new
                {
                    Id        = 2,
                    RolId     = 2,
                    UsuarioId = 2
                },
                    new
                {
                    Id        = 3,
                    RolId     = 1,
                    UsuarioId = 3
                });
            });

            modelBuilder.Entity("CaducaRest.Models.Caducidad", b =>
            {
                b.HasOne("CaducaRest.Models.Cliente", "Cliente")
                .WithMany("Caducidades")
                .HasForeignKey("ClienteId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();

                b.HasOne("CaducaRest.Models.Producto", "Producto")
                .WithMany("Caducidades")
                .HasForeignKey("ProductoId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();

                b.Navigation("Cliente");

                b.Navigation("Producto");
            });

            modelBuilder.Entity("CaducaRest.Models.ClienteCategoria", b =>
            {
                b.HasOne("CaducaRest.Models.Categoria", "Categoria")
                .WithMany("ClientesCategorias")
                .HasForeignKey("CategoriaId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();

                b.HasOne("CaducaRest.Models.Cliente", "Cliente")
                .WithMany("ClientesCategorias")
                .HasForeignKey("ClienteId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();

                b.Navigation("Categoria");

                b.Navigation("Cliente");
            });

            modelBuilder.Entity("CaducaRest.Models.Historial", b =>
            {
                b.HasOne("CaducaRest.Models.Tabla", null)
                .WithMany()
                .HasForeignKey("TablaId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();

                b.HasOne("CaducaRest.Models.Usuario", null)
                .WithMany()
                .HasForeignKey("UsuarioId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();
            });

            modelBuilder.Entity("CaducaRest.Models.Producto", b =>
            {
                b.HasOne("CaducaRest.Models.Caducidad", null)
                .WithMany()
                .HasForeignKey("CaducidadId")
                .OnDelete(DeleteBehavior.Restrict);
            });

            modelBuilder.Entity("CaducaRest.Models.RolTablaPermiso", b =>
            {
                b.HasOne("CaducaRest.Models.Rol", null)
                .WithMany()
                .HasForeignKey("RolId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();

                b.HasOne("CaducaRest.Models.TablaPermiso", null)
                .WithMany()
                .HasForeignKey("TablaPermisoId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();
            });

            modelBuilder.Entity("CaducaRest.Models.TablaPermiso", b =>
            {
                b.HasOne("CaducaRest.Models.Permiso", null)
                .WithMany()
                .HasForeignKey("PermisoId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();

                b.HasOne("CaducaRest.Models.Tabla", null)
                .WithMany()
                .HasForeignKey("TablaId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();
            });

            modelBuilder.Entity("CaducaRest.Models.UsuarioAcceso", b =>
            {
                b.HasOne("CaducaRest.Models.Usuario", null)
                .WithMany()
                .HasForeignKey("UsuarioId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();
            });

            modelBuilder.Entity("CaducaRest.Models.UsuarioCategoria", b =>
            {
                b.HasOne("CaducaRest.Models.Categoria", null)
                .WithMany()
                .HasForeignKey("CategoriaId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();

                b.HasOne("CaducaRest.Models.Usuario", null)
                .WithMany()
                .HasForeignKey("UsuarioId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();
            });

            modelBuilder.Entity("CaducaRest.Models.UsuarioCliente", b =>
            {
                b.HasOne("CaducaRest.Models.Cliente", null)
                .WithMany()
                .HasForeignKey("ClienteId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();

                b.HasOne("CaducaRest.Models.Usuario", null)
                .WithMany()
                .HasForeignKey("UsuarioId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();
            });

            modelBuilder.Entity("CaducaRest.Models.UsuarioRol", b =>
            {
                b.HasOne("CaducaRest.Models.Rol", null)
                .WithMany()
                .HasForeignKey("RolId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();

                b.HasOne("CaducaRest.Models.Usuario", null)
                .WithMany()
                .HasForeignKey("UsuarioId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();
            });

            modelBuilder.Entity("CaducaRest.Models.Categoria", b =>
            {
                b.Navigation("ClientesCategorias");
            });

            modelBuilder.Entity("CaducaRest.Models.Cliente", b =>
            {
                b.Navigation("Caducidades");

                b.Navigation("ClientesCategorias");
            });

            modelBuilder.Entity("CaducaRest.Models.Producto", b =>
            {
                b.Navigation("Caducidades");
            });
#pragma warning restore 612, 618
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.1")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

            SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);

            modelBuilder.Entity("EcommerceDDD.Infrastructure.Identity.Roles.UserRole", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uniqueidentifier")
                .HasDefaultValueSql("newsequentialid()");

                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("EcommerceDDD.Infrastructure.Identity.Users.ApplicationUser", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uniqueidentifier")
                .HasDefaultValueSql("newsequentialid()");

                b.Property <int>("AccessFailedCount")
                .HasColumnType("int");

                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 <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>("SecurityStamp")
                .HasColumnType("nvarchar(max)");

                b.Property <bool>("TwoFactorEnabled")
                .HasColumnType("bit");

                b.Property <string>("UserName")
                .HasMaxLength(256)
                .HasColumnType("nvarchar(256)");

                b.HasKey("Id");

                b.HasIndex("NormalizedEmail")
                .HasDatabaseName("EmailIndex");

                b.HasIndex("NormalizedUserName")
                .IsUnique()
                .HasDatabaseName("UserNameIndex")
                .HasFilter("[NormalizedUserName] IS NOT NULL");

                b.ToTable("AspNetUsers", (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")
                .HasColumnType("nvarchar(450)");

                b.Property <string>("ProviderKey")
                .HasColumnType("nvarchar(450)");

                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")
                .HasColumnType("nvarchar(450)");

                b.Property <string>("Name")
                .HasColumnType("nvarchar(450)");

                b.Property <string>("Value")
                .HasColumnType("nvarchar(max)");

                b.HasKey("UserId", "LoginProvider", "Name");

                b.ToTable("AspNetUserTokens", (string)null);
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
            {
                b.HasOne("EcommerceDDD.Infrastructure.Identity.Roles.UserRole", null)
                .WithMany()
                .HasForeignKey("RoleId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
            {
                b.HasOne("EcommerceDDD.Infrastructure.Identity.Users.ApplicationUser", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
            {
                b.HasOne("EcommerceDDD.Infrastructure.Identity.Users.ApplicationUser", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
            {
                b.HasOne("EcommerceDDD.Infrastructure.Identity.Roles.UserRole", null)
                .WithMany()
                .HasForeignKey("RoleId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("EcommerceDDD.Infrastructure.Identity.Users.ApplicationUser", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
            {
                b.HasOne("EcommerceDDD.Infrastructure.Identity.Users.ApplicationUser", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });
#pragma warning restore 612, 618
        }
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.5")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

            SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);

            modelBuilder.Entity("MyActiveLife.Database.Entities.Activity", b =>
            {
                b.Property <Guid>("ActivityId")
                .ValueGeneratedOnAdd()
                .HasColumnType("uniqueidentifier");

                b.Property <string>("ActivityName")
                .IsRequired()
                .HasColumnType("nvarchar(max)");

                b.Property <int>("ActivityTypeId")
                .HasColumnType("int");

                b.Property <string>("Description")
                .HasColumnType("nvarchar(max)");

                b.Property <string>("ExternalId")
                .HasColumnType("nvarchar(max)");

                b.Property <Guid>("SourceId")
                .HasColumnType("uniqueidentifier");

                b.Property <DateTime>("StartDateTime")
                .HasColumnType("datetime2");

                b.Property <Guid>("UserId")
                .HasColumnType("uniqueidentifier");

                b.HasKey("ActivityId");

                b.HasIndex("ActivityTypeId");

                b.HasIndex("SourceId");

                b.HasIndex("UserId");

                b.ToTable("Activity");
            });

            modelBuilder.Entity("MyActiveLife.Database.Entities.ActivityType", b =>
            {
                b.Property <int>("ActivityTypeId")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("ActivityTypeId"), 1L, 1);

                b.Property <string>("ActivityTypeName")
                .IsRequired()
                .HasColumnType("nvarchar(max)");

                b.HasKey("ActivityTypeId");

                b.ToTable("ActivityType");
            });

            modelBuilder.Entity("MyActiveLife.Database.Entities.Photo", b =>
            {
                b.Property <Guid>("PhotoId")
                .ValueGeneratedOnAdd()
                .HasColumnType("uniqueidentifier");

                b.Property <string>("ExternalId")
                .IsRequired()
                .HasColumnType("nvarchar(max)");

                b.Property <Guid>("SourceId")
                .HasColumnType("uniqueidentifier");

                b.Property <Guid>("UserId")
                .HasColumnType("uniqueidentifier");

                b.HasKey("PhotoId");

                b.HasIndex("SourceId");

                b.HasIndex("UserId");

                b.ToTable("Photo");
            });

            modelBuilder.Entity("MyActiveLife.Database.Entities.Source", b =>
            {
                b.Property <Guid>("SourceId")
                .ValueGeneratedOnAdd()
                .HasColumnType("uniqueidentifier");

                b.Property <string>("SourceName")
                .IsRequired()
                .HasColumnType("nvarchar(max)");

                b.HasKey("SourceId");

                b.ToTable("Source");
            });

            modelBuilder.Entity("MyActiveLife.Database.Entities.UserProfile", b =>
            {
                b.Property <Guid>("UserId")
                .ValueGeneratedOnAdd()
                .HasColumnType("uniqueidentifier");

                b.Property <DateTime?>("DateOfBirth")
                .HasColumnType("datetime2");

                b.Property <string>("Name")
                .HasColumnType("nvarchar(max)");

                b.HasKey("UserId");

                b.ToTable("UserProfile");
            });

            modelBuilder.Entity("MyActiveLife.Database.Entities.StravaActivity", b =>
            {
                b.HasBaseType("MyActiveLife.Database.Entities.Activity");

                b.Property <float?>("AverageCadence")
                .HasColumnType("real");

                b.Property <float?>("AverageSpeed")
                .HasColumnType("real");

                b.Property <float?>("AverageTemp")
                .HasColumnType("real");

                b.Property <float?>("AverageWatts")
                .HasColumnType("real");

                b.Property <float?>("Calories")
                .HasColumnType("real");

                b.Property <float?>("Distance")
                .HasColumnType("real");

                b.Property <TimeSpan>("ElapsedTime")
                .HasColumnType("time");

                b.Property <float?>("ElevationHigh")
                .HasColumnType("real");

                b.Property <float?>("ElevationLow")
                .HasColumnType("real");

                b.Property <float?>("Kilojoules")
                .HasColumnType("real");

                b.Property <string>("MapPolyline")
                .HasColumnType("nvarchar(max)");

                b.Property <float?>("MaxSpeed")
                .HasColumnType("real");

                b.Property <float?>("MaxWatts")
                .HasColumnType("real");

                b.Property <TimeSpan>("MovingTime")
                .HasColumnType("time");

                b.Property <float?>("SufferScore")
                .HasColumnType("real");

                b.Property <float?>("TotalElevationGain")
                .HasColumnType("real");

                b.Property <float?>("WeightedAverageWatts")
                .HasColumnType("real");

                b.ToTable("StravaActivity");
            });

            modelBuilder.Entity("MyActiveLife.Database.Entities.Activity", b =>
            {
                b.HasOne("MyActiveLife.Database.Entities.ActivityType", "ActivityType")
                .WithMany("Activities")
                .HasForeignKey("ActivityTypeId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("MyActiveLife.Database.Entities.Source", "Source")
                .WithMany()
                .HasForeignKey("SourceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("MyActiveLife.Database.Entities.UserProfile", "UserProfile")
                .WithMany("Activities")
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("ActivityType");

                b.Navigation("Source");

                b.Navigation("UserProfile");
            });

            modelBuilder.Entity("MyActiveLife.Database.Entities.Photo", b =>
            {
                b.HasOne("MyActiveLife.Database.Entities.Source", "Source")
                .WithMany()
                .HasForeignKey("SourceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("MyActiveLife.Database.Entities.UserProfile", "UserProfile")
                .WithMany("Photos")
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Source");

                b.Navigation("UserProfile");
            });

            modelBuilder.Entity("MyActiveLife.Database.Entities.StravaActivity", b =>
            {
                b.HasOne("MyActiveLife.Database.Entities.Activity", null)
                .WithOne()
                .HasForeignKey("MyActiveLife.Database.Entities.StravaActivity", "ActivityId")
                .OnDelete(DeleteBehavior.ClientCascade)
                .IsRequired();
            });

            modelBuilder.Entity("MyActiveLife.Database.Entities.ActivityType", b =>
            {
                b.Navigation("Activities");
            });

            modelBuilder.Entity("MyActiveLife.Database.Entities.UserProfile", b =>
            {
                b.Navigation("Activities");

                b.Navigation("Photos");
            });
#pragma warning restore 612, 618
        }
Пример #27
0
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.0")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

            SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);

            modelBuilder.Entity("Core.Entities.OrderAggregate.DeliveryMethod", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <string>("DeliveryTime")
                .HasColumnType("nvarchar(max)");

                b.Property <string>("Description")
                .HasColumnType("nvarchar(max)");

                b.Property <decimal>("Price")
                .HasColumnType("decimal(18,2)");

                b.Property <string>("ShortName")
                .HasColumnType("nvarchar(max)");

                b.HasKey("Id");

                b.ToTable("DeliveryMethods");
            });

            modelBuilder.Entity("Core.Entities.OrderAggregate.Order", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <string>("BuyerEmail")
                .IsRequired()
                .HasColumnType("nvarchar(max)");

                b.Property <int?>("DeliveryMethodId")
                .HasColumnType("int");

                b.Property <DateTimeOffset>("OrderDate")
                .HasColumnType("datetimeoffset");

                b.Property <string>("PaymentIntentId")
                .IsRequired()
                .HasColumnType("nvarchar(max)");

                b.Property <string>("Status")
                .IsRequired()
                .HasColumnType("nvarchar(max)");

                b.Property <decimal>("Subtotal")
                .HasColumnType("decimal(18,2)");

                b.Property <decimal>("Total")
                .HasColumnType("decimal(18,2)");

                b.HasKey("Id");

                b.HasIndex("DeliveryMethodId");

                b.ToTable("Orders");
            });

            modelBuilder.Entity("Core.Entities.OrderAggregate.OrderItem", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <int?>("OrderId")
                .HasColumnType("int");

                b.Property <decimal>("Price")
                .HasColumnType("decimal(18,2)");

                b.Property <int>("Quantity")
                .HasColumnType("int");

                b.HasKey("Id");

                b.HasIndex("OrderId");

                b.ToTable("OrderItems");
            });

            modelBuilder.Entity("Core.Entities.Photo", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <string>("FileName")
                .HasColumnType("nvarchar(max)");

                b.Property <bool>("IsMain")
                .HasColumnType("bit");

                b.Property <string>("PictureUrl")
                .HasColumnType("nvarchar(max)");

                b.Property <int>("ProductId")
                .HasColumnType("int");

                b.HasKey("Id");

                b.HasIndex("ProductId");

                b.ToTable("Photo");
            });

            modelBuilder.Entity("Core.Entities.Product", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <string>("Description")
                .IsRequired()
                .HasMaxLength(180)
                .HasColumnType("nvarchar(180)");

                b.Property <string>("Name")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("nvarchar(100)");

                b.Property <decimal>("Price")
                .HasColumnType("decimal(18,2)");

                b.Property <int>("ProductBrandId")
                .HasColumnType("int");

                b.Property <int>("ProductTypeId")
                .HasColumnType("int");

                b.HasKey("Id");

                b.HasIndex("ProductBrandId");

                b.HasIndex("ProductTypeId");

                b.ToTable("Products");
            });

            modelBuilder.Entity("Core.Entities.ProductBrand", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <string>("Name")
                .HasColumnType("nvarchar(max)");

                b.HasKey("Id");

                b.ToTable("ProductBrands");
            });

            modelBuilder.Entity("Core.Entities.ProductType", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <string>("Name")
                .HasColumnType("nvarchar(max)");

                b.HasKey("Id");

                b.ToTable("ProductTypes");
            });

            modelBuilder.Entity("Core.Entities.OrderAggregate.Order", b =>
            {
                b.HasOne("Core.Entities.OrderAggregate.DeliveryMethod", "DeliveryMethod")
                .WithMany()
                .HasForeignKey("DeliveryMethodId");

                b.OwnsOne("Core.Entities.OrderAggregate.Address", "ShipToAddress", b1 =>
                {
                    b1.Property <int>("OrderId")
                    .HasColumnType("int");

                    b1.Property <string>("City")
                    .IsRequired()
                    .HasColumnType("nvarchar(max)");

                    b1.Property <string>("FirstName")
                    .IsRequired()
                    .HasColumnType("nvarchar(max)");

                    b1.Property <string>("LastName")
                    .IsRequired()
                    .HasColumnType("nvarchar(max)");

                    b1.Property <string>("State")
                    .IsRequired()
                    .HasColumnType("nvarchar(max)");

                    b1.Property <string>("Street")
                    .IsRequired()
                    .HasColumnType("nvarchar(max)");

                    b1.Property <string>("ZipCode")
                    .IsRequired()
                    .HasColumnType("nvarchar(max)");

                    b1.HasKey("OrderId");

                    b1.ToTable("Orders");

                    b1.WithOwner()
                    .HasForeignKey("OrderId");
                });

                b.Navigation("DeliveryMethod");

                b.Navigation("ShipToAddress")
                .IsRequired();
            });

            modelBuilder.Entity("Core.Entities.OrderAggregate.OrderItem", b =>
            {
                b.HasOne("Core.Entities.OrderAggregate.Order", null)
                .WithMany("OrderItems")
                .HasForeignKey("OrderId")
                .OnDelete(DeleteBehavior.Cascade);

                b.OwnsOne("Core.Entities.OrderAggregate.ProductItemOrdered", "ItemOrdered", b1 =>
                {
                    b1.Property <int>("OrderItemId")
                    .HasColumnType("int");

                    b1.Property <string>("PictureUrl")
                    .IsRequired()
                    .HasColumnType("nvarchar(max)");

                    b1.Property <int>("ProductItemId")
                    .HasColumnType("int");

                    b1.Property <string>("ProductName")
                    .IsRequired()
                    .HasColumnType("nvarchar(max)");

                    b1.HasKey("OrderItemId");

                    b1.ToTable("OrderItems");

                    b1.WithOwner()
                    .HasForeignKey("OrderItemId");
                });

                b.Navigation("ItemOrdered")
                .IsRequired();
            });

            modelBuilder.Entity("Core.Entities.Photo", b =>
            {
                b.HasOne("Core.Entities.Product", "Product")
                .WithMany("Photos")
                .HasForeignKey("ProductId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Product");
            });

            modelBuilder.Entity("Core.Entities.Product", b =>
            {
                b.HasOne("Core.Entities.ProductBrand", "ProductBrand")
                .WithMany()
                .HasForeignKey("ProductBrandId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Core.Entities.ProductType", "ProductType")
                .WithMany()
                .HasForeignKey("ProductTypeId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("ProductBrand");

                b.Navigation("ProductType");
            });

            modelBuilder.Entity("Core.Entities.OrderAggregate.Order", b =>
            {
                b.Navigation("OrderItems");
            });

            modelBuilder.Entity("Core.Entities.Product", b =>
            {
                b.Navigation("Photos");
            });
#pragma warning restore 612, 618
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.0")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

            SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);

            modelBuilder.Entity("BlazorMovies.Shared.Entities.Genre", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <string>("Name")
                .IsRequired()
                .HasColumnType("nvarchar(max)");

                b.HasKey("Id");

                b.ToTable("Genres");
            });

            modelBuilder.Entity("BlazorMovies.Shared.Entities.Movie", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <bool>("InTheaters")
                .HasColumnType("bit");

                b.Property <string>("Poster")
                .HasColumnType("nvarchar(max)");

                b.Property <DateTime?>("ReleaseDate")
                .IsRequired()
                .HasColumnType("datetime2");

                b.Property <string>("Summary")
                .HasColumnType("nvarchar(max)");

                b.Property <string>("Title")
                .IsRequired()
                .HasColumnType("nvarchar(max)");

                b.Property <string>("Trailer")
                .HasColumnType("nvarchar(max)");

                b.HasKey("Id");

                b.ToTable("Movies");
            });

            modelBuilder.Entity("BlazorMovies.Shared.Entities.MoviesActors", b =>
            {
                b.Property <int>("MovieId")
                .HasColumnType("int");

                b.Property <int>("PersonId")
                .HasColumnType("int");

                b.Property <string>("Character")
                .HasColumnType("nvarchar(max)");

                b.Property <int>("Order")
                .HasColumnType("int");

                b.HasKey("MovieId", "PersonId");

                b.HasIndex("PersonId");

                b.ToTable("MoviesActors");
            });

            modelBuilder.Entity("BlazorMovies.Shared.Entities.MoviesGenres", b =>
            {
                b.Property <int>("MovieId")
                .HasColumnType("int");

                b.Property <int>("GenreId")
                .HasColumnType("int");

                b.HasKey("MovieId", "GenreId");

                b.HasIndex("GenreId");

                b.ToTable("MoviesGenres");
            });

            modelBuilder.Entity("BlazorMovies.Shared.Entities.Person", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <string>("Biography")
                .HasColumnType("nvarchar(max)");

                b.Property <DateTime?>("DateOfBirth")
                .IsRequired()
                .HasColumnType("datetime2");

                b.Property <string>("Name")
                .HasColumnType("nvarchar(max)");

                b.Property <string>("Picture")
                .HasColumnType("nvarchar(max)");

                b.HasKey("Id");

                b.ToTable("People");
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
            {
                b.Property <string>("Id")
                .HasColumnType("nvarchar(450)");

                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<string>", 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 <string>("RoleId")
                .IsRequired()
                .HasColumnType("nvarchar(450)");

                b.HasKey("Id");

                b.HasIndex("RoleId");

                b.ToTable("AspNetRoleClaims", (string)null);
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
            {
                b.Property <string>("Id")
                .HasColumnType("nvarchar(450)");

                b.Property <int>("AccessFailedCount")
                .HasColumnType("int");

                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 <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>("SecurityStamp")
                .HasColumnType("nvarchar(max)");

                b.Property <bool>("TwoFactorEnabled")
                .HasColumnType("bit");

                b.Property <string>("UserName")
                .HasMaxLength(256)
                .HasColumnType("nvarchar(256)");

                b.HasKey("Id");

                b.HasIndex("NormalizedEmail")
                .HasDatabaseName("EmailIndex");

                b.HasIndex("NormalizedUserName")
                .IsUnique()
                .HasDatabaseName("UserNameIndex")
                .HasFilter("[NormalizedUserName] IS NOT NULL");

                b.ToTable("AspNetUsers", (string)null);
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", 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 <string>("UserId")
                .IsRequired()
                .HasColumnType("nvarchar(450)");

                b.HasKey("Id");

                b.HasIndex("UserId");

                b.ToTable("AspNetUserClaims", (string)null);
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
            {
                b.Property <string>("LoginProvider")
                .HasColumnType("nvarchar(450)");

                b.Property <string>("ProviderKey")
                .HasColumnType("nvarchar(450)");

                b.Property <string>("ProviderDisplayName")
                .HasColumnType("nvarchar(max)");

                b.Property <string>("UserId")
                .IsRequired()
                .HasColumnType("nvarchar(450)");

                b.HasKey("LoginProvider", "ProviderKey");

                b.HasIndex("UserId");

                b.ToTable("AspNetUserLogins", (string)null);
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
            {
                b.Property <string>("UserId")
                .HasColumnType("nvarchar(450)");

                b.Property <string>("RoleId")
                .HasColumnType("nvarchar(450)");

                b.HasKey("UserId", "RoleId");

                b.HasIndex("RoleId");

                b.ToTable("AspNetUserRoles", (string)null);
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
            {
                b.Property <string>("UserId")
                .HasColumnType("nvarchar(450)");

                b.Property <string>("LoginProvider")
                .HasColumnType("nvarchar(450)");

                b.Property <string>("Name")
                .HasColumnType("nvarchar(450)");

                b.Property <string>("Value")
                .HasColumnType("nvarchar(max)");

                b.HasKey("UserId", "LoginProvider", "Name");

                b.ToTable("AspNetUserTokens", (string)null);
            });

            modelBuilder.Entity("BlazorMovies.Shared.Entities.MoviesActors", b =>
            {
                b.HasOne("BlazorMovies.Shared.Entities.Movie", "Movie")
                .WithMany("MoviesActors")
                .HasForeignKey("MovieId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("BlazorMovies.Shared.Entities.Person", "Person")
                .WithMany("MoviesActors")
                .HasForeignKey("PersonId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Movie");

                b.Navigation("Person");
            });

            modelBuilder.Entity("BlazorMovies.Shared.Entities.MoviesGenres", b =>
            {
                b.HasOne("BlazorMovies.Shared.Entities.Genre", "Genre")
                .WithMany("MoviesGenres")
                .HasForeignKey("GenreId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("BlazorMovies.Shared.Entities.Movie", "Movie")
                .WithMany("MoviesGenres")
                .HasForeignKey("MovieId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Genre");

                b.Navigation("Movie");
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
            {
                b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
                .WithMany()
                .HasForeignKey("RoleId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
            {
                b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
            {
                b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
            {
                b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
                .WithMany()
                .HasForeignKey("RoleId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
            {
                b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("BlazorMovies.Shared.Entities.Genre", b =>
            {
                b.Navigation("MoviesGenres");
            });

            modelBuilder.Entity("BlazorMovies.Shared.Entities.Movie", b =>
            {
                b.Navigation("MoviesActors");

                b.Navigation("MoviesGenres");
            });

            modelBuilder.Entity("BlazorMovies.Shared.Entities.Person", b =>
            {
                b.Navigation("MoviesActors");
            });
#pragma warning restore 612, 618
        }
Пример #29
0
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.0")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

            SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);

            modelBuilder.Entity("Nsr.RestClient.Models.ActivityLogs.ActivityLog", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <int>("ActivityLogTypeId")
                .HasColumnType("int");

                b.Property <string>("Comment")
                .HasColumnType("nvarchar(max)");

                b.Property <DateTime>("CreatedOnUtc")
                .HasColumnType("datetime2");

                b.Property <int?>("EntityId")
                .HasColumnType("int");

                b.Property <string>("EntityName")
                .HasMaxLength(400)
                .HasColumnType("nvarchar(400)");

                b.HasKey("Id");

                b.HasIndex("ActivityLogTypeId");

                b.ToTable("ActivityLog", (string)null);
            });

            modelBuilder.Entity("Nsr.RestClient.Models.ActivityLogs.ActivityLogItem", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <int>("ActivityLogId")
                .HasColumnType("int");

                b.Property <int>("EntityId")
                .HasColumnType("int");

                b.Property <string>("EntityKey")
                .HasMaxLength(400)
                .HasColumnType("nvarchar(400)");

                b.Property <int>("LanguageId")
                .HasColumnType("int");

                b.Property <string>("NewValue")
                .HasColumnType("nvarchar(max)");

                b.Property <string>("OldValue")
                .HasColumnType("nvarchar(max)");

                b.HasKey("Id");

                b.HasIndex("ActivityLogId");

                b.ToTable("ActivityLogItem", (string)null);
            });

            modelBuilder.Entity("Nsr.RestClient.Models.ActivityLogs.ActivityLogType", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <bool>("Enabled")
                .HasColumnType("bit");

                b.Property <string>("Name")
                .IsRequired()
                .HasMaxLength(200)
                .HasColumnType("nvarchar(200)");

                b.Property <string>("SystemKeyword")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("nvarchar(100)");

                b.HasKey("Id");

                b.ToTable("ActivityLogType", (string)null);
            });

            modelBuilder.Entity("Nsr.RestClient.Models.ActivityLogs.ActivityLog", b =>
            {
                b.HasOne("Nsr.RestClient.Models.ActivityLogs.ActivityLogType", "ActivityLogType")
                .WithMany()
                .HasForeignKey("ActivityLogTypeId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("ActivityLogType");
            });

            modelBuilder.Entity("Nsr.RestClient.Models.ActivityLogs.ActivityLogItem", b =>
            {
                b.HasOne("Nsr.RestClient.Models.ActivityLogs.ActivityLog", "ActivityLog")
                .WithMany("ActivityLogItems")
                .HasForeignKey("ActivityLogId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("ActivityLog");
            });

            modelBuilder.Entity("Nsr.RestClient.Models.ActivityLogs.ActivityLog", b =>
            {
                b.Navigation("ActivityLogItems");
            });
#pragma warning restore 612, 618
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.0")
            .HasAnnotation("Relational:MaxIdentifierLength", 128);

            SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);

            modelBuilder.HasSequence <int>("PollId")
            .StartsAt(10000000L);

            modelBuilder.Entity("RaidBattlesBot.Model.Friendship", b =>
            {
                b.Property <long>("Id")
                .HasColumnType("bigint");

                b.Property <long>("FriendId")
                .HasColumnType("bigint");

                b.Property <DateTimeOffset?>("Modified")
                .HasColumnType("datetimeoffset");

                b.Property <int?>("PollId")
                .HasColumnType("int");

                b.Property <int>("Type")
                .HasColumnType("int");

                b.HasKey("Id", "FriendId");

                b.HasIndex("PollId");

                b.ToTable("Friendship", (string)null);
            });

            modelBuilder.Entity("RaidBattlesBot.Model.Notification", b =>
            {
                b.Property <int>("PollId")
                .HasColumnType("int");

                b.Property <long>("ChatId")
                .HasColumnType("bigint");

                b.Property <byte>("Type")
                .HasColumnType("tinyint");

                b.Property <long?>("BotId")
                .HasColumnType("bigint");

                b.Property <DateTimeOffset?>("DateTime")
                .HasColumnType("datetimeoffset");

                b.Property <long?>("MessageId")
                .HasColumnType("bigint");

                b.HasKey("PollId", "ChatId", "Type");

                b.ToTable("Notifications", (string)null);
            });

            modelBuilder.Entity("RaidBattlesBot.Model.Player", b =>
            {
                b.Property <long>("UserId")
                .HasColumnType("bigint");

                b.Property <bool?>("AutoApproveFriendship")
                .HasColumnType("bit");

                b.Property <long?>("FriendCode")
                .HasColumnType("bigint");

                b.Property <DateTimeOffset?>("Modified")
                .HasColumnType("datetimeoffset");

                b.Property <string>("Nickname")
                .HasColumnType("nvarchar(max)");

                b.HasKey("UserId");

                b.ToTable("Players", (string)null);
            });

            modelBuilder.Entity("RaidBattlesBot.Model.Poll", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int")
                .HasDefaultValueSql("NEXT VALUE FOR PollId");

                b.Property <int?>("AllowedVotes")
                .HasColumnType("int");

                b.Property <bool>("Cancelled")
                .HasColumnType("bit");

                b.Property <bool>("ExRaidGym")
                .HasColumnType("bit");

                b.Property <DateTimeOffset?>("Modified")
                .HasColumnType("datetimeoffset");

                b.Property <long?>("Owner")
                .HasColumnType("bigint");

                b.Property <string>("PortalId")
                .HasColumnType("nvarchar(450)");

                b.Property <int?>("RaidId")
                .HasColumnType("int");

                b.Property <DateTimeOffset?>("Time")
                .HasColumnType("datetimeoffset");

                b.Property <string>("TimeZoneId")
                .HasColumnType("nvarchar(max)");

                b.Property <string>("Title")
                .HasColumnType("nvarchar(max)");

                b.HasKey("Id");

                b.HasIndex("Id")
                .IsUnique();

                b.HasIndex("PortalId");

                b.HasIndex("RaidId");

                b.HasIndex("Time");

                b.ToTable("Polls", (string)null);
            });

            modelBuilder.Entity("RaidBattlesBot.Model.PollMessage", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <long?>("BotId")
                .HasColumnType("bigint");

                b.Property <long?>("ChatId")
                .HasColumnType("bigint");

                b.Property <int?>("ChatType")
                .HasColumnType("int");

                b.Property <string>("InlineMessageId")
                .HasColumnType("nvarchar(max)");

                b.Property <int?>("MessageId")
                .HasColumnType("int");

                b.Property <DateTimeOffset?>("Modified")
                .HasColumnType("datetimeoffset");

                b.Property <int>("PollId")
                .HasColumnType("int");

                b.Property <byte?>("PollMode")
                .HasColumnType("tinyint");

                b.Property <long?>("UserId")
                .HasColumnType("bigint");

                b.HasKey("Id");

                b.HasIndex("PollId");

                b.HasIndex("ChatId", "MessageId");

                b.ToTable("Messages", (string)null);
            });

            modelBuilder.Entity("RaidBattlesBot.Model.Portal", b =>
            {
                b.Property <string>("Guid")
                .HasColumnType("nvarchar(450)");

                b.Property <string>("Address")
                .HasColumnType("nvarchar(max)");

                b.Property <string>("Image")
                .HasColumnType("nvarchar(max)");

                b.Property <decimal>("Latitude")
                .HasColumnType("decimal(18,15)");

                b.Property <decimal>("Longitude")
                .HasColumnType("decimal(18,15)");

                b.Property <DateTimeOffset?>("Modified")
                .HasColumnType("datetimeoffset");

                b.Property <string>("Name")
                .HasColumnType("nvarchar(max)");

                b.HasKey("Guid");

                b.ToTable("Portals", (string)null);
            });

            modelBuilder.Entity("RaidBattlesBot.Model.Raid", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <string>("Description")
                .HasColumnType("nvarchar(max)");

                b.Property <int?>("EggRaidId")
                .HasColumnType("int");

                b.Property <DateTimeOffset?>("EndTime")
                .HasColumnType("datetimeoffset");

                b.Property <string>("Gym")
                .HasColumnType("nvarchar(max)");

                b.Property <decimal?>("Lat")
                .HasColumnType("decimal(18,15)");

                b.Property <decimal?>("Lon")
                .HasColumnType("decimal(18,15)");

                b.Property <DateTimeOffset?>("Modified")
                .HasColumnType("datetimeoffset");

                b.Property <string>("Move1")
                .HasColumnType("nvarchar(max)");

                b.Property <string>("Move2")
                .HasColumnType("nvarchar(max)");

                b.Property <string>("Name")
                .HasColumnType("nvarchar(max)");

                b.Property <string>("NearByAddress")
                .HasColumnType("nvarchar(max)");

                b.Property <string>("NearByPlaceId")
                .HasColumnType("nvarchar(max)");

                b.Property <int?>("Pokemon")
                .HasColumnType("int");

                b.Property <string>("PossibleGym")
                .HasColumnType("nvarchar(max)");

                b.Property <int?>("RaidBossLevel")
                .HasColumnType("int");

                b.Property <DateTimeOffset?>("StartTime")
                .HasColumnType("datetimeoffset");

                b.Property <string>("Title")
                .HasColumnType("nvarchar(max)");

                b.HasKey("Id");

                b.HasIndex("EggRaidId")
                .IsUnique()
                .HasFilter("[EggRaidId] IS NOT NULL");

                b.ToTable("Raids", (string)null);
            });

            modelBuilder.Entity("RaidBattlesBot.Model.ReplyNotification", b =>
            {
                b.Property <long?>("BotId")
                .HasColumnType("bigint");

                b.Property <long>("ChatId")
                .HasColumnType("bigint");

                b.Property <long>("FromChatId")
                .HasColumnType("bigint");

                b.Property <int>("FromMessageId")
                .HasColumnType("int");

                b.Property <long?>("FromUserId")
                .HasColumnType("bigint");

                b.Property <int?>("MessageId")
                .HasColumnType("int");

                b.Property <DateTimeOffset?>("Modified")
                .HasColumnType("datetimeoffset");

                b.Property <int?>("PollId")
                .HasColumnType("int");

                b.HasKey("BotId", "ChatId", "FromChatId", "FromMessageId");

                b.HasIndex("MessageId");

                b.HasIndex("PollId");

                b.ToTable("ReplyNotifications", (string)null);
            });

            modelBuilder.Entity("RaidBattlesBot.Model.Settings", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <long>("Chat")
                .HasColumnType("bigint");

                b.Property <int>("Format")
                .ValueGeneratedOnAdd()
                .HasColumnType("int")
                .HasDefaultValue(71108369);

                b.Property <DateTimeOffset?>("Modified")
                .HasColumnType("datetimeoffset");

                b.Property <int>("Order")
                .HasColumnType("int");

                b.HasKey("Id");

                b.HasIndex("Chat");

                SqlServerIndexBuilderExtensions.IncludeProperties(b.HasIndex("Chat"), new[] { "Format" });

                b.ToTable("Settings", (string)null);
            });

            modelBuilder.Entity("RaidBattlesBot.Model.TimeZoneSettings", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property <int>("Id"), 1L, 1);

                b.Property <long>("ChatId")
                .HasColumnType("bigint");

                b.Property <string>("TimeZone")
                .HasColumnType("nvarchar(max)");

                b.HasKey("Id");

                b.HasIndex("ChatId");

                b.ToTable("TimeZoneSettings", (string)null);
            });

            modelBuilder.Entity("RaidBattlesBot.Model.UserSettings", b =>
            {
                b.Property <long>("UserId")
                .HasColumnType("bigint");

                b.Property <decimal?>("Lat")
                .HasColumnType("decimal(18,15)");

                b.Property <decimal?>("Lon")
                .HasColumnType("decimal(18,15)");

                b.Property <string>("TimeZoneId")
                .HasMaxLength(32)
                .HasColumnType("nvarchar(32)");

                b.HasKey("UserId");

                b.ToTable("UserSettings", (string)null);
            });

            modelBuilder.Entity("RaidBattlesBot.Model.Vote", b =>
            {
                b.Property <int>("PollId")
                .HasColumnType("int");

                b.Property <long>("UserId")
                .HasColumnType("bigint");

                b.Property <long?>("BotId")
                .HasColumnType("bigint");

                b.Property <string>("FirstName")
                .HasColumnType("nvarchar(max)");

                b.Property <string>("LastName")
                .HasColumnType("nvarchar(max)");

                b.Property <DateTimeOffset?>("Modified")
                .HasColumnType("datetimeoffset");

                b.Property <int?>("Team")
                .HasColumnType("int");

                b.Property <string>("Username")
                .HasColumnType("nvarchar(max)");

                b.HasKey("PollId", "UserId");

                b.HasIndex("PollId");

                b.HasIndex("UserId");

                b.ToTable("Votes", (string)null);
            });

            modelBuilder.Entity("RaidBattlesBot.Model.Notification", b =>
            {
                b.HasOne("RaidBattlesBot.Model.Poll", "Poll")
                .WithMany("Notifications")
                .HasForeignKey("PollId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Poll");
            });

            modelBuilder.Entity("RaidBattlesBot.Model.Poll", b =>
            {
                b.HasOne("RaidBattlesBot.Model.Portal", "Portal")
                .WithMany()
                .HasForeignKey("PortalId");

                b.HasOne("RaidBattlesBot.Model.Raid", "Raid")
                .WithMany("Polls")
                .HasForeignKey("RaidId");

                b.Navigation("Portal");

                b.Navigation("Raid");
            });

            modelBuilder.Entity("RaidBattlesBot.Model.PollMessage", b =>
            {
                b.HasOne("RaidBattlesBot.Model.Poll", "Poll")
                .WithMany("Messages")
                .HasForeignKey("PollId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Poll");
            });

            modelBuilder.Entity("RaidBattlesBot.Model.Raid", b =>
            {
                b.HasOne("RaidBattlesBot.Model.Raid", "EggRaid")
                .WithOne("PostEggRaid")
                .HasForeignKey("RaidBattlesBot.Model.Raid", "EggRaidId");

                b.Navigation("EggRaid");
            });

            modelBuilder.Entity("RaidBattlesBot.Model.ReplyNotification", b =>
            {
                b.HasOne("RaidBattlesBot.Model.Poll", "Poll")
                .WithMany()
                .HasForeignKey("PollId");

                b.Navigation("Poll");
            });

            modelBuilder.Entity("RaidBattlesBot.Model.Vote", b =>
            {
                b.HasOne("RaidBattlesBot.Model.Poll", null)
                .WithMany("Votes")
                .HasForeignKey("PollId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("RaidBattlesBot.Model.Poll", b =>
            {
                b.Navigation("Messages");

                b.Navigation("Notifications");

                b.Navigation("Votes");
            });

            modelBuilder.Entity("RaidBattlesBot.Model.Raid", b =>
            {
                b.Navigation("Polls");

                b.Navigation("PostEggRaid");
            });
#pragma warning restore 612, 618
        }