protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.0-rc.2.21480.5")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("Damselfly.Core.DbModels.AppIdentityUser", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

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

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

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

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

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

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

                b.Property <DateTimeOffset?>("LockoutEnd")
                .HasColumnType("timestamp with time zone");

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

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

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("ApplicationRoleId");

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

                b.HasIndex("NormalizedUserName")
                .IsUnique()
                .HasDatabaseName("UserNameIndex");

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

            modelBuilder.Entity("Damselfly.Core.DbModels.ApplicationRole", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

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

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

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

                b.HasKey("Id");

                b.HasIndex("NormalizedName")
                .IsUnique()
                .HasDatabaseName("RoleNameIndex");

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

                b.HasData(
                    new
                {
                    Id = 1,
                    ConcurrencyStamp = "d0cb56c4-daf0-45d2-bb3f-0e88cec24dcd",
                    Name             = "User",
                    NormalizedName   = "USER"
                },
                    new
                {
                    Id = 2,
                    ConcurrencyStamp = "197341df-56a0-4aef-ba40-6e7b3f7b04d5",
                    Name             = "Admin",
                    NormalizedName   = "ADMIN"
                },
                    new
                {
                    Id = 3,
                    ConcurrencyStamp = "f1513788-d2ab-4f8a-b706-aa780e58b643",
                    Name             = "ReadOnly",
                    NormalizedName   = "READONLY"
                });
            });

            modelBuilder.Entity("Damselfly.Core.DbModels.ApplicationUserRole", b =>
            {
                b.Property <int>("UserId")
                .HasColumnType("integer");

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

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

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

                b.HasIndex("ApplicationRoleId");

                b.HasIndex("RoleId");

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

            modelBuilder.Entity("Damselfly.Core.Models.Basket", b =>
            {
                b.Property <int>("BasketId")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("BasketId"));

                b.Property <DateTime>("DateAdded")
                .HasColumnType("timestamp with time zone");

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

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

                b.HasKey("BasketId");

                b.HasIndex("UserId");

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

            modelBuilder.Entity("Damselfly.Core.Models.BasketEntry", b =>
            {
                b.Property <int>("BasketEntryId")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("BasketEntryId"));

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

                b.Property <DateTime>("DateAdded")
                .HasColumnType("timestamp with time zone");

                b.Property <int>("ImageId")
                .HasColumnType("integer");

                b.HasKey("BasketEntryId");

                b.HasIndex("BasketId");

                b.HasIndex("ImageId", "BasketId")
                .IsUnique();

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

            modelBuilder.Entity("Damselfly.Core.Models.Camera", b =>
            {
                b.Property <int>("CameraId")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("CameraId"));

                b.Property <string>("Make")
                .HasColumnType("text");

                b.Property <string>("Model")
                .HasColumnType("text");

                b.Property <string>("Serial")
                .HasColumnType("text");

                b.HasKey("CameraId");

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

            modelBuilder.Entity("Damselfly.Core.Models.CloudTransaction", b =>
            {
                b.Property <int>("CloudTransactionId")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("CloudTransactionId"));

                b.Property <DateTime>("Date")
                .HasColumnType("timestamp with time zone");

                b.Property <int>("TransCount")
                .HasColumnType("integer");

                b.Property <int>("TransType")
                .HasColumnType("integer");

                b.HasKey("CloudTransactionId");

                b.HasIndex("Date", "TransType");

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

            modelBuilder.Entity("Damselfly.Core.Models.ConfigSetting", b =>
            {
                b.Property <int>("ConfigSettingId")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("ConfigSettingId"));

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

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

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

                b.HasKey("ConfigSettingId");

                b.HasIndex("UserId");

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

            modelBuilder.Entity("Damselfly.Core.Models.ExifOperation", b =>
            {
                b.Property <int>("ExifOperationId")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("ExifOperationId"));

                b.Property <int>("ImageId")
                .HasColumnType("integer");

                b.Property <int>("Operation")
                .HasColumnType("integer");

                b.Property <int>("State")
                .HasColumnType("integer");

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

                b.Property <DateTime>("TimeStamp")
                .HasColumnType("timestamp with time zone");

                b.Property <int>("Type")
                .HasColumnType("integer");

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

                b.HasKey("ExifOperationId");

                b.HasIndex("TimeStamp");

                b.HasIndex("UserId");

                b.HasIndex("ImageId", "Text");

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

            modelBuilder.Entity("Damselfly.Core.Models.ExportConfig", b =>
            {
                b.Property <int>("ExportConfigId")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("ExportConfigId"));

                b.Property <bool>("KeepFolders")
                .HasColumnType("boolean");

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

                b.Property <int>("Size")
                .HasColumnType("integer");

                b.Property <int>("Type")
                .HasColumnType("integer");

                b.Property <string>("WatermarkText")
                .HasColumnType("text");

                b.HasKey("ExportConfigId");

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

            modelBuilder.Entity("Damselfly.Core.Models.Folder", b =>
            {
                b.Property <int>("FolderId")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("FolderId"));

                b.Property <DateTime?>("FolderScanDate")
                .HasColumnType("timestamp with time zone");

                b.Property <int>("ParentFolderId")
                .HasColumnType("integer");

                b.Property <string>("Path")
                .HasColumnType("text");

                b.HasKey("FolderId");

                b.HasIndex("FolderScanDate");

                b.HasIndex("Path");

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

            modelBuilder.Entity("Damselfly.Core.Models.FTSTag", b =>
            {
                b.Property <int>("FTSTagId")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("FTSTagId"));

                b.Property <string>("Keyword")
                .HasColumnType("text");

                b.HasKey("FTSTagId");

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

            modelBuilder.Entity("Damselfly.Core.Models.Hash", b =>
            {
                b.Property <int>("HashId")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("HashId"));

                b.Property <int>("ImageId")
                .HasColumnType("integer");

                b.Property <string>("MD5ImageHash")
                .HasColumnType("text");

                b.Property <string>("PerceptualHex1")
                .HasColumnType("text");

                b.Property <string>("PerceptualHex2")
                .HasColumnType("text");

                b.Property <string>("PerceptualHex3")
                .HasColumnType("text");

                b.Property <string>("PerceptualHex4")
                .HasColumnType("text");

                b.HasKey("HashId");

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

                b.HasIndex("MD5ImageHash");

                b.HasIndex("PerceptualHex1", "PerceptualHex2", "PerceptualHex3", "PerceptualHex4");

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

            modelBuilder.Entity("Damselfly.Core.Models.Image", b =>
            {
                b.Property <int>("ImageId")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("ImageId"));

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

                b.Property <double>("ClassificationScore")
                .HasColumnType("double precision");

                b.Property <DateTime>("FileCreationDate")
                .HasColumnType("timestamp with time zone");

                b.Property <DateTime>("FileLastModDate")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("FileName")
                .HasColumnType("text");

                b.Property <int>("FileSizeBytes")
                .HasColumnType("integer");

                b.Property <int>("FolderId")
                .HasColumnType("integer");

                b.Property <DateTime>("LastUpdated")
                .HasColumnType("timestamp with time zone");

                b.Property <DateTime>("SortDate")
                .HasColumnType("timestamp with time zone");

                b.HasKey("ImageId");

                b.HasIndex("FileLastModDate");

                b.HasIndex("FileName");

                b.HasIndex("FolderId");

                b.HasIndex("LastUpdated");

                b.HasIndex("SortDate");

                b.HasIndex("FileName", "FolderId")
                .IsUnique();

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

            modelBuilder.Entity("Damselfly.Core.Models.ImageClassification", b =>
            {
                b.Property <int>("ClassificationId")
                .HasColumnType("integer");

                b.Property <string>("Label")
                .HasColumnType("text");

                b.HasKey("ClassificationId");

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

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

            modelBuilder.Entity("Damselfly.Core.Models.ImageMetaData", b =>
            {
                b.Property <int>("MetaDataId")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("MetaDataId"));

                b.Property <DateTime?>("AILastUpdated")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("AverageColor")
                .HasColumnType("text");

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

                b.Property <string>("Caption")
                .HasColumnType("text");

                b.Property <string>("Copyright")
                .HasColumnType("text");

                b.Property <string>("Credit")
                .HasColumnType("text");

                b.Property <DateTime>("DateTaken")
                .HasColumnType("timestamp with time zone");

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

                b.Property <string>("DominantColor")
                .HasColumnType("text");

                b.Property <string>("Exposure")
                .HasColumnType("text");

                b.Property <string>("FNum")
                .HasColumnType("text");

                b.Property <bool>("FlashFired")
                .HasColumnType("boolean");

                b.Property <int>("Height")
                .HasColumnType("integer");

                b.Property <string>("ISO")
                .HasColumnType("text");

                b.Property <int>("ImageId")
                .HasColumnType("integer");

                b.Property <DateTime>("LastUpdated")
                .HasColumnType("timestamp with time zone");

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

                b.Property <int>("Rating")
                .HasColumnType("integer");

                b.Property <DateTime?>("ThumbLastUpdated")
                .HasColumnType("timestamp with time zone");

                b.Property <int>("Width")
                .HasColumnType("integer");

                b.HasKey("MetaDataId");

                b.HasIndex("AILastUpdated");

                b.HasIndex("CameraId");

                b.HasIndex("DateTaken");

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

                b.HasIndex("LensId");

                b.HasIndex("ThumbLastUpdated");

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

            modelBuilder.Entity("Damselfly.Core.Models.ImageObject", b =>
            {
                b.Property <int>("ImageObjectId")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("ImageObjectId"));

                b.Property <int>("ImageId")
                .HasColumnType("integer");

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

                b.Property <int>("RecogntionSource")
                .HasColumnType("integer");

                b.Property <int>("RectHeight")
                .HasColumnType("integer");

                b.Property <int>("RectWidth")
                .HasColumnType("integer");

                b.Property <int>("RectX")
                .HasColumnType("integer");

                b.Property <int>("RectY")
                .HasColumnType("integer");

                b.Property <double>("Score")
                .HasColumnType("double precision");

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

                b.Property <string>("Type")
                .HasColumnType("text");

                b.HasKey("ImageObjectId");

                b.HasIndex("ImageId");

                b.HasIndex("PersonId");

                b.HasIndex("TagId");

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

            modelBuilder.Entity("Damselfly.Core.Models.ImageTag", b =>
            {
                b.Property <int>("ImageId")
                .HasColumnType("integer");

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

                b.HasKey("ImageId", "TagId");

                b.HasIndex("TagId");

                b.HasIndex("ImageId", "TagId")
                .IsUnique();

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

            modelBuilder.Entity("Damselfly.Core.Models.Lens", b =>
            {
                b.Property <int>("LensId")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("LensId"));

                b.Property <string>("Make")
                .HasColumnType("text");

                b.Property <string>("Model")
                .HasColumnType("text");

                b.Property <string>("Serial")
                .HasColumnType("text");

                b.HasKey("LensId");

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

            modelBuilder.Entity("Damselfly.Core.Models.Person", b =>
            {
                b.Property <int>("PersonId")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("PersonId"));

                b.Property <string>("AzurePersonId")
                .HasColumnType("text");

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

                b.Property <int>("State")
                .HasColumnType("integer");

                b.HasKey("PersonId");

                b.HasIndex("State");

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

            modelBuilder.Entity("Damselfly.Core.Models.Tag", b =>
            {
                b.Property <int>("TagId")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("TagId"));

                b.Property <bool>("Favourite")
                .HasColumnType("boolean");

                b.Property <string>("Keyword")
                .IsRequired()
                .HasColumnType("text");

                b.Property <int>("TagType")
                .HasColumnType("integer");

                b.Property <DateTime>("TimeStamp")
                .HasColumnType("timestamp with time zone");

                b.HasKey("TagId");

                b.HasIndex("Keyword")
                .IsUnique()
                .HasAnnotation("Npgsql:TsVectorConfig", "english");

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

            modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <string>("FriendlyName")
                .HasColumnType("text");

                b.Property <string>("Xml")
                .HasColumnType("text");

                b.HasKey("Id");

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

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

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

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

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

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

                b.HasKey("Id");

                b.HasIndex("RoleId");

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

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

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

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

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

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

                b.HasKey("Id");

                b.HasIndex("UserId");

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
            {
                b.Property <string>("LoginProvider")
                .HasColumnType("text");

                b.Property <string>("ProviderKey")
                .HasColumnType("text");

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

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

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

                b.HasIndex("UserId");

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

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

                b.Property <string>("LoginProvider")
                .HasColumnType("text");

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

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

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

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

            modelBuilder.Entity("Damselfly.Core.DbModels.AppIdentityUser", b =>
            {
                b.HasOne("Damselfly.Core.DbModels.ApplicationRole", null)
                .WithMany("AspNetUsers")
                .HasForeignKey("ApplicationRoleId");
            });

            modelBuilder.Entity("Damselfly.Core.DbModels.ApplicationUserRole", b =>
            {
                b.HasOne("Damselfly.Core.DbModels.ApplicationRole", null)
                .WithMany("UserRoles")
                .HasForeignKey("ApplicationRoleId");

                b.HasOne("Damselfly.Core.DbModels.ApplicationRole", "Role")
                .WithMany()
                .HasForeignKey("RoleId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Damselfly.Core.DbModels.AppIdentityUser", "User")
                .WithMany("UserRoles")
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Role");

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

            modelBuilder.Entity("Damselfly.Core.Models.Basket", b =>
            {
                b.HasOne("Damselfly.Core.DbModels.AppIdentityUser", "User")
                .WithMany()
                .HasForeignKey("UserId");

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

            modelBuilder.Entity("Damselfly.Core.Models.BasketEntry", b =>
            {
                b.HasOne("Damselfly.Core.Models.Basket", "Basket")
                .WithMany("BasketEntries")
                .HasForeignKey("BasketId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Damselfly.Core.Models.Image", "Image")
                .WithMany("BasketEntries")
                .HasForeignKey("ImageId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Basket");

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

            modelBuilder.Entity("Damselfly.Core.Models.ConfigSetting", b =>
            {
                b.HasOne("Damselfly.Core.DbModels.AppIdentityUser", "User")
                .WithMany()
                .HasForeignKey("UserId");

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

            modelBuilder.Entity("Damselfly.Core.Models.ExifOperation", b =>
            {
                b.HasOne("Damselfly.Core.Models.Image", "Image")
                .WithMany()
                .HasForeignKey("ImageId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Damselfly.Core.DbModels.AppIdentityUser", "User")
                .WithMany()
                .HasForeignKey("UserId");

                b.Navigation("Image");

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

            modelBuilder.Entity("Damselfly.Core.Models.Hash", b =>
            {
                b.HasOne("Damselfly.Core.Models.Image", "Image")
                .WithOne("Hash")
                .HasForeignKey("Damselfly.Core.Models.Hash", "ImageId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Damselfly.Core.Models.Image", b =>
            {
                b.HasOne("Damselfly.Core.Models.Folder", "Folder")
                .WithMany("Images")
                .HasForeignKey("FolderId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Damselfly.Core.Models.ImageClassification", b =>
            {
                b.HasOne("Damselfly.Core.Models.Image", null)
                .WithOne("Classification")
                .HasForeignKey("Damselfly.Core.Models.ImageClassification", "ClassificationId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Damselfly.Core.Models.ImageMetaData", b =>
            {
                b.HasOne("Damselfly.Core.Models.Camera", "Camera")
                .WithMany()
                .HasForeignKey("CameraId");

                b.HasOne("Damselfly.Core.Models.Image", "Image")
                .WithOne("MetaData")
                .HasForeignKey("Damselfly.Core.Models.ImageMetaData", "ImageId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Damselfly.Core.Models.Lens", "Lens")
                .WithMany()
                .HasForeignKey("LensId");

                b.Navigation("Camera");

                b.Navigation("Image");

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

            modelBuilder.Entity("Damselfly.Core.Models.ImageObject", b =>
            {
                b.HasOne("Damselfly.Core.Models.Image", "Image")
                .WithMany("ImageObjects")
                .HasForeignKey("ImageId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Damselfly.Core.Models.Person", "Person")
                .WithMany()
                .HasForeignKey("PersonId");

                b.HasOne("Damselfly.Core.Models.Tag", "Tag")
                .WithMany("ImageObjects")
                .HasForeignKey("TagId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Image");

                b.Navigation("Person");

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

            modelBuilder.Entity("Damselfly.Core.Models.ImageTag", b =>
            {
                b.HasOne("Damselfly.Core.Models.Image", "Image")
                .WithMany("ImageTags")
                .HasForeignKey("ImageId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Damselfly.Core.Models.Tag", "Tag")
                .WithMany("ImageTags")
                .HasForeignKey("TagId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Image");

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
            {
                b.HasOne("Damselfly.Core.DbModels.ApplicationRole", null)
                .WithMany()
                .HasForeignKey("RoleId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
            {
                b.HasOne("Damselfly.Core.DbModels.AppIdentityUser", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
            {
                b.HasOne("Damselfly.Core.DbModels.AppIdentityUser", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
            {
                b.HasOne("Damselfly.Core.DbModels.AppIdentityUser", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Damselfly.Core.DbModels.AppIdentityUser", b =>
            {
                b.Navigation("UserRoles");
            });

            modelBuilder.Entity("Damselfly.Core.DbModels.ApplicationRole", b =>
            {
                b.Navigation("AspNetUsers");

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

            modelBuilder.Entity("Damselfly.Core.Models.Basket", b =>
            {
                b.Navigation("BasketEntries");
            });

            modelBuilder.Entity("Damselfly.Core.Models.Folder", b =>
            {
                b.Navigation("Images");
            });

            modelBuilder.Entity("Damselfly.Core.Models.Image", b =>
            {
                b.Navigation("BasketEntries");

                b.Navigation("Classification");

                b.Navigation("Hash");

                b.Navigation("ImageObjects");

                b.Navigation("ImageTags");

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

            modelBuilder.Entity("Damselfly.Core.Models.Tag", b =>
            {
                b.Navigation("ImageObjects");

                b.Navigation("ImageTags");
            });
#pragma warning restore 612, 618
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasDefaultSchema("KinkModule")
            .HasAnnotation("ProductVersion", "6.0.0")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);
            NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "fuzzystrmatch");
            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Core.Model.Users.User", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .HasColumnName("id");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <string>("Bio")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("bio");
                b.Property <long>("DiscordID")
                .HasColumnType("bigint")
                .HasColumnName("discord_id");
                b.Property <int?>("Timezone")
                .HasColumnType("integer")
                .HasColumnName("timezone");
                b.HasKey("ID")
                .HasName("pk_users");
                b.ToTable("Users", "Core", t => t.ExcludeFromMigrations());
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Kinks.Model.Kink", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .HasColumnName("id");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <int>("Category")
                .HasColumnType("integer")
                .HasColumnName("category");
                b.Property <string>("Description")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("description");
                b.Property <long>("FListID")
                .HasColumnType("bigint")
                .HasColumnName("f_list_id");
                b.Property <string>("Name")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("name");
                b.HasKey("ID")
                .HasName("pk_kinks");
                b.HasIndex("FListID")
                .IsUnique()
                .HasDatabaseName("ix_kinks_f_list_id");
                b.ToTable("Kinks", "KinkModule");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Kinks.Model.UserKink", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .HasColumnName("id");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <long>("KinkID")
                .HasColumnType("bigint")
                .HasColumnName("kink_id");
                b.Property <int>("Preference")
                .HasColumnType("integer")
                .HasColumnName("preference");
                b.Property <long>("UserID")
                .HasColumnType("bigint")
                .HasColumnName("user_id");
                b.HasKey("ID")
                .HasName("pk_user_kinks");
                b.HasIndex("KinkID")
                .HasDatabaseName("ix_user_kinks_kink_id");
                b.HasIndex("UserID")
                .HasDatabaseName("ix_user_kinks_user_id");
                b.ToTable("UserKinks", "KinkModule");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Kinks.Model.UserKink", b =>
            {
                b.HasOne("DIGOS.Ambassador.Plugins.Kinks.Model.Kink", "Kink")
                .WithMany()
                .HasForeignKey("KinkID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_user_kinks_kinks_kink_id");
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Users.User", "User")
                .WithMany()
                .HasForeignKey("UserID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_user_kinks_users_user_id");
                b.Navigation("Kink");
                b.Navigation("User");
            });
#pragma warning restore 612, 618
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasDefaultSchema("kyc")
            .HasAnnotation("ProductVersion", "6.0.1")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("Service.KYC.Domain.Models.CountryModel", b =>
            {
                b.Property <string>("CountryCode")
                .HasColumnType("text");

                b.Property <List <DocumentType> >("AcceptedDocuments")
                .HasColumnType("jsonb");

                b.Property <string>("CountryName")
                .HasColumnType("text");

                b.Property <bool>("IsBlocked")
                .HasColumnType("boolean");

                b.HasKey("CountryCode");

                b.ToTable("countries", "kyc");
            });

            modelBuilder.Entity("Service.KYC.Domain.Models.KycAuditLog", b =>
            {
                b.Property <int>("LogId")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("LogId"));

                b.Property <string>("Agent")
                .HasColumnType("text");

                b.Property <string>("ApplicantId")
                .HasColumnType("text");

                b.Property <string>("ClientId")
                .HasColumnType("text");

                b.Property <string>("Comment")
                .HasColumnType("text");

                b.Property <string>("DeclineReason")
                .HasColumnType("text");

                b.Property <int>("DepositStatus")
                .HasColumnType("integer");

                b.Property <string>("DocumentId")
                .HasColumnType("text");

                b.Property <int>("DocumentType")
                .HasColumnType("integer");

                b.Property <string>("FileId1")
                .HasColumnType("text");

                b.Property <string>("FileId2")
                .HasColumnType("text");

                b.Property <int>("KycLevel")
                .HasColumnType("integer");

                b.Property <DateTime>("LogTimeStamp")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Operation")
                .HasColumnType("text");

                b.Property <int>("TradeStatus")
                .HasColumnType("integer");

                b.Property <string>("Type")
                .HasColumnType("text");

                b.Property <bool>("Verified")
                .HasColumnType("boolean");

                b.Property <int>("WithdrawalStatus")
                .HasColumnType("integer");

                b.HasKey("LogId");

                b.ToTable("auditlogs", "kyc");
            });

            modelBuilder.Entity("Service.KYC.Domain.Models.KycDocument", b =>
            {
                b.Property <string>("DocumentId")
                .HasColumnType("text");

                b.Property <string>("ClientId")
                .HasColumnType("character varying(128)");

                b.Property <string>("DeclineReason")
                .HasColumnType("text");

                b.Property <string>("FileId1")
                .HasColumnType("text");

                b.Property <string>("FileId2")
                .HasColumnType("text");

                b.Property <int>("Type")
                .HasColumnType("integer");

                b.Property <bool>("Verified")
                .HasColumnType("boolean");

                b.HasKey("DocumentId");

                b.HasIndex("ClientId");

                b.ToTable("kycdocuments", "kyc");
            });

            modelBuilder.Entity("Service.KYC.Domain.Models.KycProfile", b =>
            {
                b.Property <string>("ClientId")
                .HasMaxLength(128)
                .HasColumnType("character varying(128)");

                b.Property <string>("ActiveVerificationId")
                .HasColumnType("text");

                b.Property <string>("ApplicantId")
                .HasColumnType("text");

                b.Property <int>("DepositStatus")
                .HasColumnType("integer");

                b.Property <int>("KycLevel")
                .HasColumnType("integer");

                b.Property <bool>("PhoneVerified")
                .HasColumnType("boolean");

                b.Property <int[]>("RequiredVerifications")
                .HasColumnType("integer[]");

                b.Property <int>("TradeStatus")
                .HasColumnType("integer");

                b.Property <int>("WithdrawalStatus")
                .HasColumnType("integer");

                b.HasKey("ClientId");

                b.HasIndex("ApplicantId");

                b.HasIndex("KycLevel");

                b.ToTable("kycprofiles", "kyc");
            });

            modelBuilder.Entity("Service.KYC.Domain.Models.Verification", b =>
            {
                b.Property <string>("VerificationId")
                .HasColumnType("text");

                b.Property <string>("ClientId")
                .HasColumnType("text");

                b.Property <Dictionary <string, VerificationResult> >("DocumentResults")
                .HasColumnType("jsonb");

                b.Property <DateTime>("StartingTime")
                .HasColumnType("timestamp with time zone");

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

                b.Property <string>("VerificationTypes")
                .HasColumnType("text");

                b.Property <bool>("Verified")
                .HasColumnType("boolean");

                b.HasKey("VerificationId");

                b.ToTable("verifications", "kyc");
            });

            modelBuilder.Entity("Service.KYC.Domain.Models.KycDocument", b =>
            {
                b.HasOne("Service.KYC.Domain.Models.KycProfile", "Profile")
                .WithMany("Documents")
                .HasForeignKey("ClientId");

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

            modelBuilder.Entity("Service.KYC.Domain.Models.KycProfile", b =>
            {
                b.Navigation("Documents");
            });
#pragma warning restore 612, 618
        }
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasDefaultSchema("PermissionModule")
            .HasAnnotation("ProductVersion", "6.0.0")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "fuzzystrmatch");
            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Permissions.Model.RolePermission", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .HasColumnName("id");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));

                b.Property <bool>("IsGranted")
                .HasColumnType("boolean")
                .HasColumnName("is_granted");

                b.Property <Guid>("Permission")
                .HasColumnType("uuid")
                .HasColumnName("permission");

                b.Property <long>("RoleID")
                .HasColumnType("bigint")
                .HasColumnName("role_id");

                b.Property <int>("Target")
                .HasColumnType("integer")
                .HasColumnName("target");

                b.HasKey("ID")
                .HasName("pk_role_permissions");

                b.ToTable("RolePermissions", "PermissionModule");
            });

            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Permissions.Model.UserPermission", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .HasColumnName("id");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));

                b.Property <bool>("IsGranted")
                .HasColumnType("boolean")
                .HasColumnName("is_granted");

                b.Property <Guid>("Permission")
                .HasColumnType("uuid")
                .HasColumnName("permission");

                b.Property <long>("ServerID")
                .HasColumnType("bigint")
                .HasColumnName("server_id");

                b.Property <int>("Target")
                .HasColumnType("integer")
                .HasColumnName("target");

                b.Property <long>("UserID")
                .HasColumnType("bigint")
                .HasColumnName("user_id");

                b.HasKey("ID")
                .HasName("pk_user_permissions");

                b.ToTable("UserPermissions", "PermissionModule");
            });
#pragma warning restore 612, 618
        }
Ejemplo n.º 5
0
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.PostgreSql)
            .HasAnnotation("ProductVersion", "6.0.1")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <string>("AllowedAccessTokenSigningAlgorithms")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <string>("ConcurrencyStamp")
                .IsConcurrencyToken()
                .HasMaxLength(40)
                .HasColumnType("character varying(40)")
                .HasColumnName("ConcurrencyStamp");

                b.Property <DateTime>("CreationTime")
                .HasColumnType("timestamp without time zone")
                .HasColumnName("CreationTime");

                b.Property <Guid?>("CreatorId")
                .HasColumnType("uuid")
                .HasColumnName("CreatorId");

                b.Property <Guid?>("DeleterId")
                .HasColumnType("uuid")
                .HasColumnName("DeleterId");

                b.Property <DateTime?>("DeletionTime")
                .HasColumnType("timestamp without time zone")
                .HasColumnName("DeletionTime");

                b.Property <string>("Description")
                .HasMaxLength(1000)
                .HasColumnType("character varying(1000)");

                b.Property <string>("DisplayName")
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <bool>("Enabled")
                .HasColumnType("boolean");

                b.Property <string>("ExtraProperties")
                .HasColumnType("text")
                .HasColumnName("ExtraProperties");

                b.Property <bool>("IsDeleted")
                .ValueGeneratedOnAdd()
                .HasColumnType("boolean")
                .HasDefaultValue(false)
                .HasColumnName("IsDeleted");

                b.Property <DateTime?>("LastModificationTime")
                .HasColumnType("timestamp without time zone")
                .HasColumnName("LastModificationTime");

                b.Property <Guid?>("LastModifierId")
                .HasColumnType("uuid")
                .HasColumnName("LastModifierId");

                b.Property <string>("Name")
                .IsRequired()
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <bool>("ShowInDiscoveryDocument")
                .HasColumnType("boolean");

                b.HasKey("Id");

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

            modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b =>
            {
                b.Property <Guid>("ApiResourceId")
                .HasColumnType("uuid");

                b.Property <string>("Type")
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.HasKey("ApiResourceId", "Type");

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

            modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b =>
            {
                b.Property <Guid>("ApiResourceId")
                .HasColumnType("uuid");

                b.Property <string>("Key")
                .HasMaxLength(250)
                .HasColumnType("character varying(250)");

                b.Property <string>("Value")
                .HasMaxLength(2000)
                .HasColumnType("character varying(2000)");

                b.HasKey("ApiResourceId", "Key", "Value");

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

            modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b =>
            {
                b.Property <Guid>("ApiResourceId")
                .HasColumnType("uuid");

                b.Property <string>("Scope")
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.HasKey("ApiResourceId", "Scope");

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

            modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b =>
            {
                b.Property <Guid>("ApiResourceId")
                .HasColumnType("uuid");

                b.Property <string>("Type")
                .HasMaxLength(250)
                .HasColumnType("character varying(250)");

                b.Property <string>("Value")
                .HasMaxLength(4000)
                .HasColumnType("character varying(4000)");

                b.Property <string>("Description")
                .HasMaxLength(1000)
                .HasColumnType("character varying(1000)");

                b.Property <DateTime?>("Expiration")
                .HasColumnType("timestamp without time zone");

                b.HasKey("ApiResourceId", "Type", "Value");

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

            modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <string>("ConcurrencyStamp")
                .IsConcurrencyToken()
                .HasMaxLength(40)
                .HasColumnType("character varying(40)")
                .HasColumnName("ConcurrencyStamp");

                b.Property <DateTime>("CreationTime")
                .HasColumnType("timestamp without time zone")
                .HasColumnName("CreationTime");

                b.Property <Guid?>("CreatorId")
                .HasColumnType("uuid")
                .HasColumnName("CreatorId");

                b.Property <Guid?>("DeleterId")
                .HasColumnType("uuid")
                .HasColumnName("DeleterId");

                b.Property <DateTime?>("DeletionTime")
                .HasColumnType("timestamp without time zone")
                .HasColumnName("DeletionTime");

                b.Property <string>("Description")
                .HasMaxLength(1000)
                .HasColumnType("character varying(1000)");

                b.Property <string>("DisplayName")
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <bool>("Emphasize")
                .HasColumnType("boolean");

                b.Property <bool>("Enabled")
                .HasColumnType("boolean");

                b.Property <string>("ExtraProperties")
                .HasColumnType("text")
                .HasColumnName("ExtraProperties");

                b.Property <bool>("IsDeleted")
                .ValueGeneratedOnAdd()
                .HasColumnType("boolean")
                .HasDefaultValue(false)
                .HasColumnName("IsDeleted");

                b.Property <DateTime?>("LastModificationTime")
                .HasColumnType("timestamp without time zone")
                .HasColumnName("LastModificationTime");

                b.Property <Guid?>("LastModifierId")
                .HasColumnType("uuid")
                .HasColumnName("LastModifierId");

                b.Property <string>("Name")
                .IsRequired()
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <bool>("Required")
                .HasColumnType("boolean");

                b.Property <bool>("ShowInDiscoveryDocument")
                .HasColumnType("boolean");

                b.HasKey("Id");

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

            modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b =>
            {
                b.Property <Guid>("ApiScopeId")
                .HasColumnType("uuid");

                b.Property <string>("Type")
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.HasKey("ApiScopeId", "Type");

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

            modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b =>
            {
                b.Property <Guid>("ApiScopeId")
                .HasColumnType("uuid");

                b.Property <string>("Key")
                .HasMaxLength(250)
                .HasColumnType("character varying(250)");

                b.Property <string>("Value")
                .HasMaxLength(2000)
                .HasColumnType("character varying(2000)");

                b.HasKey("ApiScopeId", "Key", "Value");

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

            modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <int>("AbsoluteRefreshTokenLifetime")
                .HasColumnType("integer");

                b.Property <int>("AccessTokenLifetime")
                .HasColumnType("integer");

                b.Property <int>("AccessTokenType")
                .HasColumnType("integer");

                b.Property <bool>("AllowAccessTokensViaBrowser")
                .HasColumnType("boolean");

                b.Property <bool>("AllowOfflineAccess")
                .HasColumnType("boolean");

                b.Property <bool>("AllowPlainTextPkce")
                .HasColumnType("boolean");

                b.Property <bool>("AllowRememberConsent")
                .HasColumnType("boolean");

                b.Property <string>("AllowedIdentityTokenSigningAlgorithms")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <bool>("AlwaysIncludeUserClaimsInIdToken")
                .HasColumnType("boolean");

                b.Property <bool>("AlwaysSendClientClaims")
                .HasColumnType("boolean");

                b.Property <int>("AuthorizationCodeLifetime")
                .HasColumnType("integer");

                b.Property <bool>("BackChannelLogoutSessionRequired")
                .HasColumnType("boolean");

                b.Property <string>("BackChannelLogoutUri")
                .HasMaxLength(2000)
                .HasColumnType("character varying(2000)");

                b.Property <string>("ClientClaimsPrefix")
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <string>("ClientId")
                .IsRequired()
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <string>("ClientName")
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <string>("ClientUri")
                .HasMaxLength(2000)
                .HasColumnType("character varying(2000)");

                b.Property <string>("ConcurrencyStamp")
                .IsConcurrencyToken()
                .HasMaxLength(40)
                .HasColumnType("character varying(40)")
                .HasColumnName("ConcurrencyStamp");

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

                b.Property <DateTime>("CreationTime")
                .HasColumnType("timestamp without time zone")
                .HasColumnName("CreationTime");

                b.Property <Guid?>("CreatorId")
                .HasColumnType("uuid")
                .HasColumnName("CreatorId");

                b.Property <Guid?>("DeleterId")
                .HasColumnType("uuid")
                .HasColumnName("DeleterId");

                b.Property <DateTime?>("DeletionTime")
                .HasColumnType("timestamp without time zone")
                .HasColumnName("DeletionTime");

                b.Property <string>("Description")
                .HasMaxLength(1000)
                .HasColumnType("character varying(1000)");

                b.Property <int>("DeviceCodeLifetime")
                .HasColumnType("integer");

                b.Property <bool>("EnableLocalLogin")
                .HasColumnType("boolean");

                b.Property <bool>("Enabled")
                .HasColumnType("boolean");

                b.Property <string>("ExtraProperties")
                .HasColumnType("text")
                .HasColumnName("ExtraProperties");

                b.Property <bool>("FrontChannelLogoutSessionRequired")
                .HasColumnType("boolean");

                b.Property <string>("FrontChannelLogoutUri")
                .HasMaxLength(2000)
                .HasColumnType("character varying(2000)");

                b.Property <int>("IdentityTokenLifetime")
                .HasColumnType("integer");

                b.Property <bool>("IncludeJwtId")
                .HasColumnType("boolean");

                b.Property <bool>("IsDeleted")
                .ValueGeneratedOnAdd()
                .HasColumnType("boolean")
                .HasDefaultValue(false)
                .HasColumnName("IsDeleted");

                b.Property <DateTime?>("LastModificationTime")
                .HasColumnType("timestamp without time zone")
                .HasColumnName("LastModificationTime");

                b.Property <Guid?>("LastModifierId")
                .HasColumnType("uuid")
                .HasColumnName("LastModifierId");

                b.Property <string>("LogoUri")
                .HasMaxLength(2000)
                .HasColumnType("character varying(2000)");

                b.Property <string>("PairWiseSubjectSalt")
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <string>("ProtocolType")
                .IsRequired()
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <int>("RefreshTokenExpiration")
                .HasColumnType("integer");

                b.Property <int>("RefreshTokenUsage")
                .HasColumnType("integer");

                b.Property <bool>("RequireClientSecret")
                .HasColumnType("boolean");

                b.Property <bool>("RequireConsent")
                .HasColumnType("boolean");

                b.Property <bool>("RequirePkce")
                .HasColumnType("boolean");

                b.Property <bool>("RequireRequestObject")
                .HasColumnType("boolean");

                b.Property <int>("SlidingRefreshTokenLifetime")
                .HasColumnType("integer");

                b.Property <bool>("UpdateAccessTokenClaimsOnRefresh")
                .HasColumnType("boolean");

                b.Property <string>("UserCodeType")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

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

                b.HasKey("Id");

                b.HasIndex("ClientId");

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

            modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b =>
            {
                b.Property <Guid>("ClientId")
                .HasColumnType("uuid");

                b.Property <string>("Type")
                .HasMaxLength(250)
                .HasColumnType("character varying(250)");

                b.Property <string>("Value")
                .HasMaxLength(250)
                .HasColumnType("character varying(250)");

                b.HasKey("ClientId", "Type", "Value");

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

            modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b =>
            {
                b.Property <Guid>("ClientId")
                .HasColumnType("uuid");

                b.Property <string>("Origin")
                .HasMaxLength(150)
                .HasColumnType("character varying(150)");

                b.HasKey("ClientId", "Origin");

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

            modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b =>
            {
                b.Property <Guid>("ClientId")
                .HasColumnType("uuid");

                b.Property <string>("GrantType")
                .HasMaxLength(250)
                .HasColumnType("character varying(250)");

                b.HasKey("ClientId", "GrantType");

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

            modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b =>
            {
                b.Property <Guid>("ClientId")
                .HasColumnType("uuid");

                b.Property <string>("Provider")
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.HasKey("ClientId", "Provider");

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

            modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b =>
            {
                b.Property <Guid>("ClientId")
                .HasColumnType("uuid");

                b.Property <string>("PostLogoutRedirectUri")
                .HasMaxLength(2000)
                .HasColumnType("character varying(2000)");

                b.HasKey("ClientId", "PostLogoutRedirectUri");

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

            modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b =>
            {
                b.Property <Guid>("ClientId")
                .HasColumnType("uuid");

                b.Property <string>("Key")
                .HasMaxLength(250)
                .HasColumnType("character varying(250)");

                b.Property <string>("Value")
                .HasMaxLength(2000)
                .HasColumnType("character varying(2000)");

                b.HasKey("ClientId", "Key", "Value");

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

            modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b =>
            {
                b.Property <Guid>("ClientId")
                .HasColumnType("uuid");

                b.Property <string>("RedirectUri")
                .HasMaxLength(2000)
                .HasColumnType("character varying(2000)");

                b.HasKey("ClientId", "RedirectUri");

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

            modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b =>
            {
                b.Property <Guid>("ClientId")
                .HasColumnType("uuid");

                b.Property <string>("Scope")
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.HasKey("ClientId", "Scope");

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

            modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b =>
            {
                b.Property <Guid>("ClientId")
                .HasColumnType("uuid");

                b.Property <string>("Type")
                .HasMaxLength(250)
                .HasColumnType("character varying(250)");

                b.Property <string>("Value")
                .HasMaxLength(4000)
                .HasColumnType("character varying(4000)");

                b.Property <string>("Description")
                .HasMaxLength(2000)
                .HasColumnType("character varying(2000)");

                b.Property <DateTime?>("Expiration")
                .HasColumnType("timestamp without time zone");

                b.HasKey("ClientId", "Type", "Value");

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

            modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <string>("ClientId")
                .IsRequired()
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <string>("ConcurrencyStamp")
                .IsConcurrencyToken()
                .HasMaxLength(40)
                .HasColumnType("character varying(40)")
                .HasColumnName("ConcurrencyStamp");

                b.Property <DateTime>("CreationTime")
                .HasColumnType("timestamp without time zone")
                .HasColumnName("CreationTime");

                b.Property <Guid?>("CreatorId")
                .HasColumnType("uuid")
                .HasColumnName("CreatorId");

                b.Property <string>("Data")
                .IsRequired()
                .HasMaxLength(50000)
                .HasColumnType("character varying(50000)");

                b.Property <string>("Description")
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <string>("DeviceCode")
                .IsRequired()
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <DateTime?>("Expiration")
                .IsRequired()
                .HasColumnType("timestamp without time zone");

                b.Property <string>("ExtraProperties")
                .HasColumnType("text")
                .HasColumnName("ExtraProperties");

                b.Property <string>("SessionId")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <string>("SubjectId")
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <string>("UserCode")
                .IsRequired()
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.HasKey("Id");

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

                b.HasIndex("Expiration");

                b.HasIndex("UserCode");

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

            modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b =>
            {
                b.Property <string>("Key")
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <string>("ClientId")
                .IsRequired()
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <string>("ConcurrencyStamp")
                .IsConcurrencyToken()
                .HasMaxLength(40)
                .HasColumnType("character varying(40)")
                .HasColumnName("ConcurrencyStamp");

                b.Property <DateTime?>("ConsumedTime")
                .HasColumnType("timestamp without time zone");

                b.Property <DateTime>("CreationTime")
                .HasColumnType("timestamp without time zone");

                b.Property <string>("Data")
                .IsRequired()
                .HasMaxLength(50000)
                .HasColumnType("character varying(50000)");

                b.Property <string>("Description")
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <DateTime?>("Expiration")
                .HasColumnType("timestamp without time zone");

                b.Property <string>("ExtraProperties")
                .HasColumnType("text")
                .HasColumnName("ExtraProperties");

                b.Property <Guid>("Id")
                .HasColumnType("uuid");

                b.Property <string>("SessionId")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <string>("SubjectId")
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <string>("Type")
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.HasKey("Key");

                b.HasIndex("Expiration");

                b.HasIndex("SubjectId", "ClientId", "Type");

                b.HasIndex("SubjectId", "SessionId", "Type");

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

            modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <string>("ConcurrencyStamp")
                .IsConcurrencyToken()
                .HasMaxLength(40)
                .HasColumnType("character varying(40)")
                .HasColumnName("ConcurrencyStamp");

                b.Property <DateTime>("CreationTime")
                .HasColumnType("timestamp without time zone")
                .HasColumnName("CreationTime");

                b.Property <Guid?>("CreatorId")
                .HasColumnType("uuid")
                .HasColumnName("CreatorId");

                b.Property <Guid?>("DeleterId")
                .HasColumnType("uuid")
                .HasColumnName("DeleterId");

                b.Property <DateTime?>("DeletionTime")
                .HasColumnType("timestamp without time zone")
                .HasColumnName("DeletionTime");

                b.Property <string>("Description")
                .HasMaxLength(1000)
                .HasColumnType("character varying(1000)");

                b.Property <string>("DisplayName")
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <bool>("Emphasize")
                .HasColumnType("boolean");

                b.Property <bool>("Enabled")
                .HasColumnType("boolean");

                b.Property <string>("ExtraProperties")
                .HasColumnType("text")
                .HasColumnName("ExtraProperties");

                b.Property <bool>("IsDeleted")
                .ValueGeneratedOnAdd()
                .HasColumnType("boolean")
                .HasDefaultValue(false)
                .HasColumnName("IsDeleted");

                b.Property <DateTime?>("LastModificationTime")
                .HasColumnType("timestamp without time zone")
                .HasColumnName("LastModificationTime");

                b.Property <Guid?>("LastModifierId")
                .HasColumnType("uuid")
                .HasColumnName("LastModifierId");

                b.Property <string>("Name")
                .IsRequired()
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <bool>("Required")
                .HasColumnType("boolean");

                b.Property <bool>("ShowInDiscoveryDocument")
                .HasColumnType("boolean");

                b.HasKey("Id");

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

            modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b =>
            {
                b.Property <Guid>("IdentityResourceId")
                .HasColumnType("uuid");

                b.Property <string>("Type")
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.HasKey("IdentityResourceId", "Type");

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

            modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b =>
            {
                b.Property <Guid>("IdentityResourceId")
                .HasColumnType("uuid");

                b.Property <string>("Key")
                .HasMaxLength(250)
                .HasColumnType("character varying(250)");

                b.Property <string>("Value")
                .HasMaxLength(2000)
                .HasColumnType("character varying(2000)");

                b.HasKey("IdentityResourceId", "Key", "Value");

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

            modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b =>
            {
                b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null)
                .WithMany("UserClaims")
                .HasForeignKey("ApiResourceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b =>
            {
                b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null)
                .WithMany("Properties")
                .HasForeignKey("ApiResourceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b =>
            {
                b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null)
                .WithMany("Scopes")
                .HasForeignKey("ApiResourceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b =>
            {
                b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null)
                .WithMany("Secrets")
                .HasForeignKey("ApiResourceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b =>
            {
                b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null)
                .WithMany("UserClaims")
                .HasForeignKey("ApiScopeId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b =>
            {
                b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null)
                .WithMany("Properties")
                .HasForeignKey("ApiScopeId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b =>
            {
                b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null)
                .WithMany("Claims")
                .HasForeignKey("ClientId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b =>
            {
                b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null)
                .WithMany("AllowedCorsOrigins")
                .HasForeignKey("ClientId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b =>
            {
                b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null)
                .WithMany("AllowedGrantTypes")
                .HasForeignKey("ClientId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b =>
            {
                b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null)
                .WithMany("IdentityProviderRestrictions")
                .HasForeignKey("ClientId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b =>
            {
                b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null)
                .WithMany("PostLogoutRedirectUris")
                .HasForeignKey("ClientId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b =>
            {
                b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null)
                .WithMany("Properties")
                .HasForeignKey("ClientId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b =>
            {
                b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null)
                .WithMany("RedirectUris")
                .HasForeignKey("ClientId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b =>
            {
                b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null)
                .WithMany("AllowedScopes")
                .HasForeignKey("ClientId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b =>
            {
                b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null)
                .WithMany("ClientSecrets")
                .HasForeignKey("ClientId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b =>
            {
                b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null)
                .WithMany("UserClaims")
                .HasForeignKey("IdentityResourceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b =>
            {
                b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null)
                .WithMany("Properties")
                .HasForeignKey("IdentityResourceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b =>
            {
                b.Navigation("Properties");

                b.Navigation("Scopes");

                b.Navigation("Secrets");

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

            modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b =>
            {
                b.Navigation("Properties");

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

            modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.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("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b =>
            {
                b.Navigation("Properties");

                b.Navigation("UserClaims");
            });
#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", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("DidacticalEnigma.Mem.Translation.StoredModels.AllowedMediaType", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <string>("Extension")
                .IsRequired()
                .HasColumnType("text");

                b.Property <string>("MediaType")
                .IsRequired()
                .HasColumnType("text");

                b.HasKey("Id");

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

                b.ToTable("MediaTypes");

                b.HasData(
                    new
                {
                    Id        = 1,
                    Extension = "jpg",
                    MediaType = "image/jpeg"
                },
                    new
                {
                    Id        = 2,
                    Extension = "png",
                    MediaType = "image/png"
                });
            });

            modelBuilder.Entity("DidacticalEnigma.Mem.Translation.StoredModels.Context", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

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

                b.Property <string>("CorrelationId")
                .IsRequired()
                .HasColumnType("text");

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

                b.Property <int>("ProjectId")
                .HasColumnType("integer");

                b.Property <string>("Text")
                .HasColumnType("text");

                b.HasKey("Id");

                b.HasIndex("MediaTypeId");

                b.HasIndex("ProjectId", "CorrelationId")
                .IsUnique();

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

            modelBuilder.Entity("DidacticalEnigma.Mem.Translation.StoredModels.NpgsqlQuery", b =>
            {
                b.Property <NpgsqlTsVector>("Vec")
                .IsRequired()
                .HasColumnType("tsvector");

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

            modelBuilder.Entity("DidacticalEnigma.Mem.Translation.StoredModels.Project", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

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

                b.HasKey("Id");

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

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

            modelBuilder.Entity("DidacticalEnigma.Mem.Translation.StoredModels.Translation", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <string>("AssociatedData")
                .HasColumnType("jsonb");

                b.Property <string>("CorrelationId")
                .IsRequired()
                .HasColumnType("text");

                b.Property <DateTime>("CreationTime")
                .HasColumnType("timestamp with time zone");

                b.Property <DateTime>("ModificationTime")
                .HasColumnType("timestamp with time zone");

                b.Property <NotesCollection>("Notes")
                .HasColumnType("jsonb");

                b.Property <int>("ParentId")
                .HasColumnType("integer");

                b.Property <NpgsqlTsVector>("SearchVector")
                .IsRequired()
                .HasColumnType("tsvector");

                b.Property <string>("Source")
                .IsRequired()
                .HasColumnType("text");

                b.Property <string>("Target")
                .HasColumnType("text");

                b.HasKey("Id");

                b.HasIndex("CorrelationId");

                b.HasIndex("SearchVector");

                NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex("SearchVector"), "GIN");

                b.HasIndex("ParentId", "CorrelationId")
                .IsUnique();

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

            modelBuilder.Entity("DidacticalEnigma.Mem.Translation.StoredModels.Context", b =>
            {
                b.HasOne("DidacticalEnigma.Mem.Translation.StoredModels.AllowedMediaType", "MediaType")
                .WithMany()
                .HasForeignKey("MediaTypeId");

                b.HasOne("DidacticalEnigma.Mem.Translation.StoredModels.Project", "Project")
                .WithMany()
                .HasForeignKey("ProjectId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("MediaType");

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

            modelBuilder.Entity("DidacticalEnigma.Mem.Translation.StoredModels.Translation", b =>
            {
                b.HasOne("DidacticalEnigma.Mem.Translation.StoredModels.Project", "Parent")
                .WithMany("Translations")
                .HasForeignKey("ParentId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("DidacticalEnigma.Mem.Translation.StoredModels.Project", b =>
            {
                b.Navigation("Translations");
            });
#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", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("TypingRealm.Library.Infrastructure.DataAccess.Entities.BookContentDao", b =>
            {
                b.Property <string>("Id")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)")
                .HasColumnName("id");

                b.Property <string>("BookId")
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnType("character varying(50)")
                .HasColumnName("book_id");

                b.Property <string>("Content")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("content");

                b.HasKey("Id")
                .HasName("pk_book_content");

                b.HasIndex("BookId")
                .HasDatabaseName("ix_book_content_book_id");

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

            modelBuilder.Entity("TypingRealm.Library.Infrastructure.DataAccess.Entities.BookDao", b =>
            {
                b.Property <string>("Id")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)")
                .HasColumnName("id");

                b.Property <DateTime>("AddedAtUtc")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("added_at_utc");

                b.Property <string>("ContentId")
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnType("character varying(50)")
                .HasColumnName("content_id");

                b.Property <string>("Description")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("character varying(100)")
                .HasColumnName("description");

                b.Property <bool>("IsArchived")
                .HasColumnType("boolean")
                .HasColumnName("is_archived");

                b.Property <string>("Language")
                .IsRequired()
                .HasMaxLength(10)
                .HasColumnType("character varying(10)")
                .HasColumnName("language");

                b.Property <int>("ProcessingStatus")
                .HasColumnType("integer")
                .HasColumnName("processing_status");

                b.HasKey("Id")
                .HasName("pk_book");

                b.HasIndex("AddedAtUtc")
                .HasDatabaseName("ix_book_added_at_utc");

                b.HasIndex("ContentId")
                .HasDatabaseName("ix_book_content_id");

                b.HasIndex("Description")
                .HasDatabaseName("ix_book_description");

                b.HasIndex("IsArchived")
                .HasDatabaseName("ix_book_is_archived");

                b.HasIndex("Language")
                .HasDatabaseName("ix_book_language");

                b.HasIndex("ProcessingStatus")
                .HasDatabaseName("ix_book_processing_status");

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

            modelBuilder.Entity("TypingRealm.Library.Infrastructure.DataAccess.Entities.KeyPairDao", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .HasColumnName("id");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("Id"));

                b.Property <int>("CountInSentence")
                .HasColumnType("integer")
                .HasColumnName("count_in_sentence");

                b.Property <int>("CountInWord")
                .HasColumnType("integer")
                .HasColumnName("count_in_word");

                b.Property <int>("IndexInWord")
                .HasColumnType("integer")
                .HasColumnName("index_in_word");

                b.Property <string>("Value")
                .IsRequired()
                .HasMaxLength(10)
                .HasColumnType("character varying(10)")
                .HasColumnName("value");

                b.Property <long>("WordId")
                .HasColumnType("bigint")
                .HasColumnName("word_id");

                b.HasKey("Id")
                .HasName("pk_key_pair");

                b.HasIndex("CountInSentence")
                .HasDatabaseName("ix_key_pair_count_in_sentence");

                b.HasIndex("CountInWord")
                .HasDatabaseName("ix_key_pair_count_in_word");

                b.HasIndex("IndexInWord")
                .HasDatabaseName("ix_key_pair_index_in_word");

                b.HasIndex("Value")
                .HasDatabaseName("ix_key_pair_value");

                b.HasIndex("WordId")
                .HasDatabaseName("ix_key_pair_word_id");

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

            modelBuilder.Entity("TypingRealm.Library.Infrastructure.DataAccess.Entities.SentenceDao", b =>
            {
                b.Property <string>("Id")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)")
                .HasColumnName("id");

                b.Property <string>("BookId")
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnType("character varying(50)")
                .HasColumnName("book_id");

                b.Property <int>("IndexInBook")
                .HasColumnType("integer")
                .HasColumnName("index_in_book");

                b.Property <string>("Value")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("value");

                b.HasKey("Id")
                .HasName("pk_sentence");

                b.HasIndex("BookId")
                .HasDatabaseName("ix_sentence_book_id");

                b.HasIndex("IndexInBook")
                .HasDatabaseName("ix_sentence_index_in_book");

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

            modelBuilder.Entity("TypingRealm.Library.Infrastructure.DataAccess.Entities.WordDao", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .HasColumnName("id");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("Id"));

                b.Property <int>("CountInSentence")
                .HasColumnType("integer")
                .HasColumnName("count_in_sentence");

                b.Property <int>("IndexInSentence")
                .HasColumnType("integer")
                .HasColumnName("index_in_sentence");

                b.Property <int>("RawCountInSentence")
                .HasColumnType("integer")
                .HasColumnName("raw_count_in_sentence");

                b.Property <string>("RawValue")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("character varying(100)")
                .HasColumnName("raw_value");

                b.Property <string>("SentenceId")
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnType("character varying(50)")
                .HasColumnName("sentence_id");

                b.Property <string>("Value")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("character varying(100)")
                .HasColumnName("value");

                b.HasKey("Id")
                .HasName("pk_word");

                b.HasIndex("CountInSentence")
                .HasDatabaseName("ix_word_count_in_sentence");

                b.HasIndex("IndexInSentence")
                .HasDatabaseName("ix_word_index_in_sentence");

                b.HasIndex("RawCountInSentence")
                .HasDatabaseName("ix_word_raw_count_in_sentence");

                b.HasIndex("RawValue")
                .HasDatabaseName("ix_word_raw_value");

                b.HasIndex("SentenceId")
                .HasDatabaseName("ix_word_sentence_id");

                b.HasIndex("Value")
                .HasDatabaseName("ix_word_value");

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

            modelBuilder.Entity("TypingRealm.Library.Infrastructure.DataAccess.Entities.BookDao", b =>
            {
                b.HasOne("TypingRealm.Library.Infrastructure.DataAccess.Entities.BookContentDao", "Content")
                .WithMany()
                .HasForeignKey("ContentId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_book_book_content_content_id");

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

            modelBuilder.Entity("TypingRealm.Library.Infrastructure.DataAccess.Entities.KeyPairDao", b =>
            {
                b.HasOne("TypingRealm.Library.Infrastructure.DataAccess.Entities.WordDao", "Word")
                .WithMany("KeyPairs")
                .HasForeignKey("WordId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_key_pair_word_word_id");

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

            modelBuilder.Entity("TypingRealm.Library.Infrastructure.DataAccess.Entities.SentenceDao", b =>
            {
                b.HasOne("TypingRealm.Library.Infrastructure.DataAccess.Entities.BookDao", "Book")
                .WithMany("Sentences")
                .HasForeignKey("BookId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_sentence_book_book_id");

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

            modelBuilder.Entity("TypingRealm.Library.Infrastructure.DataAccess.Entities.WordDao", b =>
            {
                b.HasOne("TypingRealm.Library.Infrastructure.DataAccess.Entities.SentenceDao", "Sentence")
                .WithMany("Words")
                .HasForeignKey("SentenceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_word_sentence_sentence_id");

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

            modelBuilder.Entity("TypingRealm.Library.Infrastructure.DataAccess.Entities.BookDao", b =>
            {
                b.Navigation("Sentences");
            });

            modelBuilder.Entity("TypingRealm.Library.Infrastructure.DataAccess.Entities.SentenceDao", b =>
            {
                b.Navigation("Words");
            });

            modelBuilder.Entity("TypingRealm.Library.Infrastructure.DataAccess.Entities.WordDao", b =>
            {
                b.Navigation("KeyPairs");
            });
#pragma warning restore 612, 618
        }
Ejemplo n.º 8
0
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.1")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("Core.Models.Account", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

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

                b.Property <string>("Avatar")
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

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

                b.Property <DateTimeOffset>("CreatedTime")
                .HasColumnType("timestamp with time zone");

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

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

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

                b.Property <DateTimeOffset?>("LastLoginTime")
                .HasColumnType("timestamp with time zone");

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

                b.Property <DateTimeOffset?>("LockoutEnd")
                .HasColumnType("timestamp with time zone");

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

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

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

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

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

                b.Property <int>("RetryCount")
                .HasColumnType("integer");

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

                b.Property <int>("Status")
                .HasColumnType("integer");

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

                b.Property <DateTimeOffset>("UpdatedTime")
                .HasColumnType("timestamp with time zone");

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

                b.HasKey("Id");

                b.HasIndex("CreatedTime");

                b.HasIndex("Email");

                b.HasIndex("IsDeleted");

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

                b.HasIndex("NormalizedUserName")
                .IsUnique()
                .HasDatabaseName("UserNameIndex");

                b.HasIndex("PhoneNumber");

                b.HasIndex("Status");

                b.HasIndex("UserName");

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

            modelBuilder.Entity("Core.Models.AccountExtend", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <Guid>("AccountId")
                .HasColumnType("uuid");

                b.Property <string>("Address")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <string>("AddressDetail")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.Property <DateTimeOffset?>("Birthday")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("City")
                .HasMaxLength(20)
                .HasColumnType("character varying(20)");

                b.Property <string>("Country")
                .HasMaxLength(20)
                .HasColumnType("character varying(20)");

                b.Property <string>("County")
                .HasMaxLength(20)
                .HasColumnType("character varying(20)");

                b.Property <DateTimeOffset>("CreatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("NickName")
                .HasMaxLength(40)
                .HasColumnType("character varying(40)");

                b.Property <string>("Province")
                .HasMaxLength(20)
                .HasColumnType("character varying(20)");

                b.Property <string>("RealName")
                .HasMaxLength(40)
                .HasColumnType("character varying(40)");

                b.Property <int>("Status")
                .HasColumnType("integer");

                b.Property <string>("Street")
                .HasMaxLength(20)
                .HasColumnType("character varying(20)");

                b.Property <DateTimeOffset>("UpdatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("WXAvatar")
                .HasMaxLength(150)
                .HasColumnType("character varying(150)");

                b.Property <string>("WXOpenId")
                .HasMaxLength(40)
                .HasColumnType("character varying(40)");

                b.Property <string>("WXUnionId")
                .HasMaxLength(40)
                .HasColumnType("character varying(40)");

                b.HasKey("Id");

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

                b.HasIndex("City");

                b.HasIndex("Country");

                b.HasIndex("Province");

                b.HasIndex("RealName");

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

            modelBuilder.Entity("Core.Models.Article", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <Guid>("AccountId")
                .HasColumnType("uuid");

                b.Property <int>("ArticleType")
                .HasColumnType("integer");

                b.Property <string>("AuthorName")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <Guid?>("CatalogId")
                .HasColumnType("uuid");

                b.Property <DateTimeOffset>("CreatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <bool?>("IsPrivate")
                .HasColumnType("boolean");

                b.Property <int>("Status")
                .HasColumnType("integer");

                b.Property <string>("Summary")
                .HasMaxLength(500)
                .HasColumnType("character varying(500)");

                b.Property <string>("Tags")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <string>("Title")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <DateTimeOffset>("UpdatedTime")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.HasIndex("AccountId");

                b.HasIndex("ArticleType");

                b.HasIndex("CatalogId");

                b.HasIndex("CreatedTime");

                b.HasIndex("Title");

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

            modelBuilder.Entity("Core.Models.ArticleCatalog", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <Guid>("AccountId")
                .HasColumnType("uuid");

                b.Property <DateTimeOffset>("CreatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <short>("Level")
                .HasColumnType("smallint");

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

                b.Property <Guid?>("ParentId")
                .HasColumnType("uuid");

                b.Property <short>("Sort")
                .HasColumnType("smallint");

                b.Property <int>("Status")
                .HasColumnType("integer");

                b.Property <string>("Type")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.Property <DateTimeOffset>("UpdatedTime")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.HasIndex("AccountId");

                b.HasIndex("Level");

                b.HasIndex("Name");

                b.HasIndex("ParentId");

                b.HasIndex("Sort");

                b.HasIndex("Type");

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

            modelBuilder.Entity("Core.Models.ArticleExtend", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <Guid>("ArticleId")
                .HasColumnType("uuid");

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

                b.Property <DateTimeOffset>("CreatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <int>("Status")
                .HasColumnType("integer");

                b.Property <DateTimeOffset>("UpdatedTime")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

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

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

            modelBuilder.Entity("Core.Models.CodeSnippet", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <int>("CodeType")
                .HasColumnType("integer");

                b.Property <string>("Content")
                .HasMaxLength(4000)
                .HasColumnType("character varying(4000)");

                b.Property <DateTimeOffset>("CreatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Description")
                .HasMaxLength(500)
                .HasColumnType("character varying(500)");

                b.Property <int>("Language")
                .HasColumnType("integer");

                b.Property <Guid?>("LibraryId")
                .HasColumnType("uuid");

                b.Property <string>("Name")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <int>("Status")
                .HasColumnType("integer");

                b.Property <DateTimeOffset>("UpdatedTime")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.HasIndex("CodeType");

                b.HasIndex("CreatedTime");

                b.HasIndex("Language");

                b.HasIndex("LibraryId");

                b.HasIndex("Name");

                b.HasIndex("Status");

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

            modelBuilder.Entity("Core.Models.Comment", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <Guid>("AccountId")
                .HasColumnType("uuid");

                b.Property <Guid>("ArticleId")
                .HasColumnType("uuid");

                b.Property <string>("Content")
                .HasMaxLength(2000)
                .HasColumnType("character varying(2000)");

                b.Property <DateTimeOffset>("CreatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <int>("Status")
                .HasColumnType("integer");

                b.Property <DateTimeOffset>("UpdatedTime")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.HasIndex("AccountId");

                b.HasIndex("ArticleId");

                b.HasIndex("CreatedTime");

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

            modelBuilder.Entity("Core.Models.Library", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <Guid?>("CatalogId")
                .HasColumnType("uuid");

                b.Property <DateTimeOffset>("CreatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Description")
                .HasMaxLength(500)
                .HasColumnType("character varying(500)");

                b.Property <bool>("IsPublic")
                .HasColumnType("boolean");

                b.Property <bool>("IsValid")
                .HasColumnType("boolean");

                b.Property <string>("Language")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <string>("Namespace")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <int>("Status")
                .HasColumnType("integer");

                b.Property <DateTimeOffset>("UpdatedTime")
                .HasColumnType("timestamp with time zone");

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

                b.HasKey("Id");

                b.HasIndex("CatalogId");

                b.HasIndex("CreatedTime");

                b.HasIndex("IsPublic");

                b.HasIndex("IsValid");

                b.HasIndex("Language");

                b.HasIndex("Namespace");

                b.HasIndex("UserId");

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

            modelBuilder.Entity("Core.Models.LibraryCatalog", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <Guid>("AccountId")
                .HasColumnType("uuid");

                b.Property <DateTimeOffset>("CreatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <short>("Level")
                .HasColumnType("smallint");

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

                b.Property <Guid?>("ParentId")
                .HasColumnType("uuid");

                b.Property <short>("Sort")
                .HasColumnType("smallint");

                b.Property <int>("Status")
                .HasColumnType("integer");

                b.Property <string>("Type")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.Property <DateTimeOffset>("UpdatedTime")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.HasIndex("AccountId");

                b.HasIndex("Level");

                b.HasIndex("Name");

                b.HasIndex("ParentId");

                b.HasIndex("Sort");

                b.HasIndex("Type");

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

            modelBuilder.Entity("Core.Models.NewsTags", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <string>("Color")
                .HasMaxLength(20)
                .HasColumnType("character varying(20)");

                b.Property <DateTimeOffset>("CreatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Name")
                .IsRequired()
                .HasMaxLength(40)
                .HasColumnType("character varying(40)");

                b.Property <int>("Status")
                .HasColumnType("integer");

                b.Property <Guid>("ThirdNewsId")
                .HasColumnType("uuid");

                b.Property <DateTimeOffset>("UpdatedTime")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.HasIndex("ThirdNewsId");

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

            modelBuilder.Entity("Core.Models.Role", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

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

                b.Property <DateTimeOffset>("CreatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Icon")
                .HasMaxLength(30)
                .HasColumnType("character varying(30)");

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

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

                b.Property <int>("Status")
                .HasColumnType("integer");

                b.Property <DateTimeOffset>("UpdatedTime")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.HasIndex("Name");

                b.HasIndex("NormalizedName")
                .IsUnique()
                .HasDatabaseName("RoleNameIndex");

                b.HasIndex("Status");

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

            modelBuilder.Entity("Core.Models.TagLibrary", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <string>("Color")
                .HasMaxLength(20)
                .HasColumnType("character varying(20)");

                b.Property <DateTimeOffset>("CreatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Name")
                .IsRequired()
                .HasMaxLength(40)
                .HasColumnType("character varying(40)");

                b.Property <int>("Status")
                .HasColumnType("integer");

                b.Property <string>("Style")
                .HasMaxLength(40)
                .HasColumnType("character varying(40)");

                b.Property <string>("Type")
                .IsRequired()
                .HasMaxLength(40)
                .HasColumnType("character varying(40)");

                b.Property <DateTimeOffset>("UpdatedTime")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.HasIndex("Name", "Type");

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

            modelBuilder.Entity("Core.Models.ThirdNews", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <string>("AuthorAvatar")
                .HasMaxLength(300)
                .HasColumnType("character varying(300)");

                b.Property <string>("AuthorName")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <string>("Category")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.Property <string>("Content")
                .HasMaxLength(8000)
                .HasColumnType("character varying(8000)");

                b.Property <DateTimeOffset>("CreatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <DateTimeOffset?>("DatePublished")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Description")
                .HasMaxLength(5000)
                .HasColumnType("character varying(5000)");

                b.Property <string>("IdentityId")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.Property <int>("NewsType")
                .HasColumnType("integer");

                b.Property <string>("Provider")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.Property <int>("Status")
                .HasColumnType("integer");

                b.Property <int>("TechType")
                .HasColumnType("integer");

                b.Property <string>("ThumbnailUrl")
                .HasMaxLength(300)
                .HasColumnType("character varying(300)");

                b.Property <string>("Title")
                .IsRequired()
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <int>("Type")
                .HasColumnType("integer");

                b.Property <DateTimeOffset>("UpdatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Url")
                .HasMaxLength(300)
                .HasColumnType("character varying(300)");

                b.HasKey("Id");

                b.HasIndex("Category");

                b.HasIndex("DatePublished");

                b.HasIndex("IdentityId");

                b.HasIndex("NewsType");

                b.HasIndex("Provider");

                b.HasIndex("Title");

                b.HasIndex("Type");

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

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

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

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

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

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

                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("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

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

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

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

                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("text");

                b.Property <string>("ProviderKey")
                .HasColumnType("text");

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

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

                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("uuid");

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

                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("uuid");

                b.Property <string>("LoginProvider")
                .HasColumnType("text");

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

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

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

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

            modelBuilder.Entity("Core.Models.AccountExtend", b =>
            {
                b.HasOne("Core.Models.Account", "Account")
                .WithOne("Extend")
                .HasForeignKey("Core.Models.AccountExtend", "AccountId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Core.Models.Article", b =>
            {
                b.HasOne("Core.Models.Account", "Account")
                .WithMany("Articles")
                .HasForeignKey("AccountId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Core.Models.ArticleCatalog", "Catalog")
                .WithMany("Articles")
                .HasForeignKey("CatalogId");

                b.Navigation("Account");

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

            modelBuilder.Entity("Core.Models.ArticleCatalog", b =>
            {
                b.HasOne("Core.Models.Account", "Account")
                .WithMany("ArticleCatalogs")
                .HasForeignKey("AccountId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Core.Models.ArticleCatalog", "Parent")
                .WithMany("Catalogs")
                .HasForeignKey("ParentId");

                b.Navigation("Account");

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

            modelBuilder.Entity("Core.Models.ArticleExtend", b =>
            {
                b.HasOne("Core.Models.Article", "Article")
                .WithOne("Extend")
                .HasForeignKey("Core.Models.ArticleExtend", "ArticleId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Core.Models.CodeSnippet", b =>
            {
                b.HasOne("Core.Models.Library", "Library")
                .WithMany("Snippets")
                .HasForeignKey("LibraryId");

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

            modelBuilder.Entity("Core.Models.Comment", b =>
            {
                b.HasOne("Core.Models.Account", "Account")
                .WithMany("Comments")
                .HasForeignKey("AccountId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Core.Models.Article", "Article")
                .WithMany("Comments")
                .HasForeignKey("ArticleId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Account");

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

            modelBuilder.Entity("Core.Models.Library", b =>
            {
                b.HasOne("Core.Models.LibraryCatalog", "Catalog")
                .WithMany()
                .HasForeignKey("CatalogId");

                b.HasOne("Core.Models.Account", "User")
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Catalog");

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

            modelBuilder.Entity("Core.Models.LibraryCatalog", b =>
            {
                b.HasOne("Core.Models.Account", "Account")
                .WithMany()
                .HasForeignKey("AccountId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Core.Models.LibraryCatalog", "Parent")
                .WithMany("Catalogs")
                .HasForeignKey("ParentId");

                b.Navigation("Account");

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

            modelBuilder.Entity("Core.Models.NewsTags", b =>
            {
                b.HasOne("Core.Models.ThirdNews", "ThirdNews")
                .WithMany("NewsTags")
                .HasForeignKey("ThirdNewsId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

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

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

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

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

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

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

            modelBuilder.Entity("Core.Models.Account", b =>
            {
                b.Navigation("ArticleCatalogs");

                b.Navigation("Articles");

                b.Navigation("Comments");

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

            modelBuilder.Entity("Core.Models.Article", b =>
            {
                b.Navigation("Comments");

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

            modelBuilder.Entity("Core.Models.ArticleCatalog", b =>
            {
                b.Navigation("Articles");

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

            modelBuilder.Entity("Core.Models.Library", b =>
            {
                b.Navigation("Snippets");
            });

            modelBuilder.Entity("Core.Models.LibraryCatalog", b =>
            {
                b.Navigation("Catalogs");
            });

            modelBuilder.Entity("Core.Models.ThirdNews", b =>
            {
                b.Navigation("NewsTags");
            });
#pragma warning restore 612, 618
        }
Ejemplo n.º 9
0
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.3")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("Common.DalSql.Entities.Token", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("Id"));

                b.Property <DateTime>("CreatedOn")
                .HasColumnType("timestamp with time zone");

                b.Property <DateTime>("ExpireAt")
                .HasColumnType("timestamp with time zone");

                b.Property <int>("Type")
                .HasColumnType("integer");

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

                b.Property <string>("Value")
                .IsRequired()
                .HasColumnType("text");

                b.HasKey("Id");

                b.HasIndex("UserId");

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

            modelBuilder.Entity("Common.DalSql.Entities.User", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("Id"));

                b.Property <DateTime>("CreatedOn")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Email")
                .IsRequired()
                .HasColumnType("text");

                b.Property <string>("FirstName")
                .IsRequired()
                .HasColumnType("text");

                b.Property <bool>("IsEmailVerified")
                .HasColumnType("boolean");

                b.Property <string>("LastName")
                .IsRequired()
                .HasColumnType("text");

                b.Property <DateTime>("LastRequest")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("PasswordHash")
                .IsRequired()
                .HasColumnType("text");

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

                b.Property <string>("ResetPasswordToken")
                .HasColumnType("text");

                b.Property <int>("Role")
                .HasColumnType("integer");

                b.Property <string>("SignupToken")
                .IsRequired()
                .HasColumnType("text");

                b.HasKey("Id");

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

            modelBuilder.Entity("Common.DalSql.Entities.Token", b =>
            {
                b.HasOne("Common.DalSql.Entities.User", "User")
                .WithMany("Tokens")
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Common.DalSql.Entities.User", b =>
            {
                b.Navigation("Tokens");
            });
#pragma warning restore 612, 618
        }
Ejemplo n.º 10
0
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.3")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("EnoCore.Models.Database.CheckerTask", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("Id"));

                b.Property <string>("Address")
                .IsRequired()
                .HasColumnType("text");

                b.Property <string>("AttackInfo")
                .HasColumnType("text");

                b.Property <int>("CheckerResult")
                .HasColumnType("integer");

                b.Property <int>("CheckerTaskLaunchStatus")
                .HasColumnType("integer");

                b.Property <string>("CheckerUrl")
                .IsRequired()
                .HasColumnType("text");

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

                b.Property <string>("ErrorMessage")
                .HasColumnType("text");

                b.Property <int>("MaxRunningTime")
                .HasColumnType("integer");

                b.Property <int>("Method")
                .HasColumnType("integer");

                b.Property <string>("Payload")
                .HasColumnType("text");

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

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

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

                b.Property <string>("ServiceName")
                .IsRequired()
                .HasColumnType("text");

                b.Property <DateTimeOffset>("StartTime")
                .HasColumnType("timestamp with time zone");

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

                b.Property <string>("TeamName")
                .IsRequired()
                .HasColumnType("text");

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

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

                b.HasKey("Id");

                b.HasIndex("CheckerTaskLaunchStatus", "StartTime");

                b.HasIndex("CurrentRoundId", "RelatedRoundId", "CheckerResult");

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

            modelBuilder.Entity("EnoCore.Models.Database.Configuration", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("Id"));

                b.Property <int>("CheckedRoundsPerRound")
                .HasColumnType("integer");

                b.Property <string>("DnsSuffix")
                .IsRequired()
                .HasColumnType("text");

                b.Property <int>("Encoding")
                .HasColumnType("integer");

                b.Property <byte[]>("FlagSigningKey")
                .IsRequired()
                .HasColumnType("bytea");

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

                b.Property <int>("RoundLengthInSeconds")
                .HasColumnType("integer");

                b.Property <int>("TeamSubnetBytesLength")
                .HasColumnType("integer");

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

                b.HasKey("Id");

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

            modelBuilder.Entity("EnoCore.Models.Database.Round", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("Id"));

                b.Property <DateTimeOffset>("Begin")
                .HasColumnType("timestamp with time zone");

                b.Property <DateTimeOffset>("End")
                .HasColumnType("timestamp with time zone");

                b.Property <DateTimeOffset>("Quarter2")
                .HasColumnType("timestamp with time zone");

                b.Property <DateTimeOffset>("Quarter3")
                .HasColumnType("timestamp with time zone");

                b.Property <DateTimeOffset>("Quarter4")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

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

            modelBuilder.Entity("EnoCore.Models.Database.RoundTeamServiceStatus", b =>
            {
                b.Property <long>("ServiceId")
                .HasColumnType("bigint");

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

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

                b.Property <string>("ErrorMessage")
                .HasColumnType("text");

                b.Property <int>("Status")
                .HasColumnType("integer");

                b.HasKey("ServiceId", "TeamId", "GameRoundId");

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

            modelBuilder.Entity("EnoCore.Models.Database.Service", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("Id"));

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

                b.Property <string[]>("Checkers")
                .IsRequired()
                .HasColumnType("text[]");

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

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

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

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

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

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

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

                b.HasKey("Id");

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

            modelBuilder.Entity("EnoCore.Models.Database.SubmittedFlag", b =>
            {
                b.Property <long>("FlagServiceId")
                .HasColumnType("bigint");

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

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

                b.Property <int>("FlagRoundOffset")
                .HasColumnType("integer");

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

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

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

                b.Property <DateTimeOffset>("Timestamp")
                .HasColumnType("timestamp with time zone");

                b.HasKey("FlagServiceId", "FlagRoundId", "FlagOwnerId", "FlagRoundOffset", "AttackerTeamId");

                b.HasIndex("FlagServiceId", "FlagRoundOffset", "Timestamp");

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

            modelBuilder.Entity("EnoCore.Models.Database.Team", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("Id"));

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

                b.Property <string>("Address")
                .HasColumnType("text");

                b.Property <double>("AttackPoints")
                .HasColumnType("double precision");

                b.Property <string>("CountryCode")
                .HasColumnType("text");

                b.Property <double>("DefensePoints")
                .HasColumnType("double precision");

                b.Property <string>("LogoUrl")
                .HasColumnType("text");

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

                b.Property <double>("ServiceLevelAgreementPoints")
                .HasColumnType("double precision");

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

                b.Property <byte[]>("TeamSubnet")
                .IsRequired()
                .HasColumnType("bytea");

                b.Property <double>("TotalPoints")
                .HasColumnType("double precision");

                b.HasKey("Id");

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

            modelBuilder.Entity("EnoCore.Models.Database.TeamServicePoints", b =>
            {
                b.Property <long>("TeamId")
                .HasColumnType("bigint");

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

                b.Property <double>("AttackPoints")
                .HasColumnType("double precision");

                b.Property <double>("DefensePoints")
                .HasColumnType("double precision");

                b.Property <string>("ErrorMessage")
                .HasColumnType("text");

                b.Property <double>("ServiceLevelAgreementPoints")
                .HasColumnType("double precision");

                b.Property <int>("Status")
                .HasColumnType("integer");

                b.HasKey("TeamId", "ServiceId");

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

            modelBuilder.Entity("EnoCore.Models.Database.TeamServicePointsSnapshot", b =>
            {
                b.Property <long>("ServiceId")
                .HasColumnType("bigint");

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

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

                b.Property <double>("AttackPoints")
                .HasColumnType("double precision");

                b.Property <double>("LostDefensePoints")
                .HasColumnType("double precision");

                b.Property <double>("ServiceLevelAgreementPoints")
                .HasColumnType("double precision");

                b.HasKey("ServiceId", "RoundId", "TeamId");

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

            modelBuilder.Entity("EnoCore.Models.Database.TeamServicePoints", b =>
            {
                b.HasOne("EnoCore.Models.Database.Team", null)
                .WithMany("TeamServicePoints")
                .HasForeignKey("TeamId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("EnoCore.Models.Database.Team", b =>
            {
                b.Navigation("TeamServicePoints");
            });
#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", 63);

            NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "uuid-ossp");
            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("Player.Api.Data.Data.Models.ApplicationEntity", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid")
                .HasColumnName("id")
                .HasDefaultValueSql("uuid_generate_v4()");

                b.Property <Guid?>("ApplicationTemplateId")
                .HasColumnType("uuid")
                .HasColumnName("application_template_id");

                b.Property <bool?>("Embeddable")
                .HasColumnType("boolean")
                .HasColumnName("embeddable");

                b.Property <string>("Icon")
                .HasColumnType("text")
                .HasColumnName("icon");

                b.Property <bool?>("LoadInBackground")
                .HasColumnType("boolean")
                .HasColumnName("load_in_background");

                b.Property <string>("Name")
                .HasColumnType("text")
                .HasColumnName("name");

                b.Property <string>("Url")
                .HasColumnType("text")
                .HasColumnName("url");

                b.Property <Guid>("ViewId")
                .HasColumnType("uuid")
                .HasColumnName("view_id");

                b.HasKey("Id");

                b.HasIndex("ApplicationTemplateId");

                b.HasIndex("ViewId");

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.ApplicationInstanceEntity", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid")
                .HasColumnName("id")
                .HasDefaultValueSql("uuid_generate_v4()");

                b.Property <Guid>("ApplicationId")
                .HasColumnType("uuid")
                .HasColumnName("application_id");

                b.Property <float>("DisplayOrder")
                .HasColumnType("real")
                .HasColumnName("display_order");

                b.Property <Guid>("TeamId")
                .HasColumnType("uuid")
                .HasColumnName("team_id");

                b.HasKey("Id");

                b.HasIndex("ApplicationId");

                b.HasIndex("TeamId");

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.ApplicationTemplateEntity", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid")
                .HasColumnName("id")
                .HasDefaultValueSql("uuid_generate_v4()");

                b.Property <bool>("Embeddable")
                .HasColumnType("boolean")
                .HasColumnName("embeddable");

                b.Property <string>("Icon")
                .HasColumnType("text")
                .HasColumnName("icon");

                b.Property <bool>("LoadInBackground")
                .HasColumnType("boolean")
                .HasColumnName("load_in_background");

                b.Property <string>("Name")
                .HasColumnType("text")
                .HasColumnName("name");

                b.Property <string>("Url")
                .HasColumnType("text")
                .HasColumnName("url");

                b.HasKey("Id");

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.FileEntity", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid")
                .HasColumnName("id")
                .HasDefaultValueSql("uuid_generate_v4()");

                b.Property <string>("Name")
                .HasColumnType("text")
                .HasColumnName("name");

                b.Property <string>("Path")
                .HasColumnType("text")
                .HasColumnName("path");

                b.Property <List <Guid> >("TeamIds")
                .HasColumnType("uuid[]")
                .HasColumnName("team_ids");

                b.Property <Guid?>("ViewId")
                .HasColumnType("uuid")
                .HasColumnName("view_id");

                b.HasKey("Id");

                b.HasIndex("ViewId");

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.NotificationEntity", b =>
            {
                b.Property <int>("Key")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasColumnName("key");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Key"));

                b.Property <DateTime>("BroadcastTime")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("broadcast_time");

                b.Property <Guid>("FromId")
                .HasColumnType("uuid")
                .HasColumnName("from_id");

                b.Property <string>("FromName")
                .HasColumnType("text")
                .HasColumnName("from_name");

                b.Property <int>("FromType")
                .HasColumnType("integer")
                .HasColumnName("from_type");

                b.Property <string>("Link")
                .HasColumnType("text")
                .HasColumnName("link");

                b.Property <int>("Priority")
                .HasColumnType("integer")
                .HasColumnName("priority");

                b.Property <string>("Subject")
                .HasColumnType("text")
                .HasColumnName("subject");

                b.Property <string>("Text")
                .HasColumnType("text")
                .HasColumnName("text");

                b.Property <Guid>("ToId")
                .HasColumnType("uuid")
                .HasColumnName("to_id");

                b.Property <string>("ToName")
                .HasColumnType("text")
                .HasColumnName("to_name");

                b.Property <int>("ToType")
                .HasColumnType("integer")
                .HasColumnName("to_type");

                b.Property <Guid?>("ViewId")
                .HasColumnType("uuid")
                .HasColumnName("view_id");

                b.HasKey("Key");

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.PermissionEntity", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid")
                .HasColumnName("id")
                .HasDefaultValueSql("uuid_generate_v4()");

                b.Property <string>("Description")
                .HasColumnType("text")
                .HasColumnName("description");

                b.Property <string>("Key")
                .HasColumnType("text")
                .HasColumnName("key");

                b.Property <bool>("ReadOnly")
                .HasColumnType("boolean")
                .HasColumnName("read_only");

                b.Property <string>("Value")
                .HasColumnType("text")
                .HasColumnName("value");

                b.HasKey("Id");

                b.HasIndex("Key", "Value")
                .IsUnique();

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.RoleEntity", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid")
                .HasColumnName("id")
                .HasDefaultValueSql("uuid_generate_v4()");

                b.Property <string>("Name")
                .HasColumnType("text")
                .HasColumnName("name");

                b.HasKey("Id");

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

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.RolePermissionEntity", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid")
                .HasColumnName("id")
                .HasDefaultValueSql("uuid_generate_v4()");

                b.Property <Guid>("PermissionId")
                .HasColumnType("uuid")
                .HasColumnName("permission_id");

                b.Property <Guid>("RoleId")
                .HasColumnType("uuid")
                .HasColumnName("role_id");

                b.HasKey("Id");

                b.HasIndex("PermissionId");

                b.HasIndex("RoleId", "PermissionId")
                .IsUnique();

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.TeamEntity", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid")
                .HasColumnName("id")
                .HasDefaultValueSql("uuid_generate_v4()");

                b.Property <string>("Name")
                .HasColumnType("text")
                .HasColumnName("name");

                b.Property <Guid?>("RoleId")
                .HasColumnType("uuid")
                .HasColumnName("role_id");

                b.Property <Guid>("ViewId")
                .HasColumnType("uuid")
                .HasColumnName("view_id");

                b.HasKey("Id");

                b.HasIndex("RoleId");

                b.HasIndex("ViewId");

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.TeamMembershipEntity", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid")
                .HasColumnName("id")
                .HasDefaultValueSql("uuid_generate_v4()");

                b.Property <Guid?>("RoleId")
                .HasColumnType("uuid")
                .HasColumnName("role_id");

                b.Property <Guid>("TeamId")
                .HasColumnType("uuid")
                .HasColumnName("team_id");

                b.Property <Guid>("UserId")
                .HasColumnType("uuid")
                .HasColumnName("user_id");

                b.Property <Guid>("ViewMembershipId")
                .HasColumnType("uuid")
                .HasColumnName("view_membership_id");

                b.HasKey("Id");

                b.HasIndex("RoleId");

                b.HasIndex("UserId");

                b.HasIndex("ViewMembershipId");

                b.HasIndex("TeamId", "UserId")
                .IsUnique();

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.TeamPermissionEntity", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid")
                .HasColumnName("id")
                .HasDefaultValueSql("uuid_generate_v4()");

                b.Property <Guid>("PermissionId")
                .HasColumnType("uuid")
                .HasColumnName("permission_id");

                b.Property <Guid>("TeamId")
                .HasColumnType("uuid")
                .HasColumnName("team_id");

                b.HasKey("Id");

                b.HasIndex("PermissionId");

                b.HasIndex("TeamId", "PermissionId")
                .IsUnique();

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.UserEntity", b =>
            {
                b.Property <int>("Key")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasColumnName("key");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Key"));

                b.Property <Guid>("Id")
                .HasColumnType("uuid")
                .HasColumnName("id");

                b.Property <string>("Name")
                .HasColumnType("text")
                .HasColumnName("name");

                b.Property <Guid?>("RoleId")
                .HasColumnType("uuid")
                .HasColumnName("role_id");

                b.HasKey("Key");

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

                b.HasIndex("RoleId");

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.UserPermissionEntity", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid")
                .HasColumnName("id")
                .HasDefaultValueSql("uuid_generate_v4()");

                b.Property <Guid>("PermissionId")
                .HasColumnType("uuid")
                .HasColumnName("permission_id");

                b.Property <Guid>("UserId")
                .HasColumnType("uuid")
                .HasColumnName("user_id");

                b.HasKey("Id");

                b.HasIndex("PermissionId");

                b.HasIndex("UserId", "PermissionId")
                .IsUnique();

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.ViewEntity", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid")
                .HasColumnName("id")
                .HasDefaultValueSql("uuid_generate_v4()");

                b.Property <string>("Description")
                .HasColumnType("text")
                .HasColumnName("description");

                b.Property <string>("Name")
                .HasColumnType("text")
                .HasColumnName("name");

                b.Property <int>("Status")
                .HasColumnType("integer")
                .HasColumnName("status");

                b.HasKey("Id");

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.ViewMembershipEntity", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid")
                .HasColumnName("id")
                .HasDefaultValueSql("uuid_generate_v4()");

                b.Property <Guid?>("PrimaryTeamMembershipId")
                .HasColumnType("uuid")
                .HasColumnName("primary_team_membership_id");

                b.Property <Guid>("UserId")
                .HasColumnType("uuid")
                .HasColumnName("user_id");

                b.Property <Guid>("ViewId")
                .HasColumnType("uuid")
                .HasColumnName("view_id");

                b.HasKey("Id");

                b.HasIndex("PrimaryTeamMembershipId");

                b.HasIndex("UserId");

                b.HasIndex("ViewId", "UserId")
                .IsUnique();

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.ApplicationEntity", b =>
            {
                b.HasOne("Player.Api.Data.Data.Models.ApplicationTemplateEntity", "Template")
                .WithMany()
                .HasForeignKey("ApplicationTemplateId");

                b.HasOne("Player.Api.Data.Data.Models.ViewEntity", "View")
                .WithMany("Applications")
                .HasForeignKey("ViewId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Template");

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.ApplicationInstanceEntity", b =>
            {
                b.HasOne("Player.Api.Data.Data.Models.ApplicationEntity", "Application")
                .WithMany()
                .HasForeignKey("ApplicationId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Player.Api.Data.Data.Models.TeamEntity", "Team")
                .WithMany("Applications")
                .HasForeignKey("TeamId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Application");

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.FileEntity", b =>
            {
                b.HasOne("Player.Api.Data.Data.Models.ViewEntity", "View")
                .WithMany("Files")
                .HasForeignKey("ViewId");

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.RolePermissionEntity", b =>
            {
                b.HasOne("Player.Api.Data.Data.Models.PermissionEntity", "Permission")
                .WithMany()
                .HasForeignKey("PermissionId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Player.Api.Data.Data.Models.RoleEntity", "Role")
                .WithMany("Permissions")
                .HasForeignKey("RoleId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Permission");

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.TeamEntity", b =>
            {
                b.HasOne("Player.Api.Data.Data.Models.RoleEntity", "Role")
                .WithMany()
                .HasForeignKey("RoleId");

                b.HasOne("Player.Api.Data.Data.Models.ViewEntity", "View")
                .WithMany("Teams")
                .HasForeignKey("ViewId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Role");

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.TeamMembershipEntity", b =>
            {
                b.HasOne("Player.Api.Data.Data.Models.RoleEntity", "Role")
                .WithMany()
                .HasForeignKey("RoleId");

                b.HasOne("Player.Api.Data.Data.Models.TeamEntity", "Team")
                .WithMany("Memberships")
                .HasForeignKey("TeamId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Player.Api.Data.Data.Models.UserEntity", "User")
                .WithMany("TeamMemberships")
                .HasForeignKey("UserId")
                .HasPrincipalKey("Id")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Player.Api.Data.Data.Models.ViewMembershipEntity", "ViewMembership")
                .WithMany("TeamMemberships")
                .HasForeignKey("ViewMembershipId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Role");

                b.Navigation("Team");

                b.Navigation("User");

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.TeamPermissionEntity", b =>
            {
                b.HasOne("Player.Api.Data.Data.Models.PermissionEntity", "Permission")
                .WithMany()
                .HasForeignKey("PermissionId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Player.Api.Data.Data.Models.TeamEntity", "Team")
                .WithMany("Permissions")
                .HasForeignKey("TeamId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Permission");

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.UserEntity", b =>
            {
                b.HasOne("Player.Api.Data.Data.Models.RoleEntity", "Role")
                .WithMany()
                .HasForeignKey("RoleId");

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.UserPermissionEntity", b =>
            {
                b.HasOne("Player.Api.Data.Data.Models.PermissionEntity", "Permission")
                .WithMany()
                .HasForeignKey("PermissionId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Player.Api.Data.Data.Models.UserEntity", "User")
                .WithMany("Permissions")
                .HasForeignKey("UserId")
                .HasPrincipalKey("Id")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Permission");

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.ViewMembershipEntity", b =>
            {
                b.HasOne("Player.Api.Data.Data.Models.TeamMembershipEntity", "PrimaryTeamMembership")
                .WithMany()
                .HasForeignKey("PrimaryTeamMembershipId");

                b.HasOne("Player.Api.Data.Data.Models.UserEntity", "User")
                .WithMany("ViewMemberships")
                .HasForeignKey("UserId")
                .HasPrincipalKey("Id")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Player.Api.Data.Data.Models.ViewEntity", "View")
                .WithMany("Memberships")
                .HasForeignKey("ViewId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("PrimaryTeamMembership");

                b.Navigation("User");

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.RoleEntity", b =>
            {
                b.Navigation("Permissions");
            });

            modelBuilder.Entity("Player.Api.Data.Data.Models.TeamEntity", b =>
            {
                b.Navigation("Applications");

                b.Navigation("Memberships");

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.UserEntity", b =>
            {
                b.Navigation("Permissions");

                b.Navigation("TeamMemberships");

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.ViewEntity", b =>
            {
                b.Navigation("Applications");

                b.Navigation("Files");

                b.Navigation("Memberships");

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

            modelBuilder.Entity("Player.Api.Data.Data.Models.ViewMembershipEntity", b =>
            {
                b.Navigation("TeamMemberships");
            });
#pragma warning restore 612, 618
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.0-rc.2.21480.5")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "mod_action_type", new[] { "deletion", "update" });
            NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "notification_type", new[] { "unknown", "other", "post_added", "post_edited", "post_deleted", "post_mod_edited", "post_mod_deleted" });
            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("WowsKarma.Api.Data.Models.Notifications.NotificationBase", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

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

                b.Property <DateTime?>("AcknowledgedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <DateTime>("EmittedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <NotificationType>("Type")
                .HasColumnType("notification_type");

                b.HasKey("Id");

                b.HasIndex("AccountId");

                b.ToTable("Notifications");

                b.HasDiscriminator <NotificationType>("Type").IsComplete(false).HasValue(NotificationType.Unknown);
            });

            modelBuilder.Entity("WowsKarma.Api.Data.Models.PlatformBan", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <DateTime?>("BannedUntil")
                .HasColumnType("timestamp with time zone");

                b.Property <DateTime>("CreatedAt")
                .ValueGeneratedOnAdd()
                .HasColumnType("timestamp with time zone")
                .HasDefaultValueSql("NOW()");

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

                b.Property <string>("Reason")
                .IsRequired()
                .HasColumnType("text");

                b.Property <bool>("Reverted")
                .HasColumnType("boolean");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

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

                b.HasKey("Id");

                b.HasIndex("ModId");

                b.HasIndex("UserId");

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

            modelBuilder.Entity("WowsKarma.Api.Data.Models.Player", b =>
            {
                b.Property <long>("Id")
                .HasColumnType("bigint");

                b.Property <int>("CourtesyRating")
                .HasColumnType("integer");

                b.Property <DateTime>("CreatedAt")
                .ValueGeneratedOnAdd()
                .HasColumnType("timestamp with time zone")
                .HasDefaultValueSql("NOW()");

                b.Property <int>("GameKarma")
                .HasColumnType("integer");

                b.Property <DateTime>("LastBattleTime")
                .HasColumnType("timestamp with time zone");

                b.Property <DateTime>("OptOutChanged")
                .HasColumnType("timestamp with time zone");

                b.Property <bool>("OptedOut")
                .HasColumnType("boolean");

                b.Property <int>("PerformanceRating")
                .HasColumnType("integer");

                b.Property <bool>("PostsBanned")
                .HasColumnType("boolean");

                b.Property <int>("SiteKarma")
                .HasColumnType("integer");

                b.Property <int>("TeamplayRating")
                .HasColumnType("integer");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

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

                b.Property <DateTime>("WgAccountCreatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <bool>("WgHidden")
                .HasColumnType("boolean");

                b.HasKey("Id");

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

            modelBuilder.Entity("WowsKarma.Api.Data.Models.Post", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

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

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

                b.Property <DateTime>("CreatedAt")
                .ValueGeneratedOnAdd()
                .HasColumnType("timestamp with time zone")
                .HasDefaultValueSql("NOW()");

                b.Property <int>("Flairs")
                .HasColumnType("integer");

                b.Property <bool>("ModLocked")
                .HasColumnType("boolean");

                b.Property <bool>("NegativeKarmaAble")
                .HasColumnType("boolean");

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

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

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.HasIndex("AuthorId");

                b.HasIndex("PlayerId");

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

            modelBuilder.Entity("WowsKarma.Api.Data.Models.PostModAction", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <ModActionType>("ActionType")
                .HasColumnType("mod_action_type");

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

                b.Property <Guid>("PostId")
                .HasColumnType("uuid");

                b.Property <string>("Reason")
                .HasColumnType("text");

                b.HasKey("Id");

                b.HasIndex("ModId");

                b.HasIndex("PostId");

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

            modelBuilder.Entity("WowsKarma.Api.Data.Models.Notifications.PostAddedNotification", b =>
            {
                b.HasBaseType("WowsKarma.Api.Data.Models.Notifications.NotificationBase");

                b.Property <Guid>("PostId")
                .ValueGeneratedOnUpdateSometimes()
                .HasColumnType("uuid");

                b.HasIndex("PostId");

                b.HasDiscriminator().HasValue(NotificationType.PostAdded);
            });

            modelBuilder.Entity("WowsKarma.Api.Data.Models.Notifications.PostDeletedNotification", b =>
            {
                b.HasBaseType("WowsKarma.Api.Data.Models.Notifications.NotificationBase");

                b.Property <Guid>("PostId")
                .ValueGeneratedOnUpdateSometimes()
                .HasColumnType("uuid");

                b.HasIndex("PostId");

                b.HasDiscriminator().HasValue(NotificationType.PostDeleted);
            });

            modelBuilder.Entity("WowsKarma.Api.Data.Models.Notifications.PostEditedNotification", b =>
            {
                b.HasBaseType("WowsKarma.Api.Data.Models.Notifications.NotificationBase");

                b.Property <Guid>("PostId")
                .HasColumnType("uuid");

                b.HasIndex("PostId");

                b.HasDiscriminator().HasValue(NotificationType.PostEdited);
            });

            modelBuilder.Entity("WowsKarma.Api.Data.Models.Notifications.PostModDeletedNotification", b =>
            {
                b.HasBaseType("WowsKarma.Api.Data.Models.Notifications.NotificationBase");

                b.Property <Guid>("ModActionId")
                .HasColumnType("uuid");

                b.HasIndex("ModActionId");

                b.HasDiscriminator().HasValue(NotificationType.PostModDeleted);
            });

            modelBuilder.Entity("WowsKarma.Api.Data.Models.Notifications.NotificationBase", b =>
            {
                b.HasOne("WowsKarma.Api.Data.Models.Player", "Account")
                .WithMany()
                .HasForeignKey("AccountId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("WowsKarma.Api.Data.Models.PlatformBan", b =>
            {
                b.HasOne("WowsKarma.Api.Data.Models.Player", "Mod")
                .WithMany()
                .HasForeignKey("ModId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("WowsKarma.Api.Data.Models.Player", "User")
                .WithMany("PlatformBans")
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Restrict);

                b.Navigation("Mod");

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

            modelBuilder.Entity("WowsKarma.Api.Data.Models.Post", b =>
            {
                b.HasOne("WowsKarma.Api.Data.Models.Player", "Author")
                .WithMany("PostsSent")
                .HasForeignKey("AuthorId")
                .OnDelete(DeleteBehavior.Restrict);

                b.HasOne("WowsKarma.Api.Data.Models.Player", "Player")
                .WithMany("PostsReceived")
                .HasForeignKey("PlayerId")
                .OnDelete(DeleteBehavior.Restrict);

                b.Navigation("Author");

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

            modelBuilder.Entity("WowsKarma.Api.Data.Models.PostModAction", b =>
            {
                b.HasOne("WowsKarma.Api.Data.Models.Player", "Mod")
                .WithMany()
                .HasForeignKey("ModId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("WowsKarma.Api.Data.Models.Post", "Post")
                .WithMany()
                .HasForeignKey("PostId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Mod");

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

            modelBuilder.Entity("WowsKarma.Api.Data.Models.Notifications.PostAddedNotification", b =>
            {
                b.HasOne("WowsKarma.Api.Data.Models.Post", "Post")
                .WithMany()
                .HasForeignKey("PostId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("WowsKarma.Api.Data.Models.Notifications.PostDeletedNotification", b =>
            {
                b.HasOne("WowsKarma.Api.Data.Models.Post", "Post")
                .WithMany()
                .HasForeignKey("PostId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("WowsKarma.Api.Data.Models.Notifications.PostEditedNotification", b =>
            {
                b.HasOne("WowsKarma.Api.Data.Models.Post", "Post")
                .WithMany()
                .HasForeignKey("PostId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("WowsKarma.Api.Data.Models.Notifications.PostModDeletedNotification", b =>
            {
                b.HasOne("WowsKarma.Api.Data.Models.PostModAction", "ModAction")
                .WithMany()
                .HasForeignKey("ModActionId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("WowsKarma.Api.Data.Models.Player", b =>
            {
                b.Navigation("PlatformBans");

                b.Navigation("PostsReceived");

                b.Navigation("PostsSent");
            });
#pragma warning restore 612, 618
        }
Ejemplo n.º 13
0
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasDefaultSchema("auth")
            .HasAnnotation("ProductVersion", "6.0.2")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("RoleUser", b =>
            {
                b.Property <byte>("RolesId")
                .HasColumnType("smallint");

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

                b.HasKey("RolesId", "UsersId");

                b.HasIndex("UsersId");

                b.ToTable("RoleUser", "auth");
            });

            modelBuilder.Entity("WowsKarma.Api.Data.Models.Auth.Role", b =>
            {
                b.Property <byte>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("smallint");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <byte>("Id"));

                b.Property <string>("DisplayName")
                .IsRequired()
                .HasColumnType("text");

                b.Property <string>("InternalName")
                .IsRequired()
                .HasColumnType("text");

                b.HasKey("Id");

                b.ToTable("Roles", "auth");

                b.HasData(
                    new
                {
                    Id           = (byte)1,
                    DisplayName  = "Administrator",
                    InternalName = "admin"
                },
                    new
                {
                    Id           = (byte)2,
                    DisplayName  = "Community Manager",
                    InternalName = "mod"
                });
            });

            modelBuilder.Entity("WowsKarma.Api.Data.Models.Auth.User", b =>
            {
                b.Property <long>("Id")
                .HasColumnType("bigint");

                b.Property <Instant>("LastTokenRequested")
                .HasColumnType("timestamp with time zone");

                b.Property <Guid>("SeedToken")
                .HasColumnType("uuid");

                b.HasKey("Id");

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

            modelBuilder.Entity("RoleUser", b =>
            {
                b.HasOne("WowsKarma.Api.Data.Models.Auth.Role", null)
                .WithMany()
                .HasForeignKey("RolesId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("WowsKarma.Api.Data.Models.Auth.User", null)
                .WithMany()
                .HasForeignKey("UsersId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });
#pragma warning restore 612, 618
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasDefaultSchema("tagster")
            .HasAnnotation("ProductVersion", "6.0.0")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("Tagster.Domain.Entities.Profile", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <string>("Href")
                .HasColumnType("text");

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

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

                b.HasKey("Id");

                b.ToTable("Profiles", "tagster");
            });

            modelBuilder.Entity("Tagster.Domain.Entities.RefreshToken", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <DateTime?>("RevokedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Token")
                .HasColumnType("text");

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

                b.HasKey("Id");

                b.ToTable("RefreshTokens", "tagster");
            });

            modelBuilder.Entity("Tagster.Domain.Entities.Tag", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

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

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

                b.HasKey("Id");

                b.HasIndex("ProfileId");

                b.ToTable("Tags", "tagster");
            });

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

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

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

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

                b.HasKey("Id");

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

            modelBuilder.Entity("Tagster.Domain.Entities.Tag", b =>
            {
                b.HasOne("Tagster.Domain.Entities.Profile", null)
                .WithMany("Tags")
                .HasForeignKey("ProfileId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Tagster.Domain.Entities.Profile", b =>
            {
                b.Navigation("Tags");
            });
#pragma warning restore 612, 618
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.3")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("Model.Balance", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <int>("Amount")
                .HasColumnType("integer");

                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

                b.Property <decimal>("UserId")
                .HasColumnType("numeric(20,0)");

                b.HasKey("Id");

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

            modelBuilder.Entity("Model.BannedUser", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

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

                b.Property <DateTime>("DateBanEnd")
                .HasColumnType("timestamp with time zone");

                b.Property <DateTime>("DateBanStart")
                .HasColumnType("timestamp with time zone");

                b.Property <decimal>("ServerId")
                .HasColumnType("numeric(20,0)");

                b.Property <decimal>("UserId")
                .HasColumnType("numeric(20,0)");

                b.HasKey("Id");

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

            modelBuilder.Entity("Model.Banroulette", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

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

                b.Property <int>("BanLengthHours")
                .HasColumnType("integer");

                b.Property <decimal>("ChannelId")
                .HasColumnType("numeric(20,0)");

                b.Property <int>("MaxParticipants")
                .HasColumnType("integer");

                b.Property <int>("MinParticipants")
                .HasColumnType("integer");

                b.Property <int>("RewardPool")
                .HasColumnType("integer");

                b.Property <decimal>("RoleReqId")
                .HasColumnType("numeric(20,0)");

                b.Property <decimal>("ServerId")
                .HasColumnType("numeric(20,0)");

                b.HasKey("Id");

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

            modelBuilder.Entity("Model.BanrouletteParticipant", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

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

                b.Property <decimal>("UserId")
                .HasColumnType("numeric(20,0)");

                b.HasKey("Id");

                b.HasIndex("BanrouletteId");

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

            modelBuilder.Entity("Model.Banroyale", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

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

                b.Property <int>("BanLengthHours")
                .HasColumnType("integer");

                b.Property <decimal>("ChannelId")
                .HasColumnType("numeric(20,0)");

                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

                b.Property <bool>("Kick")
                .HasColumnType("boolean");

                b.Property <int>("MaxFrequency")
                .HasColumnType("integer");

                b.Property <int>("MaxParticipants")
                .HasColumnType("integer");

                b.Property <int>("MinFrequency")
                .HasColumnType("integer");

                b.Property <int>("MinParticipants")
                .HasColumnType("integer");

                b.Property <decimal>("ParticipantRoleId")
                .HasColumnType("numeric(20,0)");

                b.Property <int>("RewardPool")
                .HasColumnType("integer");

                b.Property <decimal>("RoleReqId")
                .HasColumnType("numeric(20,0)");

                b.Property <bool>("Running")
                .HasColumnType("boolean");

                b.Property <int>("WinnerAmount")
                .HasColumnType("integer");

                b.HasKey("Id");

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

            modelBuilder.Entity("Model.BanroyaleMessage", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

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

                b.Property <int>("BanroyaleId")
                .HasColumnType("integer");

                b.Property <decimal>("EmoteId")
                .HasColumnType("numeric(20,0)");

                b.Property <decimal>("MessageId")
                .HasColumnType("numeric(20,0)");

                b.HasKey("Id");

                b.HasIndex("BanroyaleId");

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

            modelBuilder.Entity("Model.Blacklisted", b =>
            {
                b.Property <decimal>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("numeric(20,0)");

                b.HasKey("Id");

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

            modelBuilder.Entity("Model.BlacklistedChannel", b =>
            {
                b.Property <decimal>("ChannelId")
                .ValueGeneratedOnAdd()
                .HasColumnType("numeric(20,0)");

                b.HasKey("ChannelId");

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

            modelBuilder.Entity("Model.Command", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <string>("Aliases")
                .HasColumnType("text");

                b.Property <string>("Conditions")
                .HasColumnType("text");

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

                b.Property <string>("Example")
                .HasColumnType("text");

                b.Property <string>("ModuleName")
                .HasColumnType("text");

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

                b.HasKey("Id");

                b.HasIndex("ModuleName");

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

            modelBuilder.Entity("Model.Daily", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

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

                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

                b.Property <int>("Streak")
                .HasColumnType("integer");

                b.Property <decimal>("UserId")
                .HasColumnType("numeric(20,0)");

                b.HasKey("Id");

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

            modelBuilder.Entity("Model.DisabledCommand", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

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

                b.Property <int>("Type")
                .HasColumnType("integer");

                b.HasKey("Id");

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

            modelBuilder.Entity("Model.FeaturedWaifu", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

                b.Property <decimal>("UserId")
                .HasColumnType("numeric(20,0)");

                b.Property <string>("WaifuName")
                .HasColumnType("text");

                b.HasKey("Id");

                b.HasIndex("WaifuName");

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

            modelBuilder.Entity("Model.ImgurAlbumLink", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <string>("AlbumId")
                .HasColumnType("text");

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

                b.HasKey("Id");

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

            modelBuilder.Entity("Model.Invite", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <DateTime>("Date")
                .HasColumnType("timestamp with time zone");

                b.Property <decimal>("TeamId")
                .HasColumnType("numeric(20,0)");

                b.Property <decimal>("UserId")
                .HasColumnType("numeric(20,0)");

                b.HasKey("Id");

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

            modelBuilder.Entity("Model.LootBox", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <int>("Amount")
                .HasColumnType("integer");

                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

                b.Property <int>("Type")
                .HasColumnType("integer");

                b.Property <decimal>("UserId")
                .HasColumnType("numeric(20,0)");

                b.HasKey("Id");

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

            modelBuilder.Entity("Model.MalWaifu", b =>
            {
                b.Property <string>("WaifuName")
                .HasColumnType("text");

                b.Property <DateTime>("LastUpdated")
                .HasColumnType("timestamp with time zone");

                b.Property <bool>("MalConfirmed")
                .HasColumnType("boolean");

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

                b.HasKey("WaifuName");

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

            modelBuilder.Entity("Model.Marriage", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <DateTime>("Date")
                .HasColumnType("timestamp with time zone");

                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

                b.Property <bool>("IsMarried")
                .HasColumnType("boolean");

                b.Property <decimal>("UserId")
                .HasColumnType("numeric(20,0)");

                b.Property <decimal>("WifeId")
                .HasColumnType("numeric(20,0)");

                b.HasKey("Id");

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

            modelBuilder.Entity("Model.Models.Logging.Click", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <DateTime>("Date")
                .HasColumnType("timestamp with time zone");

                b.Property <decimal>("DiscordId")
                .HasColumnType("numeric(20,0)");

                b.Property <string>("Ip")
                .HasColumnType("text");

                b.Property <string>("RedirectUrl")
                .HasColumnType("text");

                b.Property <string>("Referer")
                .HasColumnType("text");

                b.Property <string>("Tag")
                .HasColumnType("text");

                b.Property <string>("Type")
                .HasColumnType("text");

                b.HasKey("Id");

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

            modelBuilder.Entity("Model.Models.Users.PremiumCode", b =>
            {
                b.Property <string>("Id")
                .HasColumnType("text");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <int>("DurationDays")
                .HasColumnType("integer");

                b.Property <DateTime?>("ExpiresAt")
                .HasColumnType("timestamp with time zone");

                b.Property <decimal>("Type")
                .HasColumnType("numeric(20,0)");

                b.Property <int>("UsesLeft")
                .HasColumnType("integer");

                b.HasKey("Id");

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

            modelBuilder.Entity("Model.Models.Users.PremiumCodeUse", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <DateTime>("ClaimedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

                b.Property <string>("PremiumCodeId")
                .HasColumnType("text");

                b.Property <decimal>("UserId")
                .HasColumnType("numeric(20,0)");

                b.HasKey("Id");

                b.HasIndex("PremiumCodeId");

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

            modelBuilder.Entity("Model.Module", b =>
            {
                b.Property <string>("Name")
                .HasColumnType("text");

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

                b.HasKey("Name");

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

            modelBuilder.Entity("Model.Param", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <string>("Args")
                .HasColumnType("text");

                b.Property <DateTime>("Date")
                .HasColumnType("timestamp with time zone");

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

                b.Property <decimal>("Num")
                .HasColumnType("numeric(20,0)");

                b.HasKey("Id");

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

            modelBuilder.Entity("Model.PermissionRole", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

                b.Property <decimal>("RoleId")
                .HasColumnType("numeric(20,0)");

                b.Property <int>("Type")
                .HasColumnType("integer");

                b.HasKey("Id");

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

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

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

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

                b.Property <decimal>("UserId")
                .HasColumnType("numeric(20,0)");

                b.HasKey("Id");

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

            modelBuilder.Entity("Model.Premium", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <DateTime>("ClaimDate")
                .HasColumnType("timestamp with time zone");

                b.Property <bool>("ExpireSent")
                .HasColumnType("boolean");

                b.Property <DateTime>("ExpiresAt")
                .HasColumnType("timestamp with time zone");

                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

                b.Property <decimal>("Type")
                .HasColumnType("numeric(20,0)");

                b.Property <decimal>("UserId")
                .HasColumnType("numeric(20,0)");

                b.HasKey("Id");

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

            modelBuilder.Entity("Model.Profile", b =>
            {
                b.Property <decimal>("UserId")
                .ValueGeneratedOnAdd()
                .HasColumnType("numeric(20,0)");

                b.Property <string>("ColorHex")
                .HasColumnType("text");

                b.Property <string>("Discriminator")
                .HasColumnType("text");

                b.Property <string>("Image")
                .HasColumnType("text");

                b.Property <DateTime>("LastUpdated")
                .HasColumnType("timestamp with time zone");

                b.Property <int>("LootboxesOpened")
                .HasColumnType("integer");

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

                b.Property <string>("PriorColorHexStack")
                .HasColumnType("text");

                b.Property <string>("Quote")
                .HasColumnType("text");

                b.Property <int>("Rep")
                .HasColumnType("integer");

                b.Property <DateTime>("RepDate")
                .HasColumnType("timestamp with time zone");

                b.HasKey("UserId");

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

            modelBuilder.Entity("Model.PublicRole", b =>
            {
                b.Property <decimal>("RoleId")
                .ValueGeneratedOnAdd()
                .HasColumnType("numeric(20,0)");

                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

                b.HasKey("RoleId");

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

            modelBuilder.Entity("Model.ReactionImage", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

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

                b.Property <string>("Url")
                .HasColumnType("text");

                b.HasKey("Id");

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

            modelBuilder.Entity("Model.RedditPost", b =>
            {
                b.Property <string>("PermaLink")
                .HasColumnType("text");

                b.Property <int>("Upvotes")
                .HasColumnType("integer");

                b.HasKey("PermaLink");

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

            modelBuilder.Entity("Model.Server", b =>
            {
                b.Property <decimal>("GuildId")
                .ValueGeneratedOnAdd()
                .HasColumnType("numeric(20,0)");

                b.Property <DateTime>("JoinDate")
                .HasColumnType("timestamp with time zone");

                b.Property <decimal>("JoinLogChannelId")
                .HasColumnType("numeric(20,0)");

                b.Property <DateTime>("LastUpdated")
                .HasColumnType("timestamp with time zone");

                b.Property <DateTime?>("LeaveDate")
                .HasColumnType("timestamp with time zone");

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

                b.Property <string>("Prefix")
                .HasColumnType("text");

                b.Property <decimal>("TeamLogChannelId")
                .HasColumnType("numeric(20,0)");

                b.Property <decimal>("WelcomeChannelId")
                .HasColumnType("numeric(20,0)");

                b.HasKey("GuildId");

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

            modelBuilder.Entity("Model.ShopRole", b =>
            {
                b.Property <decimal>("RoleId")
                .ValueGeneratedOnAdd()
                .HasColumnType("numeric(20,0)");

                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

                b.Property <int>("Price")
                .HasColumnType("integer");

                b.HasKey("RoleId");

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

            modelBuilder.Entity("Model.ShopWaifu", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <decimal>("BoughtBy")
                .HasColumnType("numeric(20,0)");

                b.Property <int>("Discount")
                .HasColumnType("integer");

                b.Property <int>("Limited")
                .HasColumnType("integer");

                b.Property <string>("WaifuName")
                .IsRequired()
                .HasColumnType("text");

                b.Property <int>("WaifuShopId")
                .HasColumnType("integer");

                b.HasKey("Id");

                b.HasIndex("WaifuName");

                b.HasIndex("WaifuShopId");

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

            modelBuilder.Entity("Model.SpecialChannel", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <string>("Args")
                .HasColumnType("text");

                b.Property <decimal>("ChannelId")
                .HasColumnType("numeric(20,0)");

                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

                b.Property <int>("Type")
                .HasColumnType("integer");

                b.HasKey("Id");

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

            modelBuilder.Entity("Model.Team", b =>
            {
                b.Property <decimal>("LeaderRoleId")
                .ValueGeneratedOnAdd()
                .HasColumnType("numeric(20,0)");

                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

                b.Property <decimal>("MemberRoleId")
                .HasColumnType("numeric(20,0)");

                b.HasKey("LeaderRoleId");

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

            modelBuilder.Entity("Model.Track", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <int>("PlaylistId")
                .HasColumnType("integer");

                b.Property <string>("SongHash")
                .HasColumnType("text");

                b.Property <decimal>("UserId")
                .HasColumnType("numeric(20,0)");

                b.HasKey("Id");

                b.HasIndex("PlaylistId");

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

            modelBuilder.Entity("Model.UserInventory", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <DateTime>("DateBought")
                .HasColumnType("timestamp with time zone");

                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

                b.Property <decimal>("UserId")
                .HasColumnType("numeric(20,0)");

                b.Property <string>("WaifuName")
                .HasColumnType("text");

                b.HasKey("Id");

                b.HasIndex("WaifuName");

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

            modelBuilder.Entity("Model.Voter", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <DateTime>("Date")
                .HasColumnType("timestamp with time zone");

                b.Property <decimal>("UserId")
                .HasColumnType("numeric(20,0)");

                b.HasKey("Id");

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

            modelBuilder.Entity("Model.Waifu", b =>
            {
                b.Property <string>("Name")
                .HasColumnType("text");

                b.Property <int>("Bought")
                .HasColumnType("integer");

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

                b.Property <string>("ImageSource")
                .HasColumnType("text");

                b.Property <string>("ImageUrl")
                .HasColumnType("text");

                b.Property <string>("LongName")
                .HasColumnType("text");

                b.Property <string>("Source")
                .HasColumnType("text");

                b.Property <int>("Tier")
                .HasColumnType("integer");

                b.HasKey("Name");

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

            modelBuilder.Entity("Model.WaifuShop", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <DateTime>("GeneratedDate")
                .HasColumnType("timestamp with time zone");

                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

                b.Property <int>("Type")
                .HasColumnType("integer");

                b.HasKey("Id");

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

            modelBuilder.Entity("Model.WaifuWish", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

                b.Property <decimal>("UserId")
                .HasColumnType("numeric(20,0)");

                b.Property <string>("WaifuName")
                .HasColumnType("text");

                b.HasKey("Id");

                b.HasIndex("WaifuName");

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

            modelBuilder.Entity("Model.Weekly", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <DateTime>("Date")
                .HasColumnType("timestamp with time zone");

                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

                b.Property <decimal>("UserId")
                .HasColumnType("numeric(20,0)");

                b.HasKey("Id");

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

            modelBuilder.Entity("Model.WelcomeMessage", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

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

                b.HasKey("Id");

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

            modelBuilder.Entity("Model.BanrouletteParticipant", b =>
            {
                b.HasOne("Model.Banroulette", "Banroulette")
                .WithMany()
                .HasForeignKey("BanrouletteId");

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

            modelBuilder.Entity("Model.BanroyaleMessage", b =>
            {
                b.HasOne("Model.Banroyale", "Banroyale")
                .WithMany()
                .HasForeignKey("BanroyaleId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Model.Command", b =>
            {
                b.HasOne("Model.Module", "Module")
                .WithMany("Commands")
                .HasForeignKey("ModuleName");

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

            modelBuilder.Entity("Model.FeaturedWaifu", b =>
            {
                b.HasOne("Model.Waifu", "Waifu")
                .WithMany()
                .HasForeignKey("WaifuName");

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

            modelBuilder.Entity("Model.MalWaifu", b =>
            {
                b.HasOne("Model.Waifu", "Waifu")
                .WithOne("Mal")
                .HasForeignKey("Model.MalWaifu", "WaifuName")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Model.Models.Users.PremiumCodeUse", b =>
            {
                b.HasOne("Model.Models.Users.PremiumCode", "PremiumCode")
                .WithMany("Uses")
                .HasForeignKey("PremiumCodeId");

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

            modelBuilder.Entity("Model.ShopWaifu", b =>
            {
                b.HasOne("Model.Waifu", "Waifu")
                .WithMany()
                .HasForeignKey("WaifuName")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Model.WaifuShop", "WaifuShop")
                .WithMany("ShopWaifus")
                .HasForeignKey("WaifuShopId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Waifu");

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

            modelBuilder.Entity("Model.Track", b =>
            {
                b.HasOne("Model.Playlist", "Playlist")
                .WithMany("Tracks")
                .HasForeignKey("PlaylistId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Model.UserInventory", b =>
            {
                b.HasOne("Model.Waifu", "Waifu")
                .WithMany()
                .HasForeignKey("WaifuName");

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

            modelBuilder.Entity("Model.WaifuWish", b =>
            {
                b.HasOne("Model.Waifu", "Waifu")
                .WithMany()
                .HasForeignKey("WaifuName");

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

            modelBuilder.Entity("Model.Models.Users.PremiumCode", b =>
            {
                b.Navigation("Uses");
            });

            modelBuilder.Entity("Model.Module", b =>
            {
                b.Navigation("Commands");
            });

            modelBuilder.Entity("Model.Playlist", b =>
            {
                b.Navigation("Tracks");
            });

            modelBuilder.Entity("Model.Waifu", b =>
            {
                b.Navigation("Mal");
            });

            modelBuilder.Entity("Model.WaifuShop", b =>
            {
                b.Navigation("ShopWaifus");
            });
#pragma warning restore 612, 618
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasDefaultSchema("public")
            .HasAnnotation("ProductVersion", "6.0.5")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("TelegramBot.DAL.Entities.Chat", b =>
            {
                b.Property <long>("Id")
                .HasColumnType("bigint");

                b.Property <bool?>("CanSetStickerSet")
                .HasColumnType("boolean");

                b.Property <DateTime>("Created")
                .HasColumnType("timestamp with time zone");

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

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

                b.Property <string>("InviteLink")
                .HasColumnType("text");

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

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

                b.Property <string>("StickerSetName")
                .HasColumnType("text");

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

                b.Property <int>("Type")
                .HasColumnType("integer");

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

                b.HasKey("Id");

                b.HasIndex("Id");

                b.ToTable("Chats", "public");
            });

            modelBuilder.Entity("TelegramBot.DAL.Entities.ChatPermission", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("Id"));

                b.Property <bool?>("CanAddWebPagePreviews")
                .HasColumnType("boolean");

                b.Property <bool?>("CanChangeInfo")
                .HasColumnType("boolean");

                b.Property <bool?>("CanInviteUsers")
                .HasColumnType("boolean");

                b.Property <bool?>("CanPinMessages")
                .HasColumnType("boolean");

                b.Property <bool?>("CanSendMediaMessages")
                .HasColumnType("boolean");

                b.Property <bool?>("CanSendMessages")
                .HasColumnType("boolean");

                b.Property <bool?>("CanSendOtherMessages")
                .HasColumnType("boolean");

                b.Property <bool?>("CanSendPolls")
                .HasColumnType("boolean");

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

                b.HasKey("Id");

                b.HasIndex("ChatId");

                b.HasIndex("Id", "ChatId")
                .IsUnique();

                b.ToTable("ChatPermissions", "public");
            });

            modelBuilder.Entity("TelegramBot.DAL.Entities.Contact", b =>
            {
                b.Property <long>("Id")
                .HasColumnType("bigint");

                b.Property <DateTime>("Created")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("FirstName")
                .IsRequired()
                .HasColumnType("text");

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

                b.Property <string>("PhoneNumber")
                .IsRequired()
                .HasColumnType("text");

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

                b.Property <string>("Vcard")
                .HasColumnType("text");

                b.HasKey("Id");

                b.HasIndex("Id");

                b.HasIndex("UserId");

                b.HasIndex("Id", "UserId")
                .IsUnique();

                b.ToTable("Contacts", "public");
            });

            modelBuilder.Entity("TelegramBot.DAL.Entities.Message", b =>
            {
                b.Property <long>("Id")
                .HasColumnType("bigint");

                b.Property <string>("AuthorSignature")
                .HasColumnType("text");

                b.Property <string>("Caption")
                .HasColumnType("text");

                b.Property <bool?>("ChannelChatCreated")
                .HasColumnType("boolean");

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

                b.Property <string>("ConnectedWebsite")
                .HasColumnType("text");

                b.Property <DateTime>("Date")
                .HasColumnType("timestamp with time zone");

                b.Property <bool?>("DeleteChatPhoto")
                .HasColumnType("boolean");

                b.Property <DateTime?>("EditDate")
                .HasColumnType("timestamp with time zone");

                b.Property <DateTime?>("ForwardDate")
                .HasColumnType("timestamp with time zone");

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

                b.Property <string>("ForwardSenderName")
                .HasColumnType("text");

                b.Property <string>("ForwardSignature")
                .HasColumnType("text");

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

                b.Property <bool?>("GroupChatCreated")
                .HasColumnType("boolean");

                b.Property <string>("MediaGroupId")
                .HasColumnType("text");

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

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

                b.Property <string>("NewChatTitle")
                .HasColumnType("text");

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

                b.Property <bool?>("SupergroupChatCreated")
                .HasColumnType("boolean");

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

                b.Property <int>("Type")
                .HasColumnType("integer");

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

                b.HasKey("Id");

                b.HasIndex("ChatId");

                b.HasIndex("Id");

                b.HasIndex("UserId");

                b.ToTable("Messages", "public");
            });

            modelBuilder.Entity("TelegramBot.DAL.Entities.Update", b =>
            {
                b.Property <long>("Id")
                .HasColumnType("bigint");

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

                b.Property <int>("Type")
                .HasColumnType("integer");

                b.HasKey("Id");

                b.HasIndex("Id");

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

                b.ToTable("Updates", "public");
            });

            modelBuilder.Entity("TelegramBot.DAL.Entities.User", b =>
            {
                b.Property <long>("Id")
                .HasColumnType("bigint");

                b.Property <bool?>("CanJoinGroups")
                .HasColumnType("boolean");

                b.Property <bool?>("CanReadAllGroupMessages")
                .HasColumnType("boolean");

                b.Property <DateTime>("Created")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("FirstName")
                .IsRequired()
                .HasColumnType("text");

                b.Property <bool>("IsBot")
                .HasColumnType("boolean");

                b.Property <string>("LanguageCode")
                .HasColumnType("text");

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

                b.Property <bool?>("SupportsInlineQueries")
                .HasColumnType("boolean");

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

                b.HasKey("Id");

                b.HasIndex("Id");

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

            modelBuilder.Entity("TelegramBot.DAL.Entities.ChatPermission", b =>
            {
                b.HasOne("TelegramBot.DAL.Entities.Chat", "Chat")
                .WithMany()
                .HasForeignKey("ChatId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("TelegramBot.DAL.Entities.Contact", b =>
            {
                b.HasOne("TelegramBot.DAL.Entities.User", "User")
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("TelegramBot.DAL.Entities.Message", b =>
            {
                b.HasOne("TelegramBot.DAL.Entities.Chat", "Chat")
                .WithMany("Messages")
                .HasForeignKey("ChatId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("TelegramBot.DAL.Entities.User", "User")
                .WithMany("Messages")
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Chat");

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

            modelBuilder.Entity("TelegramBot.DAL.Entities.Update", b =>
            {
                b.HasOne("TelegramBot.DAL.Entities.Message", "Message")
                .WithOne("Update")
                .HasForeignKey("TelegramBot.DAL.Entities.Update", "MessageId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("TelegramBot.DAL.Entities.Chat", b =>
            {
                b.Navigation("Messages");
            });

            modelBuilder.Entity("TelegramBot.DAL.Entities.Message", b =>
            {
                b.Navigation("Update");
            });

            modelBuilder.Entity("TelegramBot.DAL.Entities.User", b =>
            {
                b.Navigation("Messages");
            });
#pragma warning restore 612, 618
        }
Ejemplo n.º 17
0
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.0")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "bot_auth_claims", new[] { "designated_channel_view", "designated_channel_modify", "custom_prefix_set", "welcome_message_view", "welcome_message_modify", "tag_add", "tag_delete", "assignable_roles_add", "assignable_roles_delete", "delete_message", "emote_add", "claims_view", "claims_modify", "manage_class_add", "moderation_warn", "moderation_ban", "moderation_mute", "moderation_purge", "moderation_infraction_view", "dashboard_edit" });
            NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "designated_channels", new[] { "message_log", "moderation_log", "user_join_log", "user_leave_log", "starboard", "server_join_log", "bot_dm_log" });
            NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "infraction_type", new[] { "ban", "mute", "warn" });
            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("ClemBot.Api.Data.Models.Channel", b =>
            {
                b.Property <decimal>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("numeric(20,0)");

                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

                b.Property <bool>("IsThread")
                .ValueGeneratedOnAddOrUpdate()
                .HasColumnType("boolean")
                .HasComputedColumnSql("\"Channels\".\"ParentId\" IS NOT null", true);

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

                b.Property <decimal?>("ParentId")
                .HasColumnType("numeric(20,0)");

                b.HasKey("Id");

                b.HasIndex("GuildId");

                b.HasIndex("ParentId");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.ClaimsMapping", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <BotAuthClaims>("Claim")
                .HasColumnType("bot_auth_claims");

                b.Property <decimal>("RoleId")
                .HasColumnType("numeric(20,0)");

                b.HasKey("Id");

                b.HasIndex("RoleId");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.CommandInvocation", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <decimal>("ChannelId")
                .HasColumnType("numeric(20,0)");

                b.Property <string>("CommandName")
                .HasColumnType("text");

                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

                b.Property <LocalDateTime>("Time")
                .HasColumnType("timestamp without time zone");

                b.Property <decimal>("UserId")
                .HasColumnType("numeric(20,0)");

                b.HasKey("Id");

                b.HasIndex("ChannelId");

                b.HasIndex("GuildId");

                b.HasIndex("UserId");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.CustomPrefix", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

                b.Property <string>("Prefix")
                .HasColumnType("text");

                b.HasKey("Id");

                b.HasIndex("GuildId");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.DesignatedChannelMapping", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <decimal>("ChannelId")
                .HasColumnType("numeric(20,0)");

                b.Property <DesignatedChannels>("Type")
                .HasColumnType("designated_channels");

                b.HasKey("Id");

                b.HasIndex("ChannelId");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.Guild", b =>
            {
                b.Property <decimal>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("numeric(20,0)");

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

                b.Property <decimal>("OwnerId")
                .HasColumnType("numeric(20,0)");

                b.Property <string>("WelcomeMessage")
                .HasColumnType("text");

                b.HasKey("Id");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.GuildUser", b =>
            {
                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

                b.Property <decimal>("UserId")
                .HasColumnType("numeric(20,0)");

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

                b.HasIndex("UserId");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.Infraction", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <decimal>("AuthorId")
                .HasColumnType("numeric(20,0)");

                b.Property <LocalDateTime?>("Duration")
                .HasColumnType("timestamp without time zone");

                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

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

                b.Property <string>("Reason")
                .HasColumnType("text");

                b.Property <decimal>("SubjectId")
                .HasColumnType("numeric(20,0)");

                b.Property <LocalDateTime>("Time")
                .HasColumnType("timestamp without time zone");

                b.Property <InfractionType>("Type")
                .HasColumnType("infraction_type");

                b.HasKey("Id");

                b.HasIndex("AuthorId");

                b.HasIndex("GuildId");

                b.HasIndex("SubjectId");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.Message", b =>
            {
                b.Property <decimal>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("numeric(20,0)");

                b.Property <decimal>("ChannelId")
                .HasColumnType("numeric(20,0)");

                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

                b.Property <decimal>("UserId")
                .HasColumnType("numeric(20,0)");

                b.HasKey("Id");

                b.HasIndex("ChannelId");

                b.HasIndex("GuildId");

                b.HasIndex("UserId");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.MessageContent", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

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

                b.Property <decimal>("MessageId")
                .HasColumnType("numeric(20,0)");

                b.Property <LocalDateTime>("Time")
                .HasColumnType("timestamp without time zone");

                b.HasKey("Id");

                b.HasIndex("MessageId");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.Reminder", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <string>("Link")
                .HasColumnType("text");

                b.Property <decimal>("MessageId")
                .HasColumnType("numeric(20,0)");

                b.Property <DateTime>("Time")
                .HasColumnType("timestamp with time zone");

                b.Property <decimal>("UserId")
                .HasColumnType("numeric(20,0)");

                b.HasKey("Id");

                b.HasIndex("MessageId");

                b.HasIndex("UserId");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.Role", b =>
            {
                b.Property <decimal>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("numeric(20,0)");

                b.Property <bool>("Admin")
                .HasColumnType("boolean");

                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

                b.Property <bool?>("IsAssignable")
                .ValueGeneratedOnAdd()
                .HasColumnType("boolean")
                .HasDefaultValue(true);

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

                b.HasKey("Id");

                b.HasIndex("GuildId");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.RoleUser", b =>
            {
                b.Property <decimal>("RoleId")
                .HasColumnType("numeric(20,0)");

                b.Property <decimal>("UserId")
                .HasColumnType("numeric(20,0)");

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

                b.HasIndex("UserId");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.Tag", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

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

                b.Property <decimal>("GuildId")
                .HasColumnType("numeric(20,0)");

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

                b.Property <LocalDateTime>("Time")
                .HasColumnType("timestamp without time zone");

                b.Property <decimal>("UserId")
                .HasColumnType("numeric(20,0)");

                b.HasKey("Id");

                b.HasIndex("GuildId");

                b.HasIndex("UserId");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.TagUse", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <decimal>("ChannelId")
                .HasColumnType("numeric(20,0)");

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

                b.Property <DateTime>("Time")
                .HasColumnType("timestamp with time zone");

                b.Property <decimal>("UserId")
                .HasColumnType("numeric(20,0)");

                b.HasKey("Id");

                b.HasIndex("ChannelId");

                b.HasIndex("TagId");

                b.HasIndex("UserId");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.User", b =>
            {
                b.Property <decimal>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("numeric(20,0)");

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

                b.HasKey("Id");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.Channel", b =>
            {
                b.HasOne("ClemBot.Api.Data.Models.Guild", "Guild")
                .WithMany("Channels")
                .HasForeignKey("GuildId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("ClemBot.Api.Data.Models.Channel", "Parent")
                .WithMany()
                .HasForeignKey("ParentId");

                b.Navigation("Guild");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.ClaimsMapping", b =>
            {
                b.HasOne("ClemBot.Api.Data.Models.Role", "Role")
                .WithMany("Claims")
                .HasForeignKey("RoleId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.CommandInvocation", b =>
            {
                b.HasOne("ClemBot.Api.Data.Models.Channel", "Channel")
                .WithMany()
                .HasForeignKey("ChannelId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("ClemBot.Api.Data.Models.Guild", "Guild")
                .WithMany()
                .HasForeignKey("GuildId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

                b.Navigation("Channel");

                b.Navigation("Guild");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.CustomPrefix", b =>
            {
                b.HasOne("ClemBot.Api.Data.Models.Guild", "Guild")
                .WithMany("CustomPrefixes")
                .HasForeignKey("GuildId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.DesignatedChannelMapping", b =>
            {
                b.HasOne("ClemBot.Api.Data.Models.Channel", "Channel")
                .WithMany("DesignatedChannels")
                .HasForeignKey("ChannelId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.GuildUser", b =>
            {
                b.HasOne("ClemBot.Api.Data.Models.Guild", "Guild")
                .WithMany("GuildUsers")
                .HasForeignKey("GuildId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("ClemBot.Api.Data.Models.User", "User")
                .WithMany("GuildUsers")
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Guild");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.Infraction", b =>
            {
                b.HasOne("ClemBot.Api.Data.Models.User", "Author")
                .WithMany()
                .HasForeignKey("AuthorId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("ClemBot.Api.Data.Models.Guild", "Guild")
                .WithMany("Infractions")
                .HasForeignKey("GuildId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("ClemBot.Api.Data.Models.User", "Subject")
                .WithMany()
                .HasForeignKey("SubjectId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Author");

                b.Navigation("Guild");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.Message", b =>
            {
                b.HasOne("ClemBot.Api.Data.Models.Channel", "Channel")
                .WithMany("Messages")
                .HasForeignKey("ChannelId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("ClemBot.Api.Data.Models.Guild", "Guild")
                .WithMany("Messages")
                .HasForeignKey("GuildId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("ClemBot.Api.Data.Models.User", "User")
                .WithMany("Messages")
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Channel");

                b.Navigation("Guild");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.MessageContent", b =>
            {
                b.HasOne("ClemBot.Api.Data.Models.Message", "Message")
                .WithMany("Contents")
                .HasForeignKey("MessageId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.Reminder", b =>
            {
                b.HasOne("ClemBot.Api.Data.Models.Guild", "Message")
                .WithMany("Reminders")
                .HasForeignKey("MessageId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

                b.Navigation("Message");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.Role", b =>
            {
                b.HasOne("ClemBot.Api.Data.Models.Guild", "Guild")
                .WithMany("Roles")
                .HasForeignKey("GuildId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.RoleUser", b =>
            {
                b.HasOne("ClemBot.Api.Data.Models.Role", "Role")
                .WithMany("RoleUsers")
                .HasForeignKey("RoleId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("ClemBot.Api.Data.Models.User", "User")
                .WithMany("RoleUsers")
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Role");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.Tag", b =>
            {
                b.HasOne("ClemBot.Api.Data.Models.Guild", "Guild")
                .WithMany("Tags")
                .HasForeignKey("GuildId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("ClemBot.Api.Data.Models.User", "User")
                .WithMany("Tags")
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Guild");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.TagUse", b =>
            {
                b.HasOne("ClemBot.Api.Data.Models.Channel", "Channel")
                .WithMany()
                .HasForeignKey("ChannelId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("ClemBot.Api.Data.Models.Tag", "Tag")
                .WithMany("TagUses")
                .HasForeignKey("TagId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

                b.Navigation("Channel");

                b.Navigation("Tag");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.Channel", b =>
            {
                b.Navigation("DesignatedChannels");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.Guild", b =>
            {
                b.Navigation("Channels");

                b.Navigation("CustomPrefixes");

                b.Navigation("GuildUsers");

                b.Navigation("Infractions");

                b.Navigation("Messages");

                b.Navigation("Reminders");

                b.Navigation("Roles");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.Message", b =>
            {
                b.Navigation("Contents");
            });

            modelBuilder.Entity("ClemBot.Api.Data.Models.Role", b =>
            {
                b.Navigation("Claims");

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

            modelBuilder.Entity("ClemBot.Api.Data.Models.Tag", b =>
            {
                b.Navigation("TagUses");
            });

            modelBuilder.Entity("ClemBot.Api.Data.Models.User", b =>
            {
                b.Navigation("GuildUsers");

                b.Navigation("Messages");

                b.Navigation("RoleUsers");

                b.Navigation("Tags");
            });
#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", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("cloudscribe.SimpleContent.Models.ContentHistory", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasMaxLength(36)
                .HasColumnType("uuid")
                .HasColumnName("id");

                b.Property <string>("ArchivedBy")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("archived_by");

                b.Property <DateTime>("ArchivedUtc")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("archived_utc");

                b.Property <string>("Author")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("author");

                b.Property <string>("CategoriesCsv")
                .HasColumnType("text")
                .HasColumnName("categories_csv");

                b.Property <string>("Content")
                .HasColumnType("text")
                .HasColumnName("content");

                b.Property <string>("ContentId")
                .IsRequired()
                .HasMaxLength(36)
                .HasColumnType("character varying(36)")
                .HasColumnName("content_id");

                b.Property <string>("ContentSource")
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnType("character varying(50)")
                .HasColumnName("content_source");

                b.Property <string>("ContentType")
                .ValueGeneratedOnAdd()
                .HasMaxLength(50)
                .HasColumnType("character varying(50)")
                .HasDefaultValue("html")
                .HasColumnName("content_type");

                b.Property <string>("CorrelationKey")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("correlation_key");

                b.Property <string>("CreatedByUser")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)")
                .HasColumnName("created_by_user");

                b.Property <DateTime>("CreatedUtc")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("created_utc");

                b.Property <string>("DraftAuthor")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("draft_author");

                b.Property <string>("DraftContent")
                .HasColumnType("text")
                .HasColumnName("draft_content");

                b.Property <DateTime?>("DraftPubDate")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("draft_pub_date");

                b.Property <string>("DraftSerializedModel")
                .HasColumnType("text")
                .HasColumnName("draft_serialized_model");

                b.Property <bool>("IsDraftHx")
                .HasColumnType("boolean")
                .HasColumnName("is_draft_hx");

                b.Property <bool>("IsPublished")
                .HasColumnType("boolean")
                .HasColumnName("is_published");

                b.Property <DateTime>("LastModified")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("last_modified");

                b.Property <string>("LastModifiedByUser")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)")
                .HasColumnName("last_modified_by_user");

                b.Property <string>("MetaDescription")
                .HasColumnType("text")
                .HasColumnName("meta_description");

                b.Property <string>("MetaHtml")
                .HasColumnType("text")
                .HasColumnName("meta_html");

                b.Property <string>("MetaJson")
                .HasColumnType("text")
                .HasColumnName("meta_json");

                b.Property <int>("PageOrder")
                .HasColumnType("integer")
                .HasColumnName("page_order");

                b.Property <string>("ParentId")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("parent_id");

                b.Property <string>("ParentSlug")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("parent_slug");

                b.Property <string>("ProjectId")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)")
                .HasColumnName("project_id");

                b.Property <DateTime?>("PubDate")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("pub_date");

                b.Property <string>("SerializedModel")
                .HasColumnType("text")
                .HasColumnName("serialized_model");

                b.Property <string>("Serializer")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)")
                .HasColumnName("serializer");

                b.Property <string>("Slug")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("slug");

                b.Property <string>("TeaserOverride")
                .HasColumnType("text")
                .HasColumnName("teaser_override");

                b.Property <string>("TemplateKey")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("template_key");

                b.Property <string>("Title")
                .IsRequired()
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("title");

                b.Property <string>("ViewRoles")
                .HasColumnType("text")
                .HasColumnName("view_roles");

                b.Property <bool>("WasDeleted")
                .HasColumnType("boolean")
                .HasColumnName("was_deleted");

                b.HasKey("Id")
                .HasName("pk_cs_content_history");

                b.HasIndex("ContentId")
                .HasDatabaseName("ix_cs_content_history_content_id");

                b.HasIndex("ContentSource")
                .HasDatabaseName("ix_cs_content_history_content_source");

                b.HasIndex("CorrelationKey")
                .HasDatabaseName("ix_cs_content_history_correlation_key");

                b.HasIndex("CreatedByUser")
                .HasDatabaseName("ix_cs_content_history_created_by_user");

                b.HasIndex("LastModifiedByUser")
                .HasDatabaseName("ix_cs_content_history_last_modified_by_user");

                b.HasIndex("Title")
                .HasDatabaseName("ix_cs_content_history_title");

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

            modelBuilder.Entity("cloudscribe.SimpleContent.Models.ProjectSettings", b =>
            {
                b.Property <string>("Id")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)")
                .HasColumnName("id");

                b.Property <string>("AboutContent")
                .HasColumnType("text")
                .HasColumnName("about_content");

                b.Property <string>("AboutHeading")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("about_heading");

                b.Property <bool>("AddBlogToPagesTree")
                .HasColumnType("boolean")
                .HasColumnName("add_blog_to_pages_tree");

                b.Property <bool>("BlogMenuLinksToNewestPost")
                .HasColumnType("boolean")
                .HasColumnName("blog_menu_links_to_newest_post");

                b.Property <string>("BlogPageNavComponentVisibility")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("blog_page_nav_component_visibility");

                b.Property <int>("BlogPagePosition")
                .HasColumnType("integer")
                .HasColumnName("blog_page_position");

                b.Property <string>("BlogPageText")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("blog_page_text");

                b.Property <string>("CdnUrl")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("cdn_url");

                b.Property <string>("ChannelCategoriesCsv")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("channel_categories_csv");

                b.Property <string>("ChannelRating")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)")
                .HasColumnName("channel_rating");

                b.Property <int>("ChannelTimeToLive")
                .HasColumnType("integer")
                .HasColumnName("channel_time_to_live");

                b.Property <string>("CommentNotificationEmail")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)")
                .HasColumnName("comment_notification_email");

                b.Property <string>("CopyrightNotice")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("copyright_notice");

                b.Property <int>("DaysToComment")
                .HasColumnType("integer")
                .HasColumnName("days_to_comment");

                b.Property <string>("DefaultContentType")
                .ValueGeneratedOnAdd()
                .HasMaxLength(50)
                .HasColumnType("character varying(50)")
                .HasDefaultValue("html")
                .HasColumnName("default_content_type");

                b.Property <int>("DefaultFeedItems")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasDefaultValue(20)
                .HasColumnName("default_feed_items");

                b.Property <string>("DefaultPageSlug")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("default_page_slug");

                b.Property <string>("Description")
                .HasColumnType("text")
                .HasColumnName("description");

                b.Property <string>("DisqusShortName")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)")
                .HasColumnName("disqus_short_name");

                b.Property <string>("FacebookAppId")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)")
                .HasColumnName("facebook_app_id");

                b.Property <string>("Image")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("image");

                b.Property <bool>("IncludePubDateInPostUrls")
                .HasColumnType("boolean")
                .HasColumnName("include_pub_date_in_post_urls");

                b.Property <string>("LanguageCode")
                .HasMaxLength(10)
                .HasColumnType("character varying(10)")
                .HasColumnName("language_code");

                b.Property <string>("LocalMediaVirtualPath")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("local_media_virtual_path");

                b.Property <string>("ManagingEditorEmail")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)")
                .HasColumnName("managing_editor_email");

                b.Property <int>("MaxFeedItems")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasDefaultValue(1000)
                .HasColumnName("max_feed_items");

                b.Property <bool>("ModerateComments")
                .HasColumnType("boolean")
                .HasColumnName("moderate_comments");

                b.Property <int>("PostsPerPage")
                .HasColumnType("integer")
                .HasColumnName("posts_per_page");

                b.Property <string>("PubDateFormat")
                .HasMaxLength(75)
                .HasColumnType("character varying(75)")
                .HasColumnName("pub_date_format");

                b.Property <string>("Publisher")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("publisher");

                b.Property <string>("PublisherEntityType")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)")
                .HasColumnName("publisher_entity_type");

                b.Property <string>("PublisherLogoHeight")
                .HasMaxLength(20)
                .HasColumnType("character varying(20)")
                .HasColumnName("publisher_logo_height");

                b.Property <string>("PublisherLogoUrl")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("publisher_logo_url");

                b.Property <string>("PublisherLogoWidth")
                .HasMaxLength(20)
                .HasColumnType("character varying(20)")
                .HasColumnName("publisher_logo_width");

                b.Property <string>("RecaptchaPrivateKey")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("recaptcha_private_key");

                b.Property <string>("RecaptchaPublicKey")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("recaptcha_public_key");

                b.Property <string>("RemoteFeedProcessorUseAgentFragment")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("remote_feed_processor_use_agent_fragment");

                b.Property <string>("RemoteFeedUrl")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("remote_feed_url");

                b.Property <bool>("ShowAboutBox")
                .HasColumnType("boolean")
                .HasColumnName("show_about_box");

                b.Property <bool>("ShowFeaturedPostsOnDefaultPage")
                .HasColumnType("boolean")
                .HasColumnName("show_featured_posts_on_default_page");

                b.Property <bool>("ShowRecentPostsOnDefaultPage")
                .HasColumnType("boolean")
                .HasColumnName("show_recent_posts_on_default_page");

                b.Property <bool>("ShowRelatedPosts")
                .HasColumnType("boolean")
                .HasColumnName("show_related_posts");

                b.Property <bool>("ShowTitle")
                .HasColumnType("boolean")
                .HasColumnName("show_title");

                b.Property <string>("SiteName")
                .HasMaxLength(200)
                .HasColumnType("character varying(200)")
                .HasColumnName("site_name");

                b.Property <byte>("TeaserMode")
                .ValueGeneratedOnAdd()
                .HasColumnType("smallint")
                .HasDefaultValue((byte)0)
                .HasColumnName("teaser_mode");

                b.Property <int>("TeaserTruncationLength")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasDefaultValue(20)
                .HasColumnName("teaser_truncation_length");

                b.Property <byte>("TeaserTruncationMode")
                .ValueGeneratedOnAdd()
                .HasColumnType("smallint")
                .HasDefaultValue((byte)0)
                .HasColumnName("teaser_truncation_mode");

                b.Property <string>("TimeZoneId")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)")
                .HasColumnName("time_zone_id");

                b.Property <string>("Title")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("title");

                b.Property <string>("TwitterCreator")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)")
                .HasColumnName("twitter_creator");

                b.Property <string>("TwitterPublisher")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)")
                .HasColumnName("twitter_publisher");

                b.Property <bool>("UseDefaultPageAsRootNode")
                .HasColumnType("boolean")
                .HasColumnName("use_default_page_as_root_node");

                b.Property <string>("WebmasterEmail")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)")
                .HasColumnName("webmaster_email");

                b.HasKey("Id")
                .HasName("pk_cs_content_project");

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

            modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageCategory", b =>
            {
                b.Property <string>("Value")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)")
                .HasColumnName("value");

                b.Property <string>("PageEntityId")
                .HasMaxLength(36)
                .HasColumnType("character varying(36)")
                .HasColumnName("page_entity_id");

                b.Property <string>("ProjectId")
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnType("character varying(50)")
                .HasColumnName("project_id");

                b.HasKey("Value", "PageEntityId")
                .HasName("pk_cs_page_category");

                b.HasIndex("PageEntityId")
                .HasDatabaseName("ix_cs_page_category_page_entity_id");

                b.HasIndex("ProjectId")
                .HasDatabaseName("ix_cs_page_category_project_id");

                b.HasIndex("Value")
                .HasDatabaseName("ix_cs_page_category_value");

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

            modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b =>
            {
                b.Property <string>("Id")
                .HasMaxLength(36)
                .HasColumnType("character varying(36)")
                .HasColumnName("id");

                b.Property <string>("Author")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("author");

                b.Property <string>("Content")
                .HasColumnType("text")
                .HasColumnName("content");

                b.Property <string>("Email")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)")
                .HasColumnName("email");

                b.Property <string>("Ip")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)")
                .HasColumnName("ip");

                b.Property <bool>("IsAdmin")
                .HasColumnType("boolean")
                .HasColumnName("is_admin");

                b.Property <bool>("IsApproved")
                .HasColumnType("boolean")
                .HasColumnName("is_approved");

                b.Property <string>("PageEntityId")
                .HasMaxLength(36)
                .HasColumnType("character varying(36)")
                .HasColumnName("page_entity_id");

                b.Property <string>("ProjectId")
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnType("character varying(50)")
                .HasColumnName("project_id");

                b.Property <DateTime>("PubDate")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("pub_date");

                b.Property <string>("UserAgent")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("user_agent");

                b.Property <string>("Website")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("website");

                b.HasKey("Id")
                .HasName("pk_cs_page_comment");

                b.HasIndex("PageEntityId")
                .HasDatabaseName("ix_cs_page_comment_page_entity_id");

                b.HasIndex("ProjectId")
                .HasDatabaseName("ix_cs_page_comment_project_id");

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

            modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b =>
            {
                b.Property <string>("Id")
                .HasMaxLength(36)
                .HasColumnType("character varying(36)")
                .HasColumnName("id");

                b.Property <string>("Author")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("author");

                b.Property <string>("CategoriesCsv")
                .HasMaxLength(500)
                .HasColumnType("character varying(500)")
                .HasColumnName("categories_csv");

                b.Property <string>("Content")
                .HasColumnType("text")
                .HasColumnName("content");

                b.Property <string>("ContentType")
                .ValueGeneratedOnAdd()
                .HasMaxLength(50)
                .HasColumnType("character varying(50)")
                .HasDefaultValue("html")
                .HasColumnName("content_type");

                b.Property <string>("CorrelationKey")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("correlation_key");

                b.Property <string>("CreatedByUser")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)")
                .HasColumnName("created_by_user");

                b.Property <DateTime>("CreatedUtc")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("created_utc");

                b.Property <bool>("DisableEditor")
                .HasColumnType("boolean")
                .HasColumnName("disable_editor");

                b.Property <string>("DraftAuthor")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("draft_author");

                b.Property <string>("DraftContent")
                .HasColumnType("text")
                .HasColumnName("draft_content");

                b.Property <DateTime?>("DraftPubDate")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("draft_pub_date");

                b.Property <string>("DraftSerializedModel")
                .HasColumnType("text")
                .HasColumnName("draft_serialized_model");

                b.Property <string>("ExternalUrl")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("external_url");

                b.Property <bool>("IsPublished")
                .HasColumnType("boolean")
                .HasColumnName("is_published");

                b.Property <DateTime>("LastModified")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("last_modified");

                b.Property <string>("LastModifiedByUser")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)")
                .HasColumnName("last_modified_by_user");

                b.Property <string>("MenuFilters")
                .HasMaxLength(500)
                .HasColumnType("character varying(500)")
                .HasColumnName("menu_filters");

                b.Property <bool>("MenuOnly")
                .HasColumnType("boolean")
                .HasColumnName("menu_only");

                b.Property <string>("MetaDescription")
                .HasMaxLength(500)
                .HasColumnType("character varying(500)")
                .HasColumnName("meta_description");

                b.Property <string>("MetaHtml")
                .HasColumnType("text")
                .HasColumnName("meta_html");

                b.Property <string>("MetaJson")
                .HasColumnType("text")
                .HasColumnName("meta_json");

                b.Property <int>("PageOrder")
                .HasColumnType("integer")
                .HasColumnName("page_order");

                b.Property <string>("ParentId")
                .HasMaxLength(36)
                .HasColumnType("character varying(36)")
                .HasColumnName("parent_id");

                b.Property <string>("ParentSlug")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("parent_slug");

                b.Property <string>("ProjectId")
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnType("character varying(50)")
                .HasColumnName("project_id");

                b.Property <DateTime?>("PubDate")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("pub_date");

                b.Property <string>("SerializedModel")
                .HasColumnType("text")
                .HasColumnName("serialized_model");

                b.Property <string>("Serializer")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)")
                .HasColumnName("serializer");

                b.Property <bool>("ShowCategories")
                .HasColumnType("boolean")
                .HasColumnName("show_categories");

                b.Property <bool>("ShowComments")
                .HasColumnType("boolean")
                .HasColumnName("show_comments");

                b.Property <bool>("ShowHeading")
                .HasColumnType("boolean")
                .HasColumnName("show_heading");

                b.Property <bool>("ShowLastModified")
                .HasColumnType("boolean")
                .HasColumnName("show_last_modified");

                b.Property <bool>("ShowMenu")
                .HasColumnType("boolean")
                .HasColumnName("show_menu");

                b.Property <bool>("ShowPubDate")
                .HasColumnType("boolean")
                .HasColumnName("show_pub_date");

                b.Property <string>("Slug")
                .IsRequired()
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("slug");

                b.Property <string>("TemplateKey")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("template_key");

                b.Property <string>("Title")
                .IsRequired()
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("title");

                b.Property <string>("ViewRoles")
                .HasColumnType("text")
                .HasColumnName("view_roles");

                b.HasKey("Id")
                .HasName("pk_cs_page");

                b.HasIndex("CorrelationKey")
                .HasDatabaseName("ix_cs_page_correlation_key");

                b.HasIndex("ParentId")
                .HasDatabaseName("ix_cs_page_parent_id");

                b.HasIndex("ProjectId")
                .HasDatabaseName("ix_cs_page_project_id");

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

            modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b =>
            {
                b.Property <string>("Id")
                .HasMaxLength(36)
                .HasColumnType("character varying(36)")
                .HasColumnName("id");

                b.Property <string>("Environment")
                .IsRequired()
                .HasMaxLength(15)
                .HasColumnType("character varying(15)")
                .HasColumnName("environment");

                b.Property <string>("PageEntityId")
                .HasMaxLength(36)
                .HasColumnType("character varying(36)")
                .HasColumnName("page_entity_id");

                b.Property <int>("Sort")
                .HasColumnType("integer")
                .HasColumnName("sort");

                b.Property <string>("Type")
                .IsRequired()
                .HasMaxLength(10)
                .HasColumnType("character varying(10)")
                .HasColumnName("type");

                b.Property <string>("Url")
                .IsRequired()
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("url");

                b.HasKey("Id")
                .HasName("pk_cs_page_resource");

                b.HasIndex("PageEntityId")
                .HasDatabaseName("ix_cs_page_resource_page_entity_id");

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

            modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostCategory", b =>
            {
                b.Property <string>("Value")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)")
                .HasColumnName("value");

                b.Property <string>("PostEntityId")
                .HasMaxLength(36)
                .HasColumnType("character varying(36)")
                .HasColumnName("post_entity_id");

                b.Property <string>("ProjectId")
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnType("character varying(50)")
                .HasColumnName("project_id");

                b.HasKey("Value", "PostEntityId")
                .HasName("pk_cs_post_category");

                b.HasIndex("PostEntityId")
                .HasDatabaseName("ix_cs_post_category_post_entity_id");

                b.HasIndex("ProjectId")
                .HasDatabaseName("ix_cs_post_category_project_id");

                b.HasIndex("Value")
                .HasDatabaseName("ix_cs_post_category_value");

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

            modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b =>
            {
                b.Property <string>("Id")
                .HasMaxLength(36)
                .HasColumnType("character varying(36)")
                .HasColumnName("id");

                b.Property <string>("Author")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("author");

                b.Property <string>("Content")
                .HasColumnType("text")
                .HasColumnName("content");

                b.Property <string>("Email")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)")
                .HasColumnName("email");

                b.Property <string>("Ip")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)")
                .HasColumnName("ip");

                b.Property <bool>("IsAdmin")
                .HasColumnType("boolean")
                .HasColumnName("is_admin");

                b.Property <bool>("IsApproved")
                .HasColumnType("boolean")
                .HasColumnName("is_approved");

                b.Property <string>("PostEntityId")
                .HasMaxLength(36)
                .HasColumnType("character varying(36)")
                .HasColumnName("post_entity_id");

                b.Property <string>("ProjectId")
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnType("character varying(50)")
                .HasColumnName("project_id");

                b.Property <DateTime>("PubDate")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("pub_date");

                b.Property <string>("UserAgent")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("user_agent");

                b.Property <string>("Website")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("website");

                b.HasKey("Id")
                .HasName("pk_cs_post_comment");

                b.HasIndex("PostEntityId")
                .HasDatabaseName("ix_cs_post_comment_post_entity_id");

                b.HasIndex("ProjectId")
                .HasDatabaseName("ix_cs_post_comment_project_id");

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

            modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b =>
            {
                b.Property <string>("Id")
                .HasMaxLength(36)
                .HasColumnType("character varying(36)")
                .HasColumnName("id");

                b.Property <string>("Author")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("author");

                b.Property <string>("AutoTeaser")
                .HasColumnType("text")
                .HasColumnName("auto_teaser");

                b.Property <string>("BlogId")
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnType("character varying(50)")
                .HasColumnName("blog_id");

                b.Property <string>("CategoriesCsv")
                .HasMaxLength(500)
                .HasColumnType("character varying(500)")
                .HasColumnName("categories_csv");

                b.Property <string>("Content")
                .HasColumnType("text")
                .HasColumnName("content");

                b.Property <string>("ContentType")
                .ValueGeneratedOnAdd()
                .HasMaxLength(50)
                .HasColumnType("character varying(50)")
                .HasDefaultValue("html")
                .HasColumnName("content_type");

                b.Property <string>("CorrelationKey")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("correlation_key");

                b.Property <string>("CreatedByUser")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)")
                .HasColumnName("created_by_user");

                b.Property <DateTime>("CreatedUtc")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("created_utc");

                b.Property <string>("DraftAuthor")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("draft_author");

                b.Property <string>("DraftContent")
                .HasColumnType("text")
                .HasColumnName("draft_content");

                b.Property <DateTime?>("DraftPubDate")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("draft_pub_date");

                b.Property <string>("DraftSerializedModel")
                .HasColumnType("text")
                .HasColumnName("draft_serialized_model");

                b.Property <string>("ImageUrl")
                .HasMaxLength(250)
                .HasColumnType("character varying(250)")
                .HasColumnName("image_url");

                b.Property <bool>("IsFeatured")
                .HasColumnType("boolean")
                .HasColumnName("is_featured");

                b.Property <bool>("IsPublished")
                .HasColumnType("boolean")
                .HasColumnName("is_published");

                b.Property <DateTime>("LastModified")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("last_modified");

                b.Property <string>("LastModifiedByUser")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)")
                .HasColumnName("last_modified_by_user");

                b.Property <string>("MetaDescription")
                .HasMaxLength(500)
                .HasColumnType("character varying(500)")
                .HasColumnName("meta_description");

                b.Property <string>("MetaHtml")
                .HasColumnType("text")
                .HasColumnName("meta_html");

                b.Property <string>("MetaJson")
                .HasColumnType("text")
                .HasColumnName("meta_json");

                b.Property <DateTime?>("PubDate")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("pub_date");

                b.Property <string>("SerializedModel")
                .HasColumnType("text")
                .HasColumnName("serialized_model");

                b.Property <string>("Serializer")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)")
                .HasColumnName("serializer");

                b.Property <bool>("ShowComments")
                .HasColumnType("boolean")
                .HasColumnName("show_comments");

                b.Property <string>("Slug")
                .IsRequired()
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("slug");

                b.Property <bool>("SuppressTeaser")
                .HasColumnType("boolean")
                .HasColumnName("suppress_teaser");

                b.Property <string>("TeaserOverride")
                .HasColumnType("text")
                .HasColumnName("teaser_override");

                b.Property <string>("TemplateKey")
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("template_key");

                b.Property <string>("ThumbnailUrl")
                .HasMaxLength(250)
                .HasColumnType("character varying(250)")
                .HasColumnName("thumbnail_url");

                b.Property <string>("Title")
                .IsRequired()
                .HasMaxLength(255)
                .HasColumnType("character varying(255)")
                .HasColumnName("title");

                b.HasKey("Id")
                .HasName("pk_cs_post");

                b.HasIndex("BlogId")
                .HasDatabaseName("ix_cs_post_blog_id");

                b.HasIndex("CorrelationKey")
                .HasDatabaseName("ix_cs_post_correlation_key");

                b.HasIndex("Slug")
                .HasDatabaseName("ix_cs_post_slug");

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

            modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b =>
            {
                b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", null)
                .WithMany("PageComments")
                .HasForeignKey("PageEntityId")
                .OnDelete(DeleteBehavior.Cascade)
                .HasConstraintName("fk_cs_page_comment_cs_page_page_entity_id");
            });

            modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b =>
            {
                b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", null)
                .WithMany("PageResources")
                .HasForeignKey("PageEntityId")
                .OnDelete(DeleteBehavior.Cascade)
                .HasConstraintName("fk_cs_page_resource_cs_page_page_entity_id");
            });

            modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b =>
            {
                b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", null)
                .WithMany("PostComments")
                .HasForeignKey("PostEntityId")
                .HasConstraintName("fk_cs_post_comment_cs_post_post_entity_id");
            });

            modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b =>
            {
                b.Navigation("PageComments");

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

            modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b =>
            {
                b.Navigation("PostComments");
            });
#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", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("Ddi.Registry.Data.Agency", b =>
            {
                b.Property <string>("AgencyId")
                .HasColumnType("text");

                b.Property <string>("AdminContactId")
                .HasColumnType("text");

                b.Property <int>("ApprovalState")
                .HasColumnType("integer");

                b.Property <string>("CreatorId")
                .HasColumnType("text");

                b.Property <DateTime?>("DateApproved")
                .HasColumnType("timestamp with time zone");

                b.Property <DateTime>("DateCreated")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Label")
                .HasColumnType("text");

                b.Property <DateTime>("LastModified")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("TechnicalContactId")
                .HasColumnType("text");

                b.HasKey("AgencyId");

                b.HasIndex("AdminContactId");

                b.HasIndex("CreatorId");

                b.HasIndex("TechnicalContactId");

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

            modelBuilder.Entity("Ddi.Registry.Data.ApplicationUser", b =>
            {
                b.Property <string>("Id")
                .HasColumnType("text");

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

                b.Property <string>("City")
                .HasColumnType("text");

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

                b.Property <string>("Country")
                .HasColumnType("text");

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

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

                b.Property <string>("HomePage")
                .HasColumnType("text");

                b.Property <string>("JobTitle")
                .HasColumnType("text");

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

                b.Property <DateTimeOffset?>("LockoutEnd")
                .HasColumnType("timestamp with time zone");

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

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

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

                b.Property <string>("Organization")
                .HasColumnType("text");

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

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

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

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

                b.Property <string>("State")
                .HasColumnType("text");

                b.Property <string>("StreetAddress")
                .HasColumnType("text");

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

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

                b.Property <string>("Zip")
                .HasColumnType("text");

                b.HasKey("Id");

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

                b.HasIndex("NormalizedUserName")
                .IsUnique()
                .HasDatabaseName("UserNameIndex");

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

            modelBuilder.Entity("Ddi.Registry.Data.Assignment", b =>
            {
                b.Property <string>("AssignmentId")
                .HasColumnType("text");

                b.Property <string>("AgencyId")
                .HasColumnType("text");

                b.Property <DateTime>("DateCreated")
                .HasColumnType("timestamp with time zone");

                b.Property <bool>("IsDelegated")
                .HasColumnType("boolean");

                b.Property <DateTime>("LastModified")
                .HasColumnType("timestamp with time zone");

                b.HasKey("AssignmentId");

                b.HasIndex("AgencyId");

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

            modelBuilder.Entity("Ddi.Registry.Data.Delegation", b =>
            {
                b.Property <string>("DelegationId")
                .HasColumnType("text");

                b.Property <string>("AssignmentId")
                .HasColumnType("text");

                b.Property <string>("NameServer")
                .IsRequired()
                .HasMaxLength(255)
                .HasColumnType("character varying(255)");

                b.HasKey("DelegationId");

                b.HasIndex("AssignmentId");

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

            modelBuilder.Entity("Ddi.Registry.Data.ExportAction", b =>
            {
                b.Property <string>("Id")
                .HasColumnType("text");

                b.Property <DateTimeOffset>("LastModified")
                .HasColumnType("timestamp with time zone");

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

                b.HasKey("Id");

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

            modelBuilder.Entity("Ddi.Registry.Data.HttpResolver", b =>
            {
                b.Property <string>("Id")
                .HasColumnType("text");

                b.Property <string>("AssignmentId")
                .IsRequired()
                .HasColumnType("text");

                b.Property <string>("ResolutionType")
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.Property <string>("UrlTemplate")
                .IsRequired()
                .HasColumnType("text");

                b.HasKey("Id");

                b.HasIndex("AssignmentId");

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

            modelBuilder.Entity("Ddi.Registry.Data.Service", b =>
            {
                b.Property <string>("ServiceId")
                .HasColumnType("text");

                b.Property <string>("AssignmentId")
                .IsRequired()
                .HasColumnType("text");

                b.Property <string>("Hostname")
                .IsRequired()
                .HasMaxLength(255)
                .HasColumnType("character varying(255)");

                b.Property <int>("Port")
                .HasColumnType("integer");

                b.Property <int>("Priority")
                .HasColumnType("integer");

                b.Property <string>("Protocol")
                .IsRequired()
                .HasMaxLength(10)
                .HasColumnType("character varying(10)");

                b.Property <string>("ServiceName")
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.Property <int>("TimeToLive")
                .HasColumnType("integer");

                b.Property <int>("Weight")
                .HasColumnType("integer");

                b.HasKey("ServiceId");

                b.HasIndex("AssignmentId");

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("NormalizedName")
                .IsUnique()
                .HasDatabaseName("RoleNameIndex");

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

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

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

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

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

                b.Property <string>("RoleId")
                .IsRequired()
                .HasColumnType("text");

                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("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

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

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

                b.Property <string>("UserId")
                .IsRequired()
                .HasColumnType("text");

                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("character varying(128)");

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

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

                b.Property <string>("UserId")
                .IsRequired()
                .HasColumnType("text");

                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("text");

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

                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("text");

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

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

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

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

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

            modelBuilder.Entity("Ddi.Registry.Data.Agency", b =>
            {
                b.HasOne("Ddi.Registry.Data.ApplicationUser", "AdminContact")
                .WithMany()
                .HasForeignKey("AdminContactId");

                b.HasOne("Ddi.Registry.Data.ApplicationUser", "Creator")
                .WithMany()
                .HasForeignKey("CreatorId");

                b.HasOne("Ddi.Registry.Data.ApplicationUser", "TechnicalContact")
                .WithMany()
                .HasForeignKey("TechnicalContactId");

                b.Navigation("AdminContact");

                b.Navigation("Creator");

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

            modelBuilder.Entity("Ddi.Registry.Data.Assignment", b =>
            {
                b.HasOne("Ddi.Registry.Data.Agency", "Agency")
                .WithMany("Assignments")
                .HasForeignKey("AgencyId");

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

            modelBuilder.Entity("Ddi.Registry.Data.Delegation", b =>
            {
                b.HasOne("Ddi.Registry.Data.Assignment", "Assignment")
                .WithMany("Delegations")
                .HasForeignKey("AssignmentId");

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

            modelBuilder.Entity("Ddi.Registry.Data.HttpResolver", b =>
            {
                b.HasOne("Ddi.Registry.Data.Assignment", "Assignment")
                .WithMany("HttpResolvers")
                .HasForeignKey("AssignmentId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Ddi.Registry.Data.Service", b =>
            {
                b.HasOne("Ddi.Registry.Data.Assignment", "Assignment")
                .WithMany("Services")
                .HasForeignKey("AssignmentId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            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("Ddi.Registry.Data.ApplicationUser", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
            {
                b.HasOne("Ddi.Registry.Data.ApplicationUser", 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("Ddi.Registry.Data.ApplicationUser", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

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

            modelBuilder.Entity("Ddi.Registry.Data.Agency", b =>
            {
                b.Navigation("Assignments");
            });

            modelBuilder.Entity("Ddi.Registry.Data.Assignment", b =>
            {
                b.Navigation("Delegations");

                b.Navigation("HttpResolvers");

                b.Navigation("Services");
            });
#pragma warning restore 612, 618
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasDefaultSchema("withdrawals")
            .HasAnnotation("ProductVersion", "6.0.4")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("Service.Bitgo.WithdrawalProcessor.Postgres.Models.WithdrawalEntity", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("Id"));

                b.Property <decimal>("ActualFee")
                .HasColumnType("numeric");

                b.Property <string>("ActualFeeAssetSymbol")
                .HasColumnType("text");

                b.Property <decimal>("Amount")
                .HasColumnType("numeric");

                b.Property <decimal>("AssetIndexPrice")
                .HasColumnType("numeric");

                b.Property <string>("AssetSymbol")
                .HasMaxLength(64)
                .HasColumnType("character varying(64)");

                b.Property <string>("Blockchain")
                .HasMaxLength(128)
                .HasColumnType("character varying(128)");

                b.Property <string>("BrokerId")
                .HasMaxLength(128)
                .HasColumnType("character varying(128)");

                b.Property <bool>("Cancelling")
                .HasColumnType("boolean");

                b.Property <string>("ClientId")
                .HasMaxLength(128)
                .HasColumnType("character varying(128)");

                b.Property <string>("ClientIp")
                .HasMaxLength(64)
                .HasColumnType("character varying(64)");

                b.Property <string>("ClientLang")
                .HasMaxLength(64)
                .HasColumnType("character varying(64)");

                b.Property <string>("Comment")
                .HasMaxLength(512)
                .HasColumnType("character varying(512)");

                b.Property <string>("DestinationClientId")
                .HasColumnType("text");

                b.Property <string>("DestinationWalletId")
                .HasColumnType("text");

                b.Property <DateTime>("EventDate")
                .ValueGeneratedOnAdd()
                .HasColumnType("timestamp with time zone")
                .HasDefaultValue(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc));

                b.Property <string>("ExternalSystemId")
                .HasMaxLength(128)
                .HasColumnType("character varying(128)");

                b.Property <decimal>("FeeAmount")
                .HasColumnType("numeric");

                b.Property <string>("FeeAssetSymbol")
                .HasColumnType("text");

                b.Property <string>("FeeRefundTransactionId")
                .HasColumnType("text");

                b.Property <string>("Integration")
                .HasMaxLength(64)
                .HasColumnType("character varying(64)");

                b.Property <bool>("IsInternal")
                .HasColumnType("boolean");

                b.Property <string>("LastError")
                .HasMaxLength(2048)
                .HasColumnType("character varying(2048)");

                b.Property <DateTime>("LastTs")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("MatchingEngineId")
                .HasMaxLength(256)
                .HasColumnType("character varying(256)");

                b.Property <int>("MeErrorCode")
                .HasColumnType("integer");

                b.Property <DateTime>("NotificationTime")
                .ValueGeneratedOnAdd()
                .HasColumnType("timestamp with time zone")
                .HasDefaultValue(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc));

                b.Property <string>("RefundTransactionId")
                .HasColumnType("text");

                b.Property <int>("RetriesCount")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasDefaultValue(0);

                b.Property <string>("Signature")
                .HasColumnType("text");

                b.Property <int>("Status")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasDefaultValue(0);

                b.Property <string>("ToAddress")
                .HasMaxLength(512)
                .HasColumnType("character varying(512)");

                b.Property <string>("ToTag")
                .HasColumnType("text");

                b.Property <string>("TransactionId")
                .HasMaxLength(256)
                .HasColumnType("character varying(256)");

                b.Property <string>("Txid")
                .HasMaxLength(256)
                .HasColumnType("character varying(256)");

                b.Property <string>("WalletId")
                .HasMaxLength(128)
                .HasColumnType("character varying(128)");

                b.Property <int>("WorkflowState")
                .HasColumnType("integer");

                b.HasKey("Id");

                b.HasIndex("LastTs");

                b.HasIndex("Status");

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

                b.HasIndex("Integration", "ExternalSystemId")
                .IsUnique();

                b.ToTable("withdrawals", "withdrawals");
            });

            modelBuilder.Entity("Service.Bitgo.WithdrawalProcessor.Postgres.Models.WithdrawalSettingsEntity", b =>
            {
                b.Property <string>("Id")
                .HasColumnType("text");

                b.Property <int>("Mode")
                .HasColumnType("integer");

                b.HasKey("Id");

                b.ToTable("withdrawal_settings", "withdrawals");
            });
#pragma warning restore 612, 618
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasDefaultSchema("public")
            .HasAnnotation("ProductVersion", "6.0.0")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("IHunger.Domain.Models.AddressRestaurant", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <string>("City")
                .IsRequired()
                .HasColumnType("varchar(80)");

                b.Property <string>("County")
                .IsRequired()
                .HasColumnType("varchar(80)");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("District")
                .IsRequired()
                .HasColumnType("varchar(80)");

                b.Property <string>("Latitude")
                .HasColumnType("varchar(80)");

                b.Property <string>("Longitude")
                .HasColumnType("varchar(80)");

                b.Property <string>("Street")
                .IsRequired()
                .HasColumnType("varchar(80)");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("ZipCode")
                .IsRequired()
                .HasColumnType("varchar(15)");

                b.HasKey("Id");

                b.ToTable("AddressRestaurants", "public");
            });

            modelBuilder.Entity("IHunger.Domain.Models.AddressUser", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <string>("City")
                .IsRequired()
                .HasColumnType("varchar(80)");

                b.Property <string>("County")
                .IsRequired()
                .HasColumnType("varchar(80)");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("District")
                .IsRequired()
                .HasColumnType("varchar(80)");

                b.Property <string>("Latitude")
                .HasColumnType("varchar(80)");

                b.Property <string>("Longitude")
                .HasColumnType("varchar(80)");

                b.Property <string>("Street")
                .IsRequired()
                .HasColumnType("varchar(80)");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("ZipCode")
                .IsRequired()
                .HasColumnType("varchar(15)");

                b.HasKey("Id");

                b.ToTable("AddressUsers", "public");
            });

            modelBuilder.Entity("IHunger.Domain.Models.CategoryProduct", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

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

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

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.ToTable("CategoryProducts", "public");
            });

            modelBuilder.Entity("IHunger.Domain.Models.CategoryRestaurant", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

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

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

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.ToTable("CategoryRestaurants", "public");
            });

            modelBuilder.Entity("IHunger.Domain.Models.Comment", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <Guid>("IdRestaurant")
                .HasColumnType("uuid");

                b.Property <decimal>("Starts")
                .HasColumnType("DECIMAL");

                b.Property <string>("Text")
                .IsRequired()
                .HasColumnType("varchar(200)");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.HasIndex("IdRestaurant");

                b.ToTable("Comment", "public");
            });

            modelBuilder.Entity("IHunger.Domain.Models.Coupon", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <string>("Code")
                .IsRequired()
                .HasColumnType("varchar(50)");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <DateTime>("ExpireAt")
                .HasColumnType("timestamp with time zone");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <int>("Value")
                .HasColumnType("integer");

                b.HasKey("Id");

                b.ToTable("Coupons", "public");
            });

            modelBuilder.Entity("IHunger.Domain.Models.Item", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <Guid>("IdOrder")
                .HasColumnType("uuid");

                b.Property <Guid>("IdProduct")
                .HasColumnType("uuid");

                b.Property <decimal>("Price")
                .HasColumnType("DECIMAL");

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

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.HasIndex("IdOrder");

                b.HasIndex("IdProduct");

                b.ToTable("Itens", "public");
            });

            modelBuilder.Entity("IHunger.Domain.Models.Order", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <Guid?>("IdCoupon")
                .HasColumnType("uuid");

                b.Property <Guid?>("IdProfileUser")
                .HasColumnType("uuid");

                b.Property <int>("OrderStatus")
                .HasColumnType("integer");

                b.Property <decimal>("Price")
                .HasColumnType("DECIMAL");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.HasIndex("IdCoupon");

                b.HasIndex("IdProfileUser");

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

            modelBuilder.Entity("IHunger.Domain.Models.OrderStatus", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Name")
                .IsRequired()
                .HasColumnType("varchar(200)");

                b.Property <int>("Number")
                .HasColumnType("integer");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.ToTable("OrdersStatus", "public");
            });

            modelBuilder.Entity("IHunger.Domain.Models.Product", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

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

                b.Property <Guid>("IdCategoryProduct")
                .HasColumnType("uuid");

                b.Property <Guid>("IdRestaurant")
                .HasColumnType("uuid");

                b.Property <string>("Image")
                .IsRequired()
                .HasColumnType("varchar(100)");

                b.Property <bool>("Kosher")
                .HasColumnType("boolean");

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

                b.Property <decimal>("Price")
                .HasColumnType("DECIMAL");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <bool>("Vegan")
                .HasColumnType("boolean");

                b.Property <bool>("Vegetarian")
                .HasColumnType("boolean");

                b.HasKey("Id");

                b.HasIndex("IdCategoryProduct");

                b.HasIndex("IdRestaurant");

                b.ToTable("Products", "public");
            });

            modelBuilder.Entity("IHunger.Domain.Models.ProfileUser", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <DateTime?>("BirthDate")
                .HasColumnType("timestamp with time zone");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <Guid?>("IdAddressUser")
                .IsRequired()
                .HasColumnType("uuid");

                b.Property <string>("LastName")
                .IsRequired()
                .HasColumnType("varchar(80)");

                b.Property <string>("Name")
                .IsRequired()
                .HasColumnType("varchar(80)");

                b.Property <int>("Type")
                .HasColumnType("integer");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.HasIndex("IdAddressUser");

                b.ToTable("ProfileUsers", "public");
            });

            modelBuilder.Entity("IHunger.Domain.Models.Restaurant", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

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

                b.Property <Guid>("IdAddressRestaurant")
                .HasColumnType("uuid");

                b.Property <Guid>("IdCategoryRestaurant")
                .HasColumnType("uuid");

                b.Property <string>("Image")
                .IsRequired()
                .HasColumnType("varchar(100)");

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

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.HasIndex("IdAddressRestaurant");

                b.HasIndex("IdCategoryRestaurant");

                b.ToTable("Restaurant", "public");
            });

            modelBuilder.Entity("IHunger.Domain.Models.User", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

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

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

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

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

                b.Property <Guid>("IdProfileUser")
                .HasColumnType("uuid");

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

                b.Property <DateTimeOffset?>("LockoutEnd")
                .HasColumnType("timestamp with time zone");

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

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

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("IdProfileUser");

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

                b.HasIndex("NormalizedUserName")
                .IsUnique()
                .HasDatabaseName("UserNameIndex");

                b.ToTable("AspNetUsers", "public");
            });

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("NormalizedName")
                .IsUnique()
                .HasDatabaseName("RoleNameIndex");

                b.ToTable("AspNetRoles", "public");
            });

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

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

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

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

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

                b.HasKey("Id");

                b.HasIndex("RoleId");

                b.ToTable("AspNetRoleClaims", "public");
            });

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

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

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

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

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

                b.HasKey("Id");

                b.HasIndex("UserId");

                b.ToTable("AspNetUserClaims", "public");
            });

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

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

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

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

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

                b.HasIndex("UserId");

                b.ToTable("AspNetUserLogins", "public");
            });

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

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

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

                b.HasIndex("RoleId");

                b.ToTable("AspNetUserRoles", "public");
            });

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

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

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

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

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

                b.ToTable("AspNetUserTokens", "public");
            });

            modelBuilder.Entity("IHunger.Domain.Models.Comment", b =>
            {
                b.HasOne("IHunger.Domain.Models.Restaurant", "Restaurant")
                .WithMany("Comments")
                .HasForeignKey("IdRestaurant")
                .IsRequired();

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

            modelBuilder.Entity("IHunger.Domain.Models.Item", b =>
            {
                b.HasOne("IHunger.Domain.Models.Order", "Order")
                .WithMany("Items")
                .HasForeignKey("IdOrder")
                .IsRequired();

                b.HasOne("IHunger.Domain.Models.Product", "Product")
                .WithMany("Itens")
                .HasForeignKey("IdProduct")
                .IsRequired();

                b.Navigation("Order");

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

            modelBuilder.Entity("IHunger.Domain.Models.Order", b =>
            {
                b.HasOne("IHunger.Domain.Models.Coupon", "Coupon")
                .WithMany("Orders")
                .HasForeignKey("IdCoupon");

                b.HasOne("IHunger.Domain.Models.ProfileUser", "ProfileUser")
                .WithMany("Orders")
                .HasForeignKey("IdProfileUser");

                b.Navigation("Coupon");

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

            modelBuilder.Entity("IHunger.Domain.Models.Product", b =>
            {
                b.HasOne("IHunger.Domain.Models.CategoryProduct", "CategoryProduct")
                .WithMany()
                .HasForeignKey("IdCategoryProduct")
                .IsRequired();

                b.HasOne("IHunger.Domain.Models.Restaurant", "Restaurant")
                .WithMany("Products")
                .HasForeignKey("IdRestaurant")
                .IsRequired();

                b.Navigation("CategoryProduct");

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

            modelBuilder.Entity("IHunger.Domain.Models.ProfileUser", b =>
            {
                b.HasOne("IHunger.Domain.Models.AddressUser", "AddressUser")
                .WithMany()
                .HasForeignKey("IdAddressUser")
                .IsRequired();

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

            modelBuilder.Entity("IHunger.Domain.Models.Restaurant", b =>
            {
                b.HasOne("IHunger.Domain.Models.AddressRestaurant", "AddressRestaurant")
                .WithMany()
                .HasForeignKey("IdAddressRestaurant")
                .IsRequired();

                b.HasOne("IHunger.Domain.Models.CategoryRestaurant", "CategoryRestaurant")
                .WithMany()
                .HasForeignKey("IdCategoryRestaurant")
                .IsRequired();

                b.Navigation("AddressRestaurant");

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

            modelBuilder.Entity("IHunger.Domain.Models.User", b =>
            {
                b.HasOne("IHunger.Domain.Models.ProfileUser", "ProfileUser")
                .WithMany()
                .HasForeignKey("IdProfileUser")
                .IsRequired();

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

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

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

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

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

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

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

            modelBuilder.Entity("IHunger.Domain.Models.Coupon", b =>
            {
                b.Navigation("Orders");
            });

            modelBuilder.Entity("IHunger.Domain.Models.Order", b =>
            {
                b.Navigation("Items");
            });

            modelBuilder.Entity("IHunger.Domain.Models.Product", b =>
            {
                b.Navigation("Itens");
            });

            modelBuilder.Entity("IHunger.Domain.Models.ProfileUser", b =>
            {
                b.Navigation("Orders");
            });

            modelBuilder.Entity("IHunger.Domain.Models.Restaurant", b =>
            {
                b.Navigation("Comments");

                b.Navigation("Products");
            });
#pragma warning restore 612, 618
        }
Ejemplo n.º 22
0
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.0")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "postgis");
            NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "uuid-ossp");
            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("HappyTravel.Nakijin.Data.Models.AccommodationChangeLog", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <int>("AccommodationId")
                .HasColumnType("integer");

                b.Property <JsonDocument>("ChangeEventData")
                .IsRequired()
                .HasColumnType("jsonb");

                b.Property <DateTimeOffset>("Created")
                .HasColumnType("timestamp with time zone");

                b.Property <int>("EventSource")
                .HasColumnType("integer");

                b.Property <int>("EventType")
                .HasColumnType("integer");

                b.HasKey("Id");

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

            modelBuilder.Entity("HappyTravel.Nakijin.Data.Models.Accommodations.RichAccommodationDetails", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <string>("AccommodationWithManualCorrections")
                .IsRequired()
                .HasColumnType("jsonb");

                b.Property <string>("CountryCode")
                .HasColumnType("text");

                b.Property <int>("CountryId")
                .HasColumnType("integer");

                b.Property <DateTimeOffset>("Created")
                .ValueGeneratedOnAdd()
                .HasColumnType("timestamp with time zone")
                .HasDefaultValueSql("now() at time zone 'utc'");

                b.Property <int>("DeactivationReason")
                .HasColumnType("integer");

                b.Property <string>("DeactivationReasonDescription")
                .HasColumnType("text");

                b.Property <string>("FinalAccommodation")
                .IsRequired()
                .HasColumnType("jsonb");

                b.Property <bool>("HasDirectContract")
                .HasColumnType("boolean");

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

                b.Property <bool>("IsCorrected")
                .ValueGeneratedOnAdd()
                .HasColumnType("boolean")
                .HasDefaultValue(true);

                b.Property <string>("KeyData")
                .IsRequired()
                .HasColumnType("jsonb");

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

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

                b.Property <DateTimeOffset>("Modified")
                .ValueGeneratedOnAdd()
                .HasColumnType("timestamp with time zone")
                .HasDefaultValueSql("now() at time zone 'utc'");

                b.Property <string>("SupplierAccommodationCodes")
                .IsRequired()
                .HasColumnType("jsonb");

                b.Property <string>("SuppliersPriority")
                .IsRequired()
                .HasColumnType("jsonb");

                b.HasKey("Id");

                b.HasIndex("CountryId");

                b.HasIndex("LocalityId");

                b.HasIndex("LocalityZoneId");

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

            modelBuilder.Entity("HappyTravel.Nakijin.Data.Models.AccommodationUncertainMatches", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <DateTimeOffset>("Created")
                .ValueGeneratedOnAdd()
                .HasColumnType("timestamp with time zone")
                .HasDefaultValueSql("now() at time zone 'utc'");

                b.Property <int>("HtIdToMerge")
                .HasColumnType("integer");

                b.Property <bool>("IsActive")
                .ValueGeneratedOnAdd()
                .HasColumnType("boolean")
                .HasDefaultValue(true);

                b.Property <DateTimeOffset>("Modified")
                .ValueGeneratedOnAdd()
                .HasColumnType("timestamp with time zone")
                .HasDefaultValueSql("now() at time zone 'utc'");

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

                b.Property <int>("SourceHtId")
                .HasColumnType("integer");

                b.HasKey("Id");

                b.HasIndex("HtIdToMerge");

                b.HasIndex("SourceHtId");

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

            modelBuilder.Entity("HappyTravel.Nakijin.Data.Models.Ancillary.InvalidAccommodationMappingEntry", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <int>("AccommodationId")
                .HasColumnType("integer");

                b.Property <List <MatchingResultEntry> >("MatchingResults")
                .IsRequired()
                .HasColumnType("jsonb");

                b.Property <Dictionary <string, string> >("Suppliers")
                .HasColumnType("jsonb");

                b.HasKey("Id");

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

            modelBuilder.Entity("HappyTravel.Nakijin.Data.Models.Country", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <string>("Code")
                .IsRequired()
                .HasColumnType("text");

                b.Property <DateTimeOffset>("Created")
                .ValueGeneratedOnAdd()
                .HasColumnType("timestamp with time zone")
                .HasDefaultValueSql("now() at time zone 'utc'");

                b.Property <bool>("IsActive")
                .ValueGeneratedOnAdd()
                .HasColumnType("boolean")
                .HasDefaultValue(true);

                b.Property <DateTimeOffset>("Modified")
                .ValueGeneratedOnAdd()
                .HasColumnType("timestamp with time zone")
                .HasDefaultValueSql("now() at time zone 'utc'");

                b.Property <MultiLanguage <string> >("Names")
                .IsRequired()
                .HasColumnType("jsonb");

                b.Property <string>("SupplierCountryCodes")
                .IsRequired()
                .HasColumnType("jsonb");

                b.HasKey("Id");

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

            modelBuilder.Entity("HappyTravel.Nakijin.Data.Models.DataUpdateHistory", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <int>("Supplier")
                .HasColumnType("integer");

                b.Property <string>("SupplierCode")
                .IsRequired()
                .HasColumnType("text");

                b.Property <int>("Type")
                .HasColumnType("integer");

                b.Property <DateTimeOffset>("UpdateTime")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

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

            modelBuilder.Entity("HappyTravel.Nakijin.Data.Models.HtAccommodationMapping", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <DateTimeOffset>("Created")
                .HasColumnType("timestamp with time zone");

                b.Property <int>("HtId")
                .HasColumnType("integer");

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

                b.Property <HashSet <int> >("MappedHtIds")
                .IsRequired()
                .HasColumnType("jsonb");

                b.Property <DateTimeOffset>("Modified")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.HasIndex("HtId");

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

            modelBuilder.Entity("HappyTravel.Nakijin.Data.Models.Localities.Locality", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <int>("CountryId")
                .HasColumnType("integer");

                b.Property <DateTimeOffset>("Created")
                .ValueGeneratedOnAdd()
                .HasColumnType("timestamp with time zone")
                .HasDefaultValueSql("now() at time zone 'utc'");

                b.Property <bool>("IsActive")
                .ValueGeneratedOnAdd()
                .HasColumnType("boolean")
                .HasDefaultValue(true);

                b.Property <DateTimeOffset>("Modified")
                .ValueGeneratedOnAdd()
                .HasColumnType("timestamp with time zone")
                .HasDefaultValueSql("now() at time zone 'utc'");

                b.Property <MultiLanguage <string> >("Names")
                .IsRequired()
                .HasColumnType("jsonb");

                b.Property <string>("SupplierLocalityCodes")
                .HasColumnType("jsonb");

                b.HasKey("Id");

                b.HasIndex("CountryId");

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

            modelBuilder.Entity("HappyTravel.Nakijin.Data.Models.Localities.LocalityCandidate", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <int>("CountryId")
                .HasColumnType("integer");

                b.Property <DateTimeOffset>("Created")
                .ValueGeneratedOnAdd()
                .HasColumnType("timestamp with time zone")
                .HasDefaultValueSql("now() at time zone 'utc'");

                b.Property <MultiLanguage <string> >("Names")
                .IsRequired()
                .HasColumnType("jsonb");

                b.HasKey("Id");

                b.HasIndex("CountryId");

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

            modelBuilder.Entity("HappyTravel.Nakijin.Data.Models.Localities.LocalitySynonym", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <DateTimeOffset>("Created")
                .ValueGeneratedOnAdd()
                .HasColumnType("timestamp with time zone")
                .HasDefaultValueSql("now() at time zone 'utc'");

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

                b.Property <int>("LocalityId")
                .HasColumnType("integer");

                b.Property <DateTimeOffset>("Modified")
                .ValueGeneratedOnAdd()
                .HasColumnType("timestamp with time zone")
                .HasDefaultValueSql("now() at time zone 'utc'");

                b.Property <MultiLanguage <string> >("Names")
                .IsRequired()
                .HasColumnType("jsonb");

                b.Property <int>("SynonymType")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasDefaultValue(1);

                b.HasKey("Id");

                b.HasIndex("ExLocalityId");

                NpgsqlIndexBuilderExtensions.IncludeProperties(b.HasIndex("ExLocalityId"), new[] { "SynonymType" });

                b.HasIndex("LocalityId");

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

            modelBuilder.Entity("HappyTravel.Nakijin.Data.Models.LocalityZone", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <DateTimeOffset>("Created")
                .ValueGeneratedOnAdd()
                .HasColumnType("timestamp with time zone")
                .HasDefaultValueSql("now() at time zone 'utc'");

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

                b.Property <int>("LocalityId")
                .HasColumnType("integer");

                b.Property <DateTimeOffset>("Modified")
                .ValueGeneratedOnAdd()
                .HasColumnType("timestamp with time zone")
                .HasDefaultValueSql("now() at time zone 'utc'");

                b.Property <MultiLanguage <string> >("Names")
                .IsRequired()
                .HasColumnType("jsonb");

                b.Property <string>("SupplierLocalityZoneCodes")
                .HasColumnType("jsonb");

                b.HasKey("Id");

                b.HasIndex("LocalityId");

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

            modelBuilder.Entity("HappyTravel.Nakijin.Data.Models.Mappers.RawAccommodation", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <JsonDocument>("Accommodation")
                .IsRequired()
                .HasColumnType("jsonb");

                b.Property <string>("CountryCode")
                .IsRequired()
                .HasColumnType("text");

                b.Property <MultiLanguage <string> >("CountryNames")
                .IsRequired()
                .HasColumnType("jsonb");

                b.Property <DateTimeOffset>("Created")
                .ValueGeneratedOnAdd()
                .HasColumnType("timestamp with time zone")
                .HasDefaultValueSql("now() at time zone 'utc'");

                b.Property <MultiLanguage <string> >("LocalityNames")
                .HasColumnType("jsonb");

                b.Property <MultiLanguage <string> >("LocalityZoneNames")
                .HasColumnType("jsonb");

                b.Property <DateTimeOffset>("Modified")
                .ValueGeneratedOnAdd()
                .HasColumnType("timestamp with time zone")
                .HasDefaultValueSql("now() at time zone 'utc'");

                b.Property <int>("Supplier")
                .HasColumnType("integer");

                b.Property <string>("SupplierAccommodationId")
                .IsRequired()
                .HasColumnType("text");

                b.Property <string>("SupplierLocalityCode")
                .HasColumnType("text");

                b.Property <string>("SupplierLocalityZoneCode")
                .HasColumnType("text");

                b.Property <string>("SupplierNameCode")
                .HasColumnType("text");

                b.HasKey("Id");

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

            modelBuilder.Entity("HappyTravel.Nakijin.Data.Models.ProjectionForGroupedAccommodations", b =>
            {
                b.Property <string>("SupplierCode")
                .HasColumnType("text");

                b.ToTable("ProjectionForGroupedAccommodations", null, t => t.ExcludeFromMigrations());
            });

            modelBuilder.Entity("HappyTravel.Nakijin.Data.Models.ProjectionForSupplierLocality", b =>
            {
                b.Property <MultiLanguage <string> >("LocalityNames")
                .HasColumnType("jsonb");

                b.Property <int>("Supplier")
                .HasColumnType("integer");

                b.ToTable("ProjectionForSupplierLocalities", null, t => t.ExcludeFromMigrations());
            });

            modelBuilder.Entity("HappyTravel.Nakijin.Data.Models.StaticData", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <int>("Type")
                .HasColumnType("integer");

                b.Property <JsonDocument>("Value")
                .HasColumnType("jsonb");

                b.HasKey("Id");

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

            modelBuilder.Entity("HappyTravel.Nakijin.Data.Models.Accommodations.RichAccommodationDetails", b =>
            {
                b.HasOne("HappyTravel.Nakijin.Data.Models.Country", "Country")
                .WithMany("Accommodations")
                .HasForeignKey("CountryId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();

                b.HasOne("HappyTravel.Nakijin.Data.Models.Localities.Locality", "Locality")
                .WithMany("Accommodations")
                .HasForeignKey("LocalityId")
                .OnDelete(DeleteBehavior.Restrict);

                b.HasOne("HappyTravel.Nakijin.Data.Models.LocalityZone", "LocalityZone")
                .WithMany("Accommodations")
                .HasForeignKey("LocalityZoneId")
                .OnDelete(DeleteBehavior.Restrict);

                b.Navigation("Country");

                b.Navigation("Locality");

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

            modelBuilder.Entity("HappyTravel.Nakijin.Data.Models.AccommodationUncertainMatches", b =>
            {
                b.HasOne("HappyTravel.Nakijin.Data.Models.Accommodations.RichAccommodationDetails", "AccommodationToMatch")
                .WithMany("AccommodationToMatchUncertainMatches")
                .HasForeignKey("HtIdToMerge")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();

                b.HasOne("HappyTravel.Nakijin.Data.Models.Accommodations.RichAccommodationDetails", "SourceAccommodation")
                .WithMany("SourceAccommodationUncertainMatches")
                .HasForeignKey("SourceHtId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();

                b.Navigation("AccommodationToMatch");

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

            modelBuilder.Entity("HappyTravel.Nakijin.Data.Models.HtAccommodationMapping", b =>
            {
                b.HasOne("HappyTravel.Nakijin.Data.Models.Accommodations.RichAccommodationDetails", "Accommodation")
                .WithMany("HtAccommodationMappings")
                .HasForeignKey("HtId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();

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

            modelBuilder.Entity("HappyTravel.Nakijin.Data.Models.Localities.Locality", b =>
            {
                b.HasOne("HappyTravel.Nakijin.Data.Models.Country", "Country")
                .WithMany("Localities")
                .HasForeignKey("CountryId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();

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

            modelBuilder.Entity("HappyTravel.Nakijin.Data.Models.Localities.LocalityCandidate", b =>
            {
                b.HasOne("HappyTravel.Nakijin.Data.Models.Country", "Country")
                .WithMany("LocalityCandidates")
                .HasForeignKey("CountryId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();

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

            modelBuilder.Entity("HappyTravel.Nakijin.Data.Models.Localities.LocalitySynonym", b =>
            {
                b.HasOne("HappyTravel.Nakijin.Data.Models.Localities.Locality", "Locality")
                .WithMany("LocalitySynonyms")
                .HasForeignKey("LocalityId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();

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

            modelBuilder.Entity("HappyTravel.Nakijin.Data.Models.LocalityZone", b =>
            {
                b.HasOne("HappyTravel.Nakijin.Data.Models.Localities.Locality", "Locality")
                .WithMany("LocalityZones")
                .HasForeignKey("LocalityId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();

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

            modelBuilder.Entity("HappyTravel.Nakijin.Data.Models.Accommodations.RichAccommodationDetails", b =>
            {
                b.Navigation("AccommodationToMatchUncertainMatches");

                b.Navigation("HtAccommodationMappings");

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

            modelBuilder.Entity("HappyTravel.Nakijin.Data.Models.Country", b =>
            {
                b.Navigation("Accommodations");

                b.Navigation("Localities");

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

            modelBuilder.Entity("HappyTravel.Nakijin.Data.Models.Localities.Locality", b =>
            {
                b.Navigation("Accommodations");

                b.Navigation("LocalitySynonyms");

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

            modelBuilder.Entity("HappyTravel.Nakijin.Data.Models.LocalityZone", b =>
            {
                b.Navigation("Accommodations");
            });
#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", 63);

            NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "uuid-ossp");
            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("Alloy.Api.Data.Models.EventEntity", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid")
                .HasColumnName("id")
                .HasDefaultValueSql("uuid_generate_v4()");

                b.Property <Guid>("CreatedBy")
                .HasColumnType("uuid")
                .HasColumnName("created_by");

                b.Property <DateTime>("DateCreated")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("date_created");

                b.Property <DateTime?>("DateModified")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("date_modified");

                b.Property <string>("Description")
                .HasColumnType("text")
                .HasColumnName("description");

                b.Property <DateTime?>("EndDate")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("end_date");

                b.Property <Guid?>("EventTemplateId")
                .HasColumnType("uuid")
                .HasColumnName("event_template_id");

                b.Property <DateTime?>("ExpirationDate")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("expiration_date");

                b.Property <int>("FailureCount")
                .HasColumnType("integer")
                .HasColumnName("failure_count");

                b.Property <int>("InternalStatus")
                .HasColumnType("integer")
                .HasColumnName("internal_status");

                b.Property <int>("LastEndInternalStatus")
                .HasColumnType("integer")
                .HasColumnName("last_end_internal_status");

                b.Property <int>("LastEndStatus")
                .HasColumnType("integer")
                .HasColumnName("last_end_status");

                b.Property <int>("LastLaunchInternalStatus")
                .HasColumnType("integer")
                .HasColumnName("last_launch_internal_status");

                b.Property <int>("LastLaunchStatus")
                .HasColumnType("integer")
                .HasColumnName("last_launch_status");

                b.Property <DateTime?>("LaunchDate")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("launch_date");

                b.Property <Guid?>("ModifiedBy")
                .HasColumnType("uuid")
                .HasColumnName("modified_by");

                b.Property <string>("Name")
                .HasColumnType("text")
                .HasColumnName("name");

                b.Property <Guid?>("RunId")
                .HasColumnType("uuid")
                .HasColumnName("run_id");

                b.Property <Guid?>("ScenarioId")
                .HasColumnType("uuid")
                .HasColumnName("scenario_id");

                b.Property <string>("ShareCode")
                .HasColumnType("text")
                .HasColumnName("share_code");

                b.Property <int>("Status")
                .HasColumnType("integer")
                .HasColumnName("status");

                b.Property <DateTime>("StatusDate")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("status_date");

                b.Property <Guid>("UserId")
                .HasColumnType("uuid")
                .HasColumnName("user_id");

                b.Property <string>("Username")
                .HasColumnType("text")
                .HasColumnName("username");

                b.Property <Guid?>("ViewId")
                .HasColumnType("uuid")
                .HasColumnName("view_id");

                b.Property <Guid?>("WorkspaceId")
                .HasColumnType("uuid")
                .HasColumnName("workspace_id");

                b.HasKey("Id");

                b.HasIndex("EventTemplateId");

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

            modelBuilder.Entity("Alloy.Api.Data.Models.EventTemplateEntity", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid")
                .HasColumnName("id")
                .HasDefaultValueSql("uuid_generate_v4()");

                b.Property <Guid>("CreatedBy")
                .HasColumnType("uuid")
                .HasColumnName("created_by");

                b.Property <DateTime>("DateCreated")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("date_created");

                b.Property <DateTime?>("DateModified")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("date_modified");

                b.Property <string>("Description")
                .HasColumnType("text")
                .HasColumnName("description");

                b.Property <Guid?>("DirectoryId")
                .HasColumnType("uuid")
                .HasColumnName("directory_id");

                b.Property <int>("DurationHours")
                .HasColumnType("integer")
                .HasColumnName("duration_hours");

                b.Property <bool>("IsPublished")
                .HasColumnType("boolean")
                .HasColumnName("is_published");

                b.Property <Guid?>("ModifiedBy")
                .HasColumnType("uuid")
                .HasColumnName("modified_by");

                b.Property <string>("Name")
                .HasColumnType("text")
                .HasColumnName("name");

                b.Property <Guid?>("ScenarioTemplateId")
                .HasColumnType("uuid")
                .HasColumnName("scenario_template_id");

                b.Property <bool>("UseDynamicHost")
                .HasColumnType("boolean")
                .HasColumnName("use_dynamic_host");

                b.Property <Guid?>("ViewId")
                .HasColumnType("uuid")
                .HasColumnName("view_id");

                b.HasKey("Id");

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

            modelBuilder.Entity("Alloy.Api.Data.Models.EventUserEntity", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid")
                .HasColumnName("id")
                .HasDefaultValueSql("uuid_generate_v4()");

                b.Property <Guid>("CreatedBy")
                .HasColumnType("uuid")
                .HasColumnName("created_by");

                b.Property <DateTime>("DateCreated")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("date_created");

                b.Property <DateTime?>("DateModified")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("date_modified");

                b.Property <Guid>("EventId")
                .HasColumnType("uuid")
                .HasColumnName("event_id");

                b.Property <Guid?>("ModifiedBy")
                .HasColumnType("uuid")
                .HasColumnName("modified_by");

                b.Property <Guid>("UserId")
                .HasColumnType("uuid")
                .HasColumnName("user_id");

                b.HasKey("Id");

                b.HasIndex("EventId", "UserId")
                .IsUnique();

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

            modelBuilder.Entity("Alloy.Api.Data.Models.EventEntity", b =>
            {
                b.HasOne("Alloy.Api.Data.Models.EventTemplateEntity", "EventTemplate")
                .WithMany()
                .HasForeignKey("EventTemplateId");

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

            modelBuilder.Entity("Alloy.Api.Data.Models.EventUserEntity", b =>
            {
                b.HasOne("Alloy.Api.Data.Models.EventEntity", "Event")
                .WithMany("EventUsers")
                .HasForeignKey("EventId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Alloy.Api.Data.Models.EventEntity", b =>
            {
                b.Navigation("EventUsers");
            });
#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", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("FileIncident", b =>
            {
                b.Property <int>("FilesId")
                .HasColumnType("integer");

                b.Property <int>("IncidentsId")
                .HasColumnType("integer");

                b.HasKey("FilesId", "IncidentsId");

                b.HasIndex("IncidentsId");

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

            modelBuilder.Entity("FileIncidentMessage", b =>
            {
                b.Property <int>("AttachmentsId")
                .HasColumnType("integer");

                b.Property <int>("IncidentMessagesId")
                .HasColumnType("integer");

                b.HasKey("AttachmentsId", "IncidentMessagesId");

                b.HasIndex("IncidentMessagesId");

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

            modelBuilder.Entity("FileMaintenance", b =>
            {
                b.Property <int>("AttachmentsId")
                .HasColumnType("integer");

                b.Property <int>("MaintenancesId")
                .HasColumnType("integer");

                b.HasKey("AttachmentsId", "MaintenancesId");

                b.HasIndex("MaintenancesId");

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

            modelBuilder.Entity("FileMaintenanceMessage", b =>
            {
                b.Property <int>("AttachmentsId")
                .HasColumnType("integer");

                b.Property <int>("MaintenanceMessagesId")
                .HasColumnType("integer");

                b.HasKey("AttachmentsId", "MaintenanceMessagesId");

                b.HasIndex("MaintenanceMessagesId");

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

            modelBuilder.Entity("MaintenanceService", b =>
            {
                b.Property <int>("MaintenanceId")
                .HasColumnType("integer");

                b.Property <int>("ServicesId")
                .HasColumnType("integer");

                b.HasKey("MaintenanceId", "ServicesId");

                b.HasIndex("ServicesId");

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

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

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Hash")
                .IsRequired()
                .HasColumnType("text");

                b.Property <string>("MimeType")
                .IsRequired()
                .HasColumnType("text");

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

                b.Property <string>("Namespace")
                .IsRequired()
                .HasColumnType("text");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

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

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

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <int>("AuthorId")
                .HasColumnType("integer");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Description")
                .IsRequired()
                .HasColumnType("text");

                b.Property <string>("DescriptionHtml")
                .IsRequired()
                .HasColumnType("text");

                b.Property <DateTime?>("EndedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <int>("ServiceId")
                .HasColumnType("integer");

                b.Property <DateTime>("StartedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Title")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.HasIndex("AuthorId");

                b.HasIndex("ServiceId");

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

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

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <int>("AuthorId")
                .HasColumnType("integer");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <int>("IncidentId")
                .HasColumnType("integer");

                b.Property <string>("Message")
                .IsRequired()
                .HasColumnType("text");

                b.Property <string>("MessageHtml")
                .IsRequired()
                .HasColumnType("text");

                b.Property <int>("StatusId")
                .HasColumnType("integer");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.HasIndex("AuthorId");

                b.HasIndex("IncidentId");

                b.HasIndex("StatusId");

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

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

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <int>("AuthorId")
                .HasColumnType("integer");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Description")
                .IsRequired()
                .HasColumnType("text");

                b.Property <string>("DescriptionHtml")
                .IsRequired()
                .HasColumnType("text");

                b.Property <DateTime?>("EndedAt")
                .IsRequired()
                .HasColumnType("timestamp with time zone");

                b.Property <DateTime>("StartedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Title")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.HasIndex("AuthorId");

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

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

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <int>("AuthorId")
                .HasColumnType("integer");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

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

                b.Property <string>("Message")
                .IsRequired()
                .HasColumnType("text");

                b.Property <string>("MessageHtml")
                .IsRequired()
                .HasColumnType("text");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.HasIndex("AuthorId");

                b.HasIndex("MaintenanceId");

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

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

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <int>("CurrentIncidentId")
                .HasColumnType("integer");

                b.Property <string>("Host")
                .IsRequired()
                .HasColumnType("text");

                b.Property <DateTime>("LastRunTime")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("MonitorCron")
                .IsRequired()
                .HasMaxLength(14)
                .HasColumnType("character varying(14)");

                b.Property <int>("MonitorTypeId")
                .HasColumnType("integer");

                b.Property <DateTime>("NextRunTime")
                .HasColumnType("timestamp with time zone");

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

                b.Property <int>("ServiceId")
                .HasColumnType("integer");

                b.Property <int>("Type")
                .HasColumnType("integer");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <bool?>("ValidateSsl")
                .HasColumnType("boolean");

                b.HasKey("Id");

                b.HasIndex("CurrentIncidentId");

                b.HasIndex("ServiceId");

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

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

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <bool>("Available")
                .HasColumnType("boolean");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("FailureReason")
                .IsRequired()
                .HasColumnType("text");

                b.Property <int>("MonitorId")
                .HasColumnType("integer");

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

                b.Property <bool?>("SslValid")
                .HasColumnType("boolean");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.HasIndex("MonitorId");

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

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

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Description")
                .IsRequired()
                .HasMaxLength(255)
                .HasColumnType("character varying(255)");

                b.Property <int>("GroupId")
                .HasColumnType("integer");

                b.Property <string>("Name")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <int>("ParentId")
                .HasColumnType("integer");

                b.Property <int>("StatusId")
                .HasColumnType("integer");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Url")
                .IsRequired()
                .HasColumnType("text");

                b.HasKey("Id");

                b.HasIndex("GroupId");

                b.HasIndex("ParentId");

                b.HasIndex("StatusId");

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

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

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Description")
                .IsRequired()
                .HasMaxLength(255)
                .HasColumnType("character varying(255)");

                b.Property <string>("Name")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <int>("_DefaultOpen")
                .HasColumnType("integer")
                .HasColumnName("DefaultOpen");

                b.HasKey("Id");

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

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

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

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

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Value")
                .IsRequired()
                .HasColumnType("text");

                b.HasKey("Id");

                b.HasIndex("Key");

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

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

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <string>("Color")
                .IsRequired()
                .HasMaxLength(25)
                .HasColumnType("character varying(25)");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Description")
                .IsRequired()
                .HasColumnType("text");

                b.Property <string>("Name")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

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

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

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Email")
                .IsRequired()
                .HasMaxLength(256)
                .HasColumnType("character varying(256)");

                b.Property <bool>("IsVerified")
                .HasColumnType("boolean");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("VerificationString")
                .IsRequired()
                .HasColumnType("text");

                b.HasKey("Id");

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

            modelBuilder.Entity("Staat.Data.Models.Users.User", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Email")
                .IsRequired()
                .HasColumnType("text");

                b.Property <string>("FirstName")
                .IsRequired()
                .HasColumnType("text");

                b.Property <string>("LastName")
                .IsRequired()
                .HasColumnType("text");

                b.Property <byte[]>("PasswordHash")
                .IsRequired()
                .HasColumnType("bytea");

                b.Property <byte[]>("PasswordSalt")
                .IsRequired()
                .HasColumnType("bytea");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

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

            modelBuilder.Entity("FileIncident", b =>
            {
                b.HasOne("Staat.Data.Models.File", null)
                .WithMany()
                .HasForeignKey("FilesId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Staat.Data.Models.Incident", null)
                .WithMany()
                .HasForeignKey("IncidentsId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("FileIncidentMessage", b =>
            {
                b.HasOne("Staat.Data.Models.File", null)
                .WithMany()
                .HasForeignKey("AttachmentsId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Staat.Data.Models.IncidentMessage", null)
                .WithMany()
                .HasForeignKey("IncidentMessagesId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("FileMaintenance", b =>
            {
                b.HasOne("Staat.Data.Models.File", null)
                .WithMany()
                .HasForeignKey("AttachmentsId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Staat.Data.Models.Maintenance", null)
                .WithMany()
                .HasForeignKey("MaintenancesId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("FileMaintenanceMessage", b =>
            {
                b.HasOne("Staat.Data.Models.File", null)
                .WithMany()
                .HasForeignKey("AttachmentsId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Staat.Data.Models.MaintenanceMessage", null)
                .WithMany()
                .HasForeignKey("MaintenanceMessagesId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("MaintenanceService", b =>
            {
                b.HasOne("Staat.Data.Models.Maintenance", null)
                .WithMany()
                .HasForeignKey("MaintenanceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Staat.Data.Models.Service", null)
                .WithMany()
                .HasForeignKey("ServicesId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Staat.Data.Models.Incident", b =>
            {
                b.HasOne("Staat.Data.Models.Users.User", "Author")
                .WithMany()
                .HasForeignKey("AuthorId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Staat.Data.Models.Service", "Service")
                .WithMany("Incidents")
                .HasForeignKey("ServiceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Author");

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

            modelBuilder.Entity("Staat.Data.Models.IncidentMessage", b =>
            {
                b.HasOne("Staat.Data.Models.Users.User", "Author")
                .WithMany()
                .HasForeignKey("AuthorId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Staat.Data.Models.Incident", "Incident")
                .WithMany("Messages")
                .HasForeignKey("IncidentId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Staat.Data.Models.Status", "Status")
                .WithMany()
                .HasForeignKey("StatusId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Author");

                b.Navigation("Incident");

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

            modelBuilder.Entity("Staat.Data.Models.Maintenance", b =>
            {
                b.HasOne("Staat.Data.Models.Users.User", "Author")
                .WithMany()
                .HasForeignKey("AuthorId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Staat.Data.Models.MaintenanceMessage", b =>
            {
                b.HasOne("Staat.Data.Models.Users.User", "Author")
                .WithMany()
                .HasForeignKey("AuthorId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Staat.Data.Models.Maintenance", null)
                .WithMany("Messages")
                .HasForeignKey("MaintenanceId");

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

            modelBuilder.Entity("Staat.Data.Models.Monitor", b =>
            {
                b.HasOne("Staat.Data.Models.Incident", "CurrentIncident")
                .WithMany()
                .HasForeignKey("CurrentIncidentId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Staat.Data.Models.Service", "Service")
                .WithMany("Monitors")
                .HasForeignKey("ServiceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("CurrentIncident");

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

            modelBuilder.Entity("Staat.Data.Models.MonitorData", b =>
            {
                b.HasOne("Staat.Data.Models.Monitor", "Monitor")
                .WithMany("MonitorData")
                .HasForeignKey("MonitorId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Staat.Data.Models.Service", b =>
            {
                b.HasOne("Staat.Data.Models.ServiceGroup", "Group")
                .WithMany("Services")
                .HasForeignKey("GroupId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Staat.Data.Models.Service", "Parent")
                .WithMany("Children")
                .HasForeignKey("ParentId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Staat.Data.Models.Status", "Status")
                .WithMany()
                .HasForeignKey("StatusId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Group");

                b.Navigation("Parent");

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

            modelBuilder.Entity("Staat.Data.Models.Incident", b =>
            {
                b.Navigation("Messages");
            });

            modelBuilder.Entity("Staat.Data.Models.Maintenance", b =>
            {
                b.Navigation("Messages");
            });

            modelBuilder.Entity("Staat.Data.Models.Monitor", b =>
            {
                b.Navigation("MonitorData");
            });

            modelBuilder.Entity("Staat.Data.Models.Service", b =>
            {
                b.Navigation("Children");

                b.Navigation("Incidents");

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

            modelBuilder.Entity("Staat.Data.Models.ServiceGroup", b =>
            {
                b.Navigation("Services");
            });
#pragma warning restore 612, 618
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.0-rc.2.21480.5")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("AccountRole", b =>
            {
                b.Property <Guid>("AccountsId")
                .HasColumnType("uuid");

                b.Property <Guid>("RolesId")
                .HasColumnType("uuid");

                b.HasKey("AccountsId", "RolesId");

                b.HasIndex("RolesId");

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

            modelBuilder.Entity("Entity.Account", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <string>("Avatar")
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <DateTimeOffset>("CreatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Email")
                .HasMaxLength(120)
                .HasColumnType("character varying(120)");

                b.Property <bool>("EmailConfirm")
                .HasColumnType("boolean");

                b.Property <Guid?>("ExtendId")
                .HasColumnType("uuid");

                b.Property <string>("HashSalt")
                .HasMaxLength(40)
                .HasColumnType("character varying(40)");

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

                b.Property <DateTimeOffset?>("LastLoginTime")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Password")
                .HasMaxLength(60)
                .HasColumnType("character varying(60)");

                b.Property <string>("Phone")
                .HasMaxLength(16)
                .HasColumnType("character varying(16)");

                b.Property <bool>("PhoneConfirm")
                .HasColumnType("boolean");

                b.Property <int>("RetryCount")
                .HasColumnType("integer");

                b.Property <int>("Status")
                .HasColumnType("integer");

                b.Property <DateTimeOffset>("UpdatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Username")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.HasKey("Id");

                b.HasIndex("CreatedTime");

                b.HasIndex("Email");

                b.HasIndex("EmailConfirm");

                b.HasIndex("ExtendId");

                b.HasIndex("IsDeleted");

                b.HasIndex("Phone");

                b.HasIndex("PhoneConfirm");

                b.HasIndex("Username");

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

            modelBuilder.Entity("Entity.AccountExtend", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <string>("Address")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <string>("AddressDetail")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.Property <DateTimeOffset?>("Birthday")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("City")
                .HasMaxLength(20)
                .HasColumnType("character varying(20)");

                b.Property <string>("Country")
                .HasMaxLength(20)
                .HasColumnType("character varying(20)");

                b.Property <string>("County")
                .HasMaxLength(20)
                .HasColumnType("character varying(20)");

                b.Property <DateTimeOffset>("CreatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("NickName")
                .HasMaxLength(40)
                .HasColumnType("character varying(40)");

                b.Property <string>("Province")
                .HasMaxLength(20)
                .HasColumnType("character varying(20)");

                b.Property <string>("RealName")
                .HasMaxLength(40)
                .HasColumnType("character varying(40)");

                b.Property <int>("Status")
                .HasColumnType("integer");

                b.Property <string>("Street")
                .HasMaxLength(20)
                .HasColumnType("character varying(20)");

                b.Property <DateTimeOffset>("UpdatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("WXAvatar")
                .HasMaxLength(150)
                .HasColumnType("character varying(150)");

                b.Property <string>("WXOpenId")
                .HasMaxLength(40)
                .HasColumnType("character varying(40)");

                b.Property <string>("WXUnionId")
                .HasMaxLength(40)
                .HasColumnType("character varying(40)");

                b.HasKey("Id");

                b.HasIndex("City");

                b.HasIndex("Country");

                b.HasIndex("Province");

                b.HasIndex("RealName");

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

            modelBuilder.Entity("Entity.Article", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <Guid>("AccountId")
                .HasColumnType("uuid");

                b.Property <int>("ArticleType")
                .HasColumnType("integer");

                b.Property <string>("AuthorName")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <Guid?>("CatalogId")
                .HasColumnType("uuid");

                b.Property <DateTimeOffset>("CreatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <Guid?>("ExtendId")
                .HasColumnType("uuid");

                b.Property <bool?>("IsPrivate")
                .HasColumnType("boolean");

                b.Property <int>("Status")
                .HasColumnType("integer");

                b.Property <string>("Summary")
                .HasMaxLength(500)
                .HasColumnType("character varying(500)");

                b.Property <string>("Tags")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <string>("Title")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <DateTimeOffset>("UpdatedTime")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.HasIndex("AccountId");

                b.HasIndex("ArticleType");

                b.HasIndex("CatalogId");

                b.HasIndex("CreatedTime");

                b.HasIndex("ExtendId");

                b.HasIndex("Title");

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

            modelBuilder.Entity("Entity.ArticleCatalog", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <Guid>("AccountId")
                .HasColumnType("uuid");

                b.Property <DateTimeOffset>("CreatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <short>("Level")
                .HasColumnType("smallint");

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

                b.Property <Guid?>("ParentId")
                .HasColumnType("uuid");

                b.Property <short>("Sort")
                .HasColumnType("smallint");

                b.Property <int>("Status")
                .HasColumnType("integer");

                b.Property <string>("Type")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.Property <DateTimeOffset>("UpdatedTime")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.HasIndex("AccountId");

                b.HasIndex("Level");

                b.HasIndex("Name");

                b.HasIndex("ParentId");

                b.HasIndex("Sort");

                b.HasIndex("Type");

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

            modelBuilder.Entity("Entity.ArticleExtend", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

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

                b.Property <DateTimeOffset>("CreatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <int>("Status")
                .HasColumnType("integer");

                b.Property <DateTimeOffset>("UpdatedTime")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

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

            modelBuilder.Entity("Entity.CodeSnippet", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <int>("CodeType")
                .HasColumnType("integer");

                b.Property <string>("Content")
                .HasMaxLength(4000)
                .HasColumnType("character varying(4000)");

                b.Property <DateTimeOffset>("CreatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Description")
                .HasMaxLength(500)
                .HasColumnType("character varying(500)");

                b.Property <int>("Language")
                .HasColumnType("integer");

                b.Property <Guid?>("LibraryId")
                .HasColumnType("uuid");

                b.Property <string>("Name")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <int>("Status")
                .HasColumnType("integer");

                b.Property <DateTimeOffset>("UpdatedTime")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.HasIndex("CodeType");

                b.HasIndex("CreatedTime");

                b.HasIndex("Language");

                b.HasIndex("LibraryId");

                b.HasIndex("Name");

                b.HasIndex("Status");

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

            modelBuilder.Entity("Entity.Comment", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <Guid?>("AccountId")
                .HasColumnType("uuid");

                b.Property <Guid?>("ArticleId")
                .HasColumnType("uuid");

                b.Property <string>("Content")
                .HasMaxLength(2000)
                .HasColumnType("character varying(2000)");

                b.Property <DateTimeOffset>("CreatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <int>("Status")
                .HasColumnType("integer");

                b.Property <DateTimeOffset>("UpdatedTime")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.HasIndex("AccountId");

                b.HasIndex("ArticleId");

                b.HasIndex("CreatedTime");

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

            modelBuilder.Entity("Entity.Library", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <Guid?>("CatalogId")
                .HasColumnType("uuid");

                b.Property <DateTimeOffset>("CreatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Description")
                .HasMaxLength(500)
                .HasColumnType("character varying(500)");

                b.Property <bool>("IsPublic")
                .HasColumnType("boolean");

                b.Property <bool>("IsValid")
                .HasColumnType("boolean");

                b.Property <string>("Language")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <string>("Namespace")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <int>("Status")
                .HasColumnType("integer");

                b.Property <DateTimeOffset>("UpdatedTime")
                .HasColumnType("timestamp with time zone");

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

                b.HasKey("Id");

                b.HasIndex("CatalogId");

                b.HasIndex("CreatedTime");

                b.HasIndex("IsPublic");

                b.HasIndex("IsValid");

                b.HasIndex("Language");

                b.HasIndex("Namespace");

                b.HasIndex("UserId");

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

            modelBuilder.Entity("Entity.LibraryCatalog", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <Guid>("AccountId")
                .HasColumnType("uuid");

                b.Property <DateTimeOffset>("CreatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <short>("Level")
                .HasColumnType("smallint");

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

                b.Property <Guid?>("ParentId")
                .HasColumnType("uuid");

                b.Property <short>("Sort")
                .HasColumnType("smallint");

                b.Property <int>("Status")
                .HasColumnType("integer");

                b.Property <string>("Type")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.Property <DateTimeOffset>("UpdatedTime")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.HasIndex("AccountId");

                b.HasIndex("Level");

                b.HasIndex("Name");

                b.HasIndex("ParentId");

                b.HasIndex("Sort");

                b.HasIndex("Type");

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

            modelBuilder.Entity("Entity.Role", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <DateTimeOffset>("CreatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Icon")
                .HasMaxLength(30)
                .HasColumnType("character varying(30)");

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

                b.Property <int>("Status")
                .HasColumnType("integer");

                b.Property <DateTimeOffset>("UpdatedTime")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.HasIndex("Name");

                b.HasIndex("Status");

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

            modelBuilder.Entity("Entity.ThirdNews", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <string>("AuthorAvatar")
                .HasMaxLength(300)
                .HasColumnType("character varying(300)");

                b.Property <string>("AuthorName")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <string>("Category")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.Property <string>("Content")
                .HasMaxLength(8000)
                .HasColumnType("character varying(8000)");

                b.Property <DateTimeOffset>("CreatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <DateTimeOffset?>("DatePublished")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Description")
                .HasMaxLength(5000)
                .HasColumnType("character varying(5000)");

                b.Property <string>("IdentityId")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.Property <int>("NewsType")
                .HasColumnType("integer");

                b.Property <string>("Provider")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.Property <int>("Status")
                .HasColumnType("integer");

                b.Property <string>("ThumbnailUrl")
                .HasMaxLength(300)
                .HasColumnType("character varying(300)");

                b.Property <string>("Title")
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <int>("Type")
                .HasColumnType("integer");

                b.Property <DateTimeOffset>("UpdatedTime")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Url")
                .HasMaxLength(300)
                .HasColumnType("character varying(300)");

                b.HasKey("Id");

                b.HasIndex("Category");

                b.HasIndex("DatePublished");

                b.HasIndex("IdentityId");

                b.HasIndex("NewsType");

                b.HasIndex("Provider");

                b.HasIndex("Title");

                b.HasIndex("Type");

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

            modelBuilder.Entity("AccountRole", b =>
            {
                b.HasOne("Entity.Account", null)
                .WithMany()
                .HasForeignKey("AccountsId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Entity.Role", null)
                .WithMany()
                .HasForeignKey("RolesId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Entity.Account", b =>
            {
                b.HasOne("Entity.AccountExtend", "Extend")
                .WithMany()
                .HasForeignKey("ExtendId");

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

            modelBuilder.Entity("Entity.Article", b =>
            {
                b.HasOne("Entity.Account", "Account")
                .WithMany("Articles")
                .HasForeignKey("AccountId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Entity.ArticleCatalog", "Catalog")
                .WithMany("Articles")
                .HasForeignKey("CatalogId");

                b.HasOne("Entity.ArticleExtend", "Extend")
                .WithMany()
                .HasForeignKey("ExtendId");

                b.Navigation("Account");

                b.Navigation("Catalog");

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

            modelBuilder.Entity("Entity.ArticleCatalog", b =>
            {
                b.HasOne("Entity.Account", "Account")
                .WithMany("ArticleCatalogs")
                .HasForeignKey("AccountId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Entity.ArticleCatalog", "Parent")
                .WithMany("Catalogs")
                .HasForeignKey("ParentId");

                b.Navigation("Account");

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

            modelBuilder.Entity("Entity.CodeSnippet", b =>
            {
                b.HasOne("Entity.Library", "Library")
                .WithMany("Snippets")
                .HasForeignKey("LibraryId");

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

            modelBuilder.Entity("Entity.Comment", b =>
            {
                b.HasOne("Entity.Account", "Account")
                .WithMany("Comments")
                .HasForeignKey("AccountId");

                b.HasOne("Entity.Article", "Article")
                .WithMany("Comments")
                .HasForeignKey("ArticleId");

                b.Navigation("Account");

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

            modelBuilder.Entity("Entity.Library", b =>
            {
                b.HasOne("Entity.LibraryCatalog", "Catalog")
                .WithMany()
                .HasForeignKey("CatalogId");

                b.HasOne("Entity.Account", "User")
                .WithMany()
                .HasForeignKey("UserId");

                b.Navigation("Catalog");

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

            modelBuilder.Entity("Entity.LibraryCatalog", b =>
            {
                b.HasOne("Entity.Account", "Account")
                .WithMany()
                .HasForeignKey("AccountId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Entity.LibraryCatalog", "Parent")
                .WithMany("Catalogs")
                .HasForeignKey("ParentId");

                b.Navigation("Account");

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

            modelBuilder.Entity("Entity.Account", b =>
            {
                b.Navigation("ArticleCatalogs");

                b.Navigation("Articles");

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

            modelBuilder.Entity("Entity.Article", b =>
            {
                b.Navigation("Comments");
            });

            modelBuilder.Entity("Entity.ArticleCatalog", b =>
            {
                b.Navigation("Articles");

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

            modelBuilder.Entity("Entity.Library", b =>
            {
                b.Navigation("Snippets");
            });

            modelBuilder.Entity("Entity.LibraryCatalog", b =>
            {
                b.Navigation("Catalogs");
            });
#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", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("Content.Server.Database.Admin", b =>
            {
                b.Property <Guid>("UserId")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid")
                .HasColumnName("user_id");

                b.Property <int?>("AdminRankId")
                .HasColumnType("integer")
                .HasColumnName("admin_rank_id");

                b.Property <string>("Title")
                .HasColumnType("text")
                .HasColumnName("title");

                b.HasKey("UserId")
                .HasName("PK_admin");

                b.HasIndex("AdminRankId")
                .HasDatabaseName("IX_admin_admin_rank_id");

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

            modelBuilder.Entity("Content.Server.Database.AdminFlag", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasColumnName("admin_flag_id");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <Guid>("AdminId")
                .HasColumnType("uuid")
                .HasColumnName("admin_id");

                b.Property <string>("Flag")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("flag");

                b.Property <bool>("Negative")
                .HasColumnType("boolean")
                .HasColumnName("negative");

                b.HasKey("Id")
                .HasName("PK_admin_flag");

                b.HasIndex("AdminId")
                .HasDatabaseName("IX_admin_flag_admin_id");

                b.HasIndex("Flag", "AdminId")
                .IsUnique();

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

            modelBuilder.Entity("Content.Server.Database.AdminLog", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasColumnName("admin_log_id");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <int>("RoundId")
                .HasColumnType("integer")
                .HasColumnName("round_id");

                b.Property <DateTime>("Date")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("date");

                b.Property <JsonDocument>("Json")
                .IsRequired()
                .HasColumnType("jsonb")
                .HasColumnName("json");

                b.Property <string>("Message")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("message");

                b.Property <int>("Type")
                .HasColumnType("integer")
                .HasColumnName("type");

                b.HasKey("Id", "RoundId")
                .HasName("PK_admin_log");

                b.HasIndex("RoundId")
                .HasDatabaseName("IX_admin_log_round_id");

                b.HasIndex("Type")
                .HasDatabaseName("IX_admin_log_type");

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

            modelBuilder.Entity("Content.Server.Database.AdminLogEntity", b =>
            {
                b.Property <int>("Uid")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasColumnName("uid");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Uid"));

                b.Property <int?>("AdminLogId")
                .HasColumnType("integer")
                .HasColumnName("admin_log_id");

                b.Property <int?>("AdminLogRoundId")
                .HasColumnType("integer")
                .HasColumnName("admin_log_round_id");

                b.Property <string>("Name")
                .HasColumnType("text")
                .HasColumnName("name");

                b.HasKey("Uid")
                .HasName("PK_admin_log_entity");

                b.HasIndex("AdminLogId", "AdminLogRoundId")
                .HasDatabaseName("IX_admin_log_entity_admin_log_id_admin_log_round_id");

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

            modelBuilder.Entity("Content.Server.Database.AdminLogPlayer", b =>
            {
                b.Property <Guid>("PlayerUserId")
                .HasColumnType("uuid")
                .HasColumnName("player_user_id");

                b.Property <int>("LogId")
                .HasColumnType("integer")
                .HasColumnName("log_id");

                b.Property <int>("RoundId")
                .HasColumnType("integer")
                .HasColumnName("round_id");

                b.HasKey("PlayerUserId", "LogId", "RoundId")
                .HasName("PK_admin_log_player");

                b.HasIndex("LogId", "RoundId");

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

            modelBuilder.Entity("Content.Server.Database.AdminRank", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasColumnName("admin_rank_id");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <string>("Name")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("name");

                b.HasKey("Id")
                .HasName("PK_admin_rank");

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

            modelBuilder.Entity("Content.Server.Database.AdminRankFlag", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasColumnName("admin_rank_flag_id");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <int>("AdminRankId")
                .HasColumnType("integer")
                .HasColumnName("admin_rank_id");

                b.Property <string>("Flag")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("flag");

                b.HasKey("Id")
                .HasName("PK_admin_rank_flag");

                b.HasIndex("AdminRankId")
                .HasDatabaseName("IX_admin_rank_flag_admin_rank_id");

                b.HasIndex("Flag", "AdminRankId")
                .IsUnique();

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

            modelBuilder.Entity("Content.Server.Database.Antag", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasColumnName("antag_id");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <string>("AntagName")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("antag_name");

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

                b.HasKey("Id")
                .HasName("PK_antag");

                b.HasIndex("ProfileId", "AntagName")
                .IsUnique();

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

            modelBuilder.Entity("Content.Server.Database.AssignedUserId", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasColumnName("assigned_user_id_id");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <Guid>("UserId")
                .HasColumnType("uuid")
                .HasColumnName("user_id");

                b.Property <string>("UserName")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("user_name");

                b.HasKey("Id")
                .HasName("PK_assigned_user_id");

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

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

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

            modelBuilder.Entity("Content.Server.Database.Job", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasColumnName("job_id");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <string>("JobName")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("job_name");

                b.Property <int>("Priority")
                .HasColumnType("integer")
                .HasColumnName("priority");

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

                b.HasKey("Id")
                .HasName("PK_job");

                b.HasIndex("ProfileId")
                .HasDatabaseName("IX_job_profile_id");

                b.HasIndex("ProfileId", "JobName")
                .IsUnique();

                b.HasIndex(new[] { "ProfileId" }, "IX_job_one_high_priority")
                .IsUnique()
                .HasFilter("priority = 3");

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

            modelBuilder.Entity("Content.Server.Database.Player", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasColumnName("player_id");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <DateTime>("FirstSeenTime")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("first_seen_time");

                b.Property <IPAddress>("LastSeenAddress")
                .IsRequired()
                .HasColumnType("inet")
                .HasColumnName("last_seen_address");

                b.Property <byte[]>("LastSeenHWId")
                .HasColumnType("bytea")
                .HasColumnName("last_seen_hwid");

                b.Property <DateTime>("LastSeenTime")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("last_seen_time");

                b.Property <string>("LastSeenUserName")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("last_seen_user_name");

                b.Property <Guid>("UserId")
                .HasColumnType("uuid")
                .HasColumnName("user_id");

                b.HasKey("Id")
                .HasName("PK_player");

                b.HasAlternateKey("UserId")
                .HasName("ak_player_user_id");

                b.HasIndex("LastSeenUserName");

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

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

                b.HasCheckConstraint("LastSeenAddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= last_seen_address");
            });

            modelBuilder.Entity("Content.Server.Database.PostgresConnectionLog", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasColumnName("connection_log_id");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <IPAddress>("Address")
                .IsRequired()
                .HasColumnType("inet")
                .HasColumnName("address");

                b.Property <byte[]>("HWId")
                .HasColumnType("bytea")
                .HasColumnName("hwid");

                b.Property <DateTime>("Time")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("time");

                b.Property <Guid>("UserId")
                .HasColumnType("uuid")
                .HasColumnName("user_id");

                b.Property <string>("UserName")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("user_name");

                b.HasKey("Id")
                .HasName("PK_connection_log");

                b.HasIndex("UserId");

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

                b.HasCheckConstraint("AddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= address");
            });

            modelBuilder.Entity("Content.Server.Database.PostgresServerBan", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasColumnName("server_ban_id");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <ValueTuple <IPAddress, int>?>("Address")
                .HasColumnType("inet")
                .HasColumnName("address");

                b.Property <DateTime>("BanTime")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("ban_time");

                b.Property <Guid?>("BanningAdmin")
                .HasColumnType("uuid")
                .HasColumnName("banning_admin");

                b.Property <DateTime?>("ExpirationTime")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("expiration_time");

                b.Property <byte[]>("HWId")
                .HasColumnType("bytea")
                .HasColumnName("hwid");

                b.Property <string>("Reason")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("reason");

                b.Property <Guid?>("UserId")
                .HasColumnType("uuid")
                .HasColumnName("user_id");

                b.HasKey("Id")
                .HasName("PK_server_ban");

                b.HasIndex("Address");

                b.HasIndex("UserId");

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

                b.HasCheckConstraint("AddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= address");

                b.HasCheckConstraint("HaveEitherAddressOrUserIdOrHWId", "address IS NOT NULL OR user_id IS NOT NULL OR hwid IS NOT NULL");
            });

            modelBuilder.Entity("Content.Server.Database.PostgresServerUnban", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasColumnName("unban_id");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <int>("BanId")
                .HasColumnType("integer")
                .HasColumnName("ban_id");

                b.Property <DateTime>("UnbanTime")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("unban_time");

                b.Property <Guid?>("UnbanningAdmin")
                .HasColumnType("uuid")
                .HasColumnName("unbanning_admin");

                b.HasKey("Id")
                .HasName("PK_server_unban");

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

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

            modelBuilder.Entity("Content.Server.Database.Preference", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasColumnName("preference_id");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <string>("AdminOOCColor")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("admin_ooc_color");

                b.Property <int>("SelectedCharacterSlot")
                .HasColumnType("integer")
                .HasColumnName("selected_character_slot");

                b.Property <Guid>("UserId")
                .HasColumnType("uuid")
                .HasColumnName("user_id");

                b.HasKey("Id")
                .HasName("PK_preference");

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

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

            modelBuilder.Entity("Content.Server.Database.Profile", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasColumnName("profile_id");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <int>("Age")
                .HasColumnType("integer")
                .HasColumnName("age");

                b.Property <string>("Backpack")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("backpack");

                b.Property <string>("CharacterName")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("char_name");

                b.Property <string>("Clothing")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("clothing");

                b.Property <string>("EyeColor")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("eye_color");

                b.Property <string>("FacialHairColor")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("facial_hair_color");

                b.Property <string>("FacialHairName")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("facial_hair_name");

                b.Property <string>("Gender")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("gender");

                b.Property <string>("HairColor")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("hair_color");

                b.Property <string>("HairName")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("hair_name");

                b.Property <int>("PreferenceId")
                .HasColumnType("integer")
                .HasColumnName("preference_id");

                b.Property <int>("PreferenceUnavailable")
                .HasColumnType("integer")
                .HasColumnName("pref_unavailable");

                b.Property <string>("Sex")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("sex");

                b.Property <string>("SkinColor")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("skin_color");

                b.Property <int>("Slot")
                .HasColumnType("integer")
                .HasColumnName("slot");

                b.HasKey("Id")
                .HasName("PK_profile");

                b.HasIndex("PreferenceId")
                .HasDatabaseName("IX_profile_preference_id");

                b.HasIndex("Slot", "PreferenceId")
                .IsUnique();

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

            modelBuilder.Entity("Content.Server.Database.Round", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasColumnName("round_id");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.HasKey("Id")
                .HasName("PK_round");

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

            modelBuilder.Entity("PlayerRound", b =>
            {
                b.Property <int>("PlayersId")
                .HasColumnType("integer")
                .HasColumnName("players_id");

                b.Property <int>("RoundsId")
                .HasColumnType("integer")
                .HasColumnName("rounds_id");

                b.HasKey("PlayersId", "RoundsId")
                .HasName("PK_player_round");

                b.HasIndex("RoundsId")
                .HasDatabaseName("IX_player_round_rounds_id");

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

            modelBuilder.Entity("Content.Server.Database.Admin", b =>
            {
                b.HasOne("Content.Server.Database.AdminRank", "AdminRank")
                .WithMany("Admins")
                .HasForeignKey("AdminRankId")
                .OnDelete(DeleteBehavior.SetNull)
                .HasConstraintName("FK_admin_admin_rank_admin_rank_id");

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

            modelBuilder.Entity("Content.Server.Database.AdminFlag", b =>
            {
                b.HasOne("Content.Server.Database.Admin", "Admin")
                .WithMany("Flags")
                .HasForeignKey("AdminId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("FK_admin_flag_admin_admin_id");

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

            modelBuilder.Entity("Content.Server.Database.AdminLog", b =>
            {
                b.HasOne("Content.Server.Database.Round", "Round")
                .WithMany("AdminLogs")
                .HasForeignKey("RoundId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("FK_admin_log_round_round_id");

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

            modelBuilder.Entity("Content.Server.Database.AdminLogEntity", b =>
            {
                b.HasOne("Content.Server.Database.AdminLog", null)
                .WithMany("Entities")
                .HasForeignKey("AdminLogId", "AdminLogRoundId")
                .HasConstraintName("FK_admin_log_entity_admin_log_admin_log_id_admin_log_round_id");
            });

            modelBuilder.Entity("Content.Server.Database.AdminLogPlayer", b =>
            {
                b.HasOne("Content.Server.Database.Player", "Player")
                .WithMany("AdminLogs")
                .HasForeignKey("PlayerUserId")
                .HasPrincipalKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("FK_admin_log_player_player_player_user_id");

                b.HasOne("Content.Server.Database.AdminLog", "Log")
                .WithMany("Players")
                .HasForeignKey("LogId", "RoundId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("FK_admin_log_player_admin_log_log_id_round_id");

                b.Navigation("Log");

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

            modelBuilder.Entity("Content.Server.Database.AdminRankFlag", b =>
            {
                b.HasOne("Content.Server.Database.AdminRank", "Rank")
                .WithMany("Flags")
                .HasForeignKey("AdminRankId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("FK_admin_rank_flag_admin_rank_admin_rank_id");

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

            modelBuilder.Entity("Content.Server.Database.Antag", b =>
            {
                b.HasOne("Content.Server.Database.Profile", "Profile")
                .WithMany("Antags")
                .HasForeignKey("ProfileId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("FK_antag_profile_profile_id");

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

            modelBuilder.Entity("Content.Server.Database.Job", b =>
            {
                b.HasOne("Content.Server.Database.Profile", "Profile")
                .WithMany("Jobs")
                .HasForeignKey("ProfileId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("FK_job_profile_profile_id");

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

            modelBuilder.Entity("Content.Server.Database.PostgresServerUnban", b =>
            {
                b.HasOne("Content.Server.Database.PostgresServerBan", "Ban")
                .WithOne("Unban")
                .HasForeignKey("Content.Server.Database.PostgresServerUnban", "BanId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("FK_server_unban_server_ban_ban_id");

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

            modelBuilder.Entity("Content.Server.Database.Profile", b =>
            {
                b.HasOne("Content.Server.Database.Preference", "Preference")
                .WithMany("Profiles")
                .HasForeignKey("PreferenceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("FK_profile_preference_preference_id");

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

            modelBuilder.Entity("PlayerRound", b =>
            {
                b.HasOne("Content.Server.Database.Player", null)
                .WithMany()
                .HasForeignKey("PlayersId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("FK_player_round_player_players_id");

                b.HasOne("Content.Server.Database.Round", null)
                .WithMany()
                .HasForeignKey("RoundsId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("FK_player_round_round_rounds_id");
            });

            modelBuilder.Entity("Content.Server.Database.Admin", b =>
            {
                b.Navigation("Flags");
            });

            modelBuilder.Entity("Content.Server.Database.AdminLog", b =>
            {
                b.Navigation("Entities");

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

            modelBuilder.Entity("Content.Server.Database.AdminRank", b =>
            {
                b.Navigation("Admins");

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

            modelBuilder.Entity("Content.Server.Database.Player", b =>
            {
                b.Navigation("AdminLogs");
            });

            modelBuilder.Entity("Content.Server.Database.PostgresServerBan", b =>
            {
                b.Navigation("Unban");
            });

            modelBuilder.Entity("Content.Server.Database.Preference", b =>
            {
                b.Navigation("Profiles");
            });

            modelBuilder.Entity("Content.Server.Database.Profile", b =>
            {
                b.Navigation("Antags");

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

            modelBuilder.Entity("Content.Server.Database.Round", b =>
            {
                b.Navigation("AdminLogs");
            });
#pragma warning restore 612, 618
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.PostgreSql)
            .HasAnnotation("ProductVersion", "6.0.1")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("Business.Models.Book", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <string>("ConcurrencyStamp")
                .IsConcurrencyToken()
                .HasMaxLength(40)
                .HasColumnType("character varying(40)")
                .HasColumnName("ConcurrencyStamp");

                b.Property <DateTime>("CreationTime")
                .HasColumnType("timestamp without time zone")
                .HasColumnName("CreationTime");

                b.Property <Guid?>("CreatorId")
                .HasColumnType("uuid")
                .HasColumnName("CreatorId");

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

                b.Property <string>("ExtraProperties")
                .HasColumnType("text")
                .HasColumnName("ExtraProperties");

                b.Property <bool>("IsDeleted")
                .ValueGeneratedOnAdd()
                .HasColumnType("boolean")
                .HasDefaultValue(false)
                .HasColumnName("IsDeleted");

                b.Property <DateTime?>("LastModificationTime")
                .HasColumnType("timestamp without time zone")
                .HasColumnName("LastModificationTime");

                b.Property <Guid?>("LastModifierId")
                .HasColumnType("uuid")
                .HasColumnName("LastModifierId");

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

                b.Property <int>("Price")
                .HasColumnType("integer");

                b.Property <Guid?>("TenantId")
                .HasColumnType("uuid")
                .HasColumnName("TenantId");

                b.HasKey("Id");

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

            modelBuilder.Entity("XCZ.FlowManagement.BaseFlow", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <string>("Code")
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.Property <string>("ConcurrencyStamp")
                .IsConcurrencyToken()
                .HasMaxLength(40)
                .HasColumnType("character varying(40)")
                .HasColumnName("ConcurrencyStamp");

                b.Property <DateTime>("CreationTime")
                .HasColumnType("timestamp without time zone")
                .HasColumnName("CreationTime");

                b.Property <Guid?>("CreatorId")
                .HasColumnType("uuid")
                .HasColumnName("CreatorId");

                b.Property <string>("ExtraProperties")
                .HasColumnType("text")
                .HasColumnName("ExtraProperties");

                b.Property <string>("FlowId")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <Guid>("FormId")
                .HasColumnType("uuid");

                b.Property <bool>("IsDeleted")
                .ValueGeneratedOnAdd()
                .HasColumnType("boolean")
                .HasDefaultValue(false)
                .HasColumnName("IsDeleted");

                b.Property <DateTime?>("LastModificationTime")
                .HasColumnType("timestamp without time zone")
                .HasColumnName("LastModificationTime");

                b.Property <Guid?>("LastModifierId")
                .HasColumnType("uuid")
                .HasColumnName("LastModifierId");

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

                b.Property <string>("Remark")
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <int>("Status")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasDefaultValue(0);

                b.Property <Guid?>("TenantId")
                .HasColumnType("uuid")
                .HasColumnName("TenantId");

                b.Property <string>("Title")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <string>("UseDate")
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.HasKey("Id");

                b.HasIndex("FormId");

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

            modelBuilder.Entity("XCZ.FlowManagement.FlowLink", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <Guid>("BaseFlowId")
                .HasColumnType("uuid");

                b.Property <string>("ConcurrencyStamp")
                .IsConcurrencyToken()
                .HasMaxLength(40)
                .HasColumnType("character varying(40)")
                .HasColumnName("ConcurrencyStamp");

                b.Property <string>("ExtraProperties")
                .HasColumnType("text")
                .HasColumnName("ExtraProperties");

                b.Property <bool>("IsDeleted")
                .ValueGeneratedOnAdd()
                .HasColumnType("boolean")
                .HasDefaultValue(false)
                .HasColumnName("IsDeleted");

                b.Property <string>("Label")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <string>("LinkId")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <string>("Remark")
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <string>("SourceId")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <string>("TargetId")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <Guid?>("TenantId")
                .HasColumnType("uuid")
                .HasColumnName("TenantId");

                b.Property <string>("Type")
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.HasKey("Id");

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

            modelBuilder.Entity("XCZ.FlowManagement.FlowNode", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <Guid>("BaseFlowId")
                .HasColumnType("uuid");

                b.Property <string>("ConcurrencyStamp")
                .IsConcurrencyToken()
                .HasMaxLength(40)
                .HasColumnType("character varying(40)")
                .HasColumnName("ConcurrencyStamp");

                b.Property <string>("ExtraProperties")
                .HasColumnType("text")
                .HasColumnName("ExtraProperties");

                b.Property <int>("Height")
                .HasColumnType("integer");

                b.Property <bool>("IsDeleted")
                .ValueGeneratedOnAdd()
                .HasColumnType("boolean")
                .HasDefaultValue(false)
                .HasColumnName("IsDeleted");

                b.Property <string>("NodeId")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <string>("NodeName")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <string>("Remark")
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <Guid?>("TenantId")
                .HasColumnType("uuid")
                .HasColumnName("TenantId");

                b.Property <string>("Type")
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.Property <int>("Width")
                .HasColumnType("integer");

                b.Property <int>("X")
                .HasColumnType("integer");

                b.Property <int>("Y")
                .HasColumnType("integer");

                b.HasKey("Id");

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

            modelBuilder.Entity("XCZ.FlowManagement.LinkForm", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <Guid>("BaseFlowId")
                .HasColumnType("uuid");

                b.Property <string>("ConcurrencyStamp")
                .IsConcurrencyToken()
                .HasMaxLength(40)
                .HasColumnType("character varying(40)")
                .HasColumnName("ConcurrencyStamp");

                b.Property <Guid>("Condition")
                .HasColumnType("uuid");

                b.Property <string>("Content")
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <string>("ExtraProperties")
                .HasColumnType("text")
                .HasColumnName("ExtraProperties");

                b.Property <Guid>("FieldId")
                .HasColumnType("uuid");

                b.Property <Guid>("FlowLinkId")
                .HasColumnType("uuid");

                b.Property <bool>("IsDeleted")
                .ValueGeneratedOnAdd()
                .HasColumnType("boolean")
                .HasDefaultValue(false)
                .HasColumnName("IsDeleted");

                b.Property <string>("Pid")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <string>("Remark")
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <Guid?>("TenantId")
                .HasColumnType("uuid")
                .HasColumnName("TenantId");

                b.HasKey("Id");

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

            modelBuilder.Entity("XCZ.FormManagement.Form", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <string>("Api")
                .IsRequired()
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <string>("ConcurrencyStamp")
                .IsConcurrencyToken()
                .HasMaxLength(40)
                .HasColumnType("character varying(40)")
                .HasColumnName("ConcurrencyStamp");

                b.Property <DateTime>("CreationTime")
                .HasColumnType("timestamp without time zone")
                .HasColumnName("CreationTime");

                b.Property <Guid?>("CreatorId")
                .HasColumnType("uuid")
                .HasColumnName("CreatorId");

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

                b.Property <bool>("Disabled")
                .HasColumnType("boolean");

                b.Property <string>("DisplayName")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("character varying(100)");

                b.Property <string>("EntityName")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.Property <string>("ExtraProperties")
                .HasColumnType("text")
                .HasColumnName("ExtraProperties");

                b.Property <string>("FormName")
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.Property <bool>("IsDeleted")
                .ValueGeneratedOnAdd()
                .HasColumnType("boolean")
                .HasDefaultValue(false)
                .HasColumnName("IsDeleted");

                b.Property <DateTime?>("LastModificationTime")
                .HasColumnType("timestamp without time zone")
                .HasColumnName("LastModificationTime");

                b.Property <Guid?>("LastModifierId")
                .HasColumnType("uuid")
                .HasColumnName("LastModifierId");

                b.Property <string>("Namespace")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.Property <string>("Remark")
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

                b.Property <string>("TableName")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.Property <Guid?>("TenantId")
                .HasColumnType("uuid")
                .HasColumnName("TenantId");

                b.HasKey("Id");

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

            modelBuilder.Entity("XCZ.FormManagement.FormField", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <string>("ConcurrencyStamp")
                .IsConcurrencyToken()
                .HasMaxLength(40)
                .HasColumnType("character varying(40)")
                .HasColumnName("ConcurrencyStamp");

                b.Property <string>("DataType")
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.Property <string>("DefaultValue")
                .HasMaxLength(256)
                .HasColumnType("character varying(256)");

                b.Property <bool>("Disabled")
                .HasColumnType("boolean");

                b.Property <string>("ExtraProperties")
                .HasColumnType("text")
                .HasColumnName("ExtraProperties");

                b.Property <string>("FieldName")
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.Property <int>("FieldOrder")
                .HasColumnType("integer");

                b.Property <string>("FieldType")
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.Property <Guid>("FormId")
                .HasColumnType("uuid");

                b.Property <string>("Icon")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.Property <bool>("IsIndex")
                .ValueGeneratedOnAdd()
                .HasColumnType("boolean")
                .HasDefaultValue(false);

                b.Property <bool>("IsReadonly")
                .HasColumnType("boolean");

                b.Property <bool>("IsRequired")
                .HasColumnType("boolean");

                b.Property <bool>("IsSort")
                .HasColumnType("boolean");

                b.Property <string>("Label")
                .IsRequired()
                .HasMaxLength(128)
                .HasColumnType("character varying(128)");

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

                b.Property <string>("Options")
                .HasColumnType("text");

                b.Property <string>("Placeholder")
                .HasMaxLength(50)
                .HasColumnType("character varying(50)");

                b.Property <string>("Regx")
                .HasColumnType("text");

                b.Property <Guid?>("TenantId")
                .HasColumnType("uuid");

                b.HasKey("Id");

                b.ToTable("base_form_fields", (string)null);
            });
#pragma warning restore 612, 618
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasDefaultSchema("ModerationModule")
            .HasAnnotation("ProductVersion", "6.0.0")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);
            NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "fuzzystrmatch");
            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Core.Model.Servers.Server", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .HasColumnName("id");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <string>("Description")
                .HasColumnType("text")
                .HasColumnName("description");
                b.Property <long>("DiscordID")
                .HasColumnType("bigint")
                .HasColumnName("discord_id");
                b.Property <bool>("IsNSFW")
                .HasColumnType("boolean")
                .HasColumnName("is_nsfw");
                b.Property <string>("JoinMessage")
                .HasColumnType("text")
                .HasColumnName("join_message");
                b.Property <bool>("SendJoinMessage")
                .HasColumnType("boolean")
                .HasColumnName("send_join_message");
                b.Property <bool>("SuppressPermissionWarnings")
                .HasColumnType("boolean")
                .HasColumnName("suppress_permission_warnings");
                b.HasKey("ID")
                .HasName("pk_servers");
                b.ToTable("Servers", "Core", t => t.ExcludeFromMigrations());
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Core.Model.Users.ServerUser", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .HasColumnName("id");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <long>("ServerID")
                .HasColumnType("bigint")
                .HasColumnName("server_id");
                b.Property <long>("UserID")
                .HasColumnType("bigint")
                .HasColumnName("user_id");
                b.HasKey("ID")
                .HasName("pk_server_user");
                b.HasIndex("ServerID")
                .HasDatabaseName("ix_server_user_server_id");
                b.HasIndex("UserID")
                .HasDatabaseName("ix_server_user_user_id");
                b.ToTable("ServerUser", "Core", t => t.ExcludeFromMigrations());
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Core.Model.Users.User", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .HasColumnName("id");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <string>("Bio")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("bio");
                b.Property <long>("DiscordID")
                .HasColumnType("bigint")
                .HasColumnName("discord_id");
                b.Property <int?>("Timezone")
                .HasColumnType("integer")
                .HasColumnName("timezone");
                b.HasKey("ID")
                .HasName("pk_users");
                b.ToTable("Users", "Core", t => t.ExcludeFromMigrations());
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Moderation.Model.ServerModerationSettings", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .HasColumnName("id");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <long?>("ModerationLogChannel")
                .HasColumnType("bigint")
                .HasColumnName("moderation_log_channel");
                b.Property <long?>("MonitoringChannel")
                .HasColumnType("bigint")
                .HasColumnName("monitoring_channel");
                b.Property <long>("ServerID")
                .HasColumnType("bigint")
                .HasColumnName("server_id");
                b.Property <int>("WarningThreshold")
                .HasColumnType("integer")
                .HasColumnName("warning_threshold");
                b.HasKey("ID")
                .HasName("pk_server_moderation_settings");
                b.HasIndex("ServerID")
                .HasDatabaseName("ix_server_moderation_settings_server_id");
                b.ToTable("ServerModerationSettings", "ModerationModule");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Moderation.Model.UserBan", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .HasColumnName("id");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <long>("AuthorID")
                .HasColumnType("bigint")
                .HasColumnName("author_id");
                b.Property <DateTimeOffset>("CreatedAt")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("created_at");
                b.Property <DateTimeOffset?>("ExpiresOn")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("expires_on");
                b.Property <long?>("MessageID")
                .HasColumnType("bigint")
                .HasColumnName("message_id");
                b.Property <string>("Reason")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("reason");
                b.Property <long>("ServerID")
                .HasColumnType("bigint")
                .HasColumnName("server_id");
                b.Property <DateTimeOffset>("UpdatedAt")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("updated_at");
                b.Property <long>("UserID")
                .HasColumnType("bigint")
                .HasColumnName("user_id");
                b.HasKey("ID")
                .HasName("pk_user_bans");
                b.HasIndex("AuthorID")
                .HasDatabaseName("ix_user_bans_author_id");
                b.HasIndex("ServerID")
                .HasDatabaseName("ix_user_bans_server_id");
                b.HasIndex("UserID")
                .HasDatabaseName("ix_user_bans_user_id");
                b.ToTable("UserBans", "ModerationModule");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Moderation.Model.UserNote", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .HasColumnName("id");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <long>("AuthorID")
                .HasColumnType("bigint")
                .HasColumnName("author_id");
                b.Property <string>("Content")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("content");
                b.Property <DateTimeOffset>("CreatedAt")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("created_at");
                b.Property <long>("ServerID")
                .HasColumnType("bigint")
                .HasColumnName("server_id");
                b.Property <DateTimeOffset>("UpdatedAt")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("updated_at");
                b.Property <long>("UserID")
                .HasColumnType("bigint")
                .HasColumnName("user_id");
                b.HasKey("ID")
                .HasName("pk_user_notes");
                b.HasIndex("AuthorID")
                .HasDatabaseName("ix_user_notes_author_id");
                b.HasIndex("ServerID")
                .HasDatabaseName("ix_user_notes_server_id");
                b.HasIndex("UserID")
                .HasDatabaseName("ix_user_notes_user_id");
                b.ToTable("UserNotes", "ModerationModule");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Moderation.Model.UserWarning", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .HasColumnName("id");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <long>("AuthorID")
                .HasColumnType("bigint")
                .HasColumnName("author_id");
                b.Property <DateTimeOffset>("CreatedAt")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("created_at");
                b.Property <DateTimeOffset?>("ExpiresOn")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("expires_on");
                b.Property <long?>("MessageID")
                .HasColumnType("bigint")
                .HasColumnName("message_id");
                b.Property <string>("Reason")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("reason");
                b.Property <long>("ServerID")
                .HasColumnType("bigint")
                .HasColumnName("server_id");
                b.Property <DateTimeOffset>("UpdatedAt")
                .HasColumnType("timestamp with time zone")
                .HasColumnName("updated_at");
                b.Property <long>("UserID")
                .HasColumnType("bigint")
                .HasColumnName("user_id");
                b.HasKey("ID")
                .HasName("pk_user_warnings");
                b.HasIndex("AuthorID")
                .HasDatabaseName("ix_user_warnings_author_id");
                b.HasIndex("ServerID")
                .HasDatabaseName("ix_user_warnings_server_id");
                b.HasIndex("UserID")
                .HasDatabaseName("ix_user_warnings_user_id");
                b.ToTable("UserWarnings", "ModerationModule");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Core.Model.Users.ServerUser", b =>
            {
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Servers.Server", "Server")
                .WithMany("KnownUsers")
                .HasForeignKey("ServerID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_server_user_servers_server_id");
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Users.User", "User")
                .WithMany()
                .HasForeignKey("UserID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_server_user_users_user_id");
                b.Navigation("Server");
                b.Navigation("User");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Moderation.Model.ServerModerationSettings", b =>
            {
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Servers.Server", "Server")
                .WithMany()
                .HasForeignKey("ServerID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_server_moderation_settings_servers_server_id");
                b.Navigation("Server");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Moderation.Model.UserBan", b =>
            {
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Users.User", "Author")
                .WithMany()
                .HasForeignKey("AuthorID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_user_bans_users_author_id");
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Servers.Server", "Server")
                .WithMany()
                .HasForeignKey("ServerID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_user_bans_servers_server_id");
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Users.User", "User")
                .WithMany()
                .HasForeignKey("UserID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_user_bans_users_user_id");
                b.Navigation("Author");
                b.Navigation("Server");
                b.Navigation("User");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Moderation.Model.UserNote", b =>
            {
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Users.User", "Author")
                .WithMany()
                .HasForeignKey("AuthorID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_user_notes_users_author_id");
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Servers.Server", "Server")
                .WithMany()
                .HasForeignKey("ServerID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_user_notes_servers_server_id");
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Users.User", "User")
                .WithMany()
                .HasForeignKey("UserID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_user_notes_users_user_id");
                b.Navigation("Author");
                b.Navigation("Server");
                b.Navigation("User");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Moderation.Model.UserWarning", b =>
            {
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Users.User", "Author")
                .WithMany()
                .HasForeignKey("AuthorID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_user_warnings_users_author_id");
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Servers.Server", "Server")
                .WithMany()
                .HasForeignKey("ServerID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_user_warnings_servers_server_id");
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Users.User", "User")
                .WithMany()
                .HasForeignKey("UserID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_user_warnings_users_user_id");
                b.Navigation("Author");
                b.Navigation("Server");
                b.Navigation("User");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Core.Model.Servers.Server", b =>
            {
                b.Navigation("KnownUsers");
            });
#pragma warning restore 612, 618
        }