protected override void BuildTargetModel(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
        }
Beispiel #2
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("RFI.WordsTrainer.Data.Models.Word", b =>
            {
                b.Property <int?>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

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

                b.HasKey("Id");

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

            modelBuilder.Entity("RFI.WordsTrainer.Data.Models.WordCategory", b =>
            {
                b.Property <int?>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

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

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

                b.HasKey("Id");

                b.ToTable("WordCategories");
            });
#pragma warning restore 612, 618
        }
Beispiel #3
0
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.6")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("Simple_Asp.Net_Core.Models.FTPFile", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

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

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

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

                b.HasKey("Id");

                b.ToTable("FTPFiles");
            });
#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 <short>("Impact")
                .HasColumnType("smallint")
                .HasColumnName("impact");

                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.ConnectionLog", 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?>("Denied")
                .HasColumnType("smallint")
                .HasColumnName("denied");

                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.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.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.Property <string>("Species")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("species");

                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("Content.Server.Database.ServerBan", 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.ServerBanHit", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasColumnName("server_ban_hit_id");

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

                b.Property <int>("BanId")
                .HasColumnType("integer")
                .HasColumnName("ban_id");

                b.Property <int>("ConnectionId")
                .HasColumnType("integer")
                .HasColumnName("connection_id");

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

                b.HasIndex("BanId")
                .HasDatabaseName("IX_server_ban_hit_ban_id");

                b.HasIndex("ConnectionId")
                .HasDatabaseName("IX_server_ban_hit_connection_id");

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

            modelBuilder.Entity("Content.Server.Database.ServerRoleBan", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasColumnName("server_role_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 <string>("RoleId")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("role_id");

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

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

                b.HasIndex("Address");

                b.HasIndex("UserId");

                b.ToTable("server_role_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.ServerRoleUnban", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasColumnName("role_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_role_unban");

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

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

            modelBuilder.Entity("Content.Server.Database.ServerUnban", 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.Whitelist", b =>
            {
                b.Property <Guid>("UserId")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid")
                .HasColumnName("user_id");

                b.HasKey("UserId")
                .HasName("PK_whitelist");

                b.ToTable("whitelist", (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.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("Content.Server.Database.ServerBanHit", b =>
            {
                b.HasOne("Content.Server.Database.ServerBan", "Ban")
                .WithMany("BanHits")
                .HasForeignKey("BanId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("FK_server_ban_hit_server_ban_ban_id");

                b.HasOne("Content.Server.Database.ConnectionLog", "Connection")
                .WithMany("BanHits")
                .HasForeignKey("ConnectionId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("FK_server_ban_hit_connection_log_connection_id");

                b.Navigation("Ban");

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

            modelBuilder.Entity("Content.Server.Database.ServerRoleUnban", b =>
            {
                b.HasOne("Content.Server.Database.ServerRoleBan", "Ban")
                .WithOne("Unban")
                .HasForeignKey("Content.Server.Database.ServerRoleUnban", "BanId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("FK_server_role_unban_server_role_ban_ban_id");

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

            modelBuilder.Entity("Content.Server.Database.ServerUnban", b =>
            {
                b.HasOne("Content.Server.Database.ServerBan", "Ban")
                .WithOne("Unban")
                .HasForeignKey("Content.Server.Database.ServerUnban", "BanId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("FK_server_unban_server_ban_ban_id");

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

            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.ConnectionLog", b =>
            {
                b.Navigation("BanHits");
            });

            modelBuilder.Entity("Content.Server.Database.Player", b =>
            {
                b.Navigation("AdminLogs");
            });

            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");
            });

            modelBuilder.Entity("Content.Server.Database.ServerBan", b =>
            {
                b.Navigation("BanHits");

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

            modelBuilder.Entity("Content.Server.Database.ServerRoleBan", b =>
            {
                b.Navigation("Unban");
            });
#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("Bonsai.Data.Models.AppUser", b =>
            {
                b.Property <string>("Id")
                .HasColumnType("text");

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

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

                b.Property <string>("Birthday")
                .HasMaxLength(10)
                .HasColumnType("character varying(10)");

                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 <string>("FirstName")
                .HasMaxLength(256)
                .HasColumnType("character varying(256)");

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

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

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

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

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

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

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

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

                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("NormalizedEmail")
                .HasDatabaseName("EmailIndex");

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

                b.HasIndex("PageId");

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

            modelBuilder.Entity("Bonsai.Data.Models.ChangeEventGroup", b =>
            {
                b.Property <string>("GroupKey")
                .HasColumnType("text");

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

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

                b.HasKey("GroupKey");

                b.ToView("ChangesGrouped");
            });

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

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

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

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

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

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

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("AppUserId");

                b.HasIndex("AuthorId");

                b.HasIndex("EditedMediaId");

                b.HasIndex("EditedPageId");

                b.HasIndex("EditedRelationId");

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

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

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

                b.HasKey("Id");

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

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

                b.Property <string>("Date")
                .HasMaxLength(30)
                .HasColumnType("character varying(30)");

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

                b.Property <string>("FilePath")
                .IsRequired()
                .HasMaxLength(300)
                .HasColumnType("character varying(300)");

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

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

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("IsDeleted");

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

                b.HasIndex("UploaderId");

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

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

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

                b.HasKey("Id");

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

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

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("MediaId");

                b.HasIndex("ObjectId");

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

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

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

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

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

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

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("IsDeleted");

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

                b.HasIndex("MainPhotoId");

                b.HasIndex("TreeLayoutId");

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

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

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

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

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

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

                b.HasKey("Id");

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

                b.HasIndex("PageId");

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("PageId");

                b.HasIndex("UserId");

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("DestinationId");

                b.HasIndex("SourceId");

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("MainPhotoId");

                b.ToView("PagesScored");
            });

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

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

                b.Property <string>("Duration")
                .HasMaxLength(30)
                .HasColumnType("character varying(30)");

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("DestinationId");

                b.HasIndex("EventId");

                b.HasIndex("IsComplementary");

                b.HasIndex("IsDeleted");

                b.HasIndex("SourceId");

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

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

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

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

                b.HasKey("Id");

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

            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")
                .HasColumnType("text");

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

                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")
                .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("Bonsai.Data.Models.AppUser", b =>
            {
                b.HasOne("Bonsai.Data.Models.Page", "Page")
                .WithMany()
                .HasForeignKey("PageId");

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

            modelBuilder.Entity("Bonsai.Data.Models.Changeset", b =>
            {
                b.HasOne("Bonsai.Data.Models.AppUser", null)
                .WithMany("Changes")
                .HasForeignKey("AppUserId");

                b.HasOne("Bonsai.Data.Models.AppUser", "Author")
                .WithMany()
                .HasForeignKey("AuthorId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Bonsai.Data.Models.Media", "EditedMedia")
                .WithMany()
                .HasForeignKey("EditedMediaId");

                b.HasOne("Bonsai.Data.Models.Page", "EditedPage")
                .WithMany()
                .HasForeignKey("EditedPageId");

                b.HasOne("Bonsai.Data.Models.Relation", "EditedRelation")
                .WithMany()
                .HasForeignKey("EditedRelationId");

                b.Navigation("Author");

                b.Navigation("EditedMedia");

                b.Navigation("EditedPage");

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

            modelBuilder.Entity("Bonsai.Data.Models.Media", b =>
            {
                b.HasOne("Bonsai.Data.Models.AppUser", "Uploader")
                .WithMany()
                .HasForeignKey("UploaderId");

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

            modelBuilder.Entity("Bonsai.Data.Models.MediaEncodingJob", b =>
            {
                b.HasOne("Bonsai.Data.Models.Media", "Media")
                .WithOne()
                .HasForeignKey("Bonsai.Data.Models.MediaEncodingJob", "MediaId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Bonsai.Data.Models.MediaTag", b =>
            {
                b.HasOne("Bonsai.Data.Models.Media", "Media")
                .WithMany("Tags")
                .HasForeignKey("MediaId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Bonsai.Data.Models.Page", "Object")
                .WithMany("MediaTags")
                .HasForeignKey("ObjectId");

                b.Navigation("Media");

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

            modelBuilder.Entity("Bonsai.Data.Models.Page", b =>
            {
                b.HasOne("Bonsai.Data.Models.Media", "MainPhoto")
                .WithMany()
                .HasForeignKey("MainPhotoId");

                b.HasOne("Bonsai.Data.Models.TreeLayout", "TreeLayout")
                .WithMany()
                .HasForeignKey("TreeLayoutId");

                b.Navigation("MainPhoto");

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

            modelBuilder.Entity("Bonsai.Data.Models.PageAlias", b =>
            {
                b.HasOne("Bonsai.Data.Models.Page", "Page")
                .WithMany("Aliases")
                .HasForeignKey("PageId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Bonsai.Data.Models.PageDraft", b =>
            {
                b.HasOne("Bonsai.Data.Models.AppUser", "User")
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("Bonsai.Data.Models.PageReference", b =>
            {
                b.HasOne("Bonsai.Data.Models.Page", "Destination")
                .WithMany("References")
                .HasForeignKey("DestinationId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Bonsai.Data.Models.Page", "Source")
                .WithMany()
                .HasForeignKey("SourceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Destination");

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

            modelBuilder.Entity("Bonsai.Data.Models.PageScored", b =>
            {
                b.HasOne("Bonsai.Data.Models.Media", "MainPhoto")
                .WithMany()
                .HasForeignKey("MainPhotoId");

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

            modelBuilder.Entity("Bonsai.Data.Models.Relation", b =>
            {
                b.HasOne("Bonsai.Data.Models.Page", "Destination")
                .WithMany()
                .HasForeignKey("DestinationId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Bonsai.Data.Models.Page", "Event")
                .WithMany()
                .HasForeignKey("EventId");

                b.HasOne("Bonsai.Data.Models.Page", "Source")
                .WithMany("Relations")
                .HasForeignKey("SourceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Destination");

                b.Navigation("Event");

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

            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("Bonsai.Data.Models.AppUser", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
            {
                b.HasOne("Bonsai.Data.Models.AppUser", 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("Bonsai.Data.Models.AppUser", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

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

            modelBuilder.Entity("Bonsai.Data.Models.AppUser", b =>
            {
                b.Navigation("Changes");
            });

            modelBuilder.Entity("Bonsai.Data.Models.Media", b =>
            {
                b.Navigation("Tags");
            });

            modelBuilder.Entity("Bonsai.Data.Models.Page", b =>
            {
                b.Navigation("Aliases");

                b.Navigation("MediaTags");

                b.Navigation("References");

                b.Navigation("Relations");
            });
#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.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 <string>("SupplierNameCode")
                .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
        }
Beispiel #7
0
        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 <long>("SignatureIssuedAt")
                .HasColumnType("bigint");

                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("TransformationModule")
            .HasAnnotation("ProductVersion", "6.0.0")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);
            NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "fuzzystrmatch");
            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Characters.Model.Character", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <string>("AvatarUrl")
                .HasColumnType("text");
                b.Property <string>("Description")
                .HasColumnType("text");
                b.Property <bool>("IsCurrent")
                .HasColumnType("boolean");
                b.Property <bool>("IsDefault")
                .HasColumnType("boolean");
                b.Property <bool>("IsNSFW")
                .HasColumnType("boolean");
                b.Property <string>("Name")
                .IsRequired()
                .HasColumnType("text");
                b.Property <string>("Nickname")
                .HasColumnType("text");
                b.Property <long>("OwnerID")
                .HasColumnType("bigint");
                b.Property <string>("PronounProviderFamily")
                .IsRequired()
                .HasColumnType("text");
                b.Property <long?>("RoleID")
                .HasColumnType("bigint");
                b.Property <long>("ServerID")
                .HasColumnType("bigint");
                b.Property <string>("Summary")
                .HasColumnType("text");
                b.HasKey("ID");
                b.HasIndex("OwnerID");
                b.HasIndex("RoleID");
                b.HasIndex("ServerID");
                b.ToTable("Characters", "CharacterModule", t => t.ExcludeFromMigrations());
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Characters.Model.CharacterRole", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <int>("Access")
                .HasColumnType("integer");
                b.Property <long>("DiscordID")
                .HasColumnType("bigint");
                b.Property <long>("ServerID")
                .HasColumnType("bigint");
                b.HasKey("ID");
                b.HasIndex("ServerID");
                b.ToTable("CharacterRoles", "CharacterModule", t => t.ExcludeFromMigrations());
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Characters.Model.Data.Image", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <string>("Caption")
                .IsRequired()
                .HasColumnType("text");
                b.Property <long?>("CharacterID")
                .HasColumnType("bigint");
                b.Property <bool>("IsNSFW")
                .HasColumnType("boolean");
                b.Property <string>("Name")
                .IsRequired()
                .HasColumnType("text");
                b.Property <string>("Url")
                .IsRequired()
                .HasColumnType("text");
                b.HasKey("ID");
                b.HasIndex("CharacterID");
                b.ToTable("Images", "CharacterModule", t => t.ExcludeFromMigrations());
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Core.Model.Servers.Server", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <string>("Description")
                .HasColumnType("text");
                b.Property <long>("DiscordID")
                .HasColumnType("bigint");
                b.Property <bool>("IsNSFW")
                .HasColumnType("boolean");
                b.Property <string>("JoinMessage")
                .HasColumnType("text");
                b.Property <bool>("SendJoinMessage")
                .HasColumnType("boolean");
                b.Property <bool>("SuppressPermissionWarnings")
                .HasColumnType("boolean");
                b.HasKey("ID");
                b.ToTable("Servers", "Core", t => t.ExcludeFromMigrations());
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Core.Model.Users.ServerUser", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <long>("ServerID")
                .HasColumnType("bigint");
                b.Property <long>("UserID")
                .HasColumnType("bigint");
                b.HasKey("ID");
                b.HasIndex("ServerID");
                b.HasIndex("UserID");
                b.ToTable("ServerUser", "Core", t => t.ExcludeFromMigrations());
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Core.Model.Users.User", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <string>("Bio")
                .IsRequired()
                .HasColumnType("text");
                b.Property <long>("DiscordID")
                .HasColumnType("bigint");
                b.Property <int?>("Timezone")
                .HasColumnType("integer");
                b.HasKey("ID");
                b.ToTable("Users", "Core", t => t.ExcludeFromMigrations());
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Transformations.Model.Appearances.Appearance", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <long>("CharacterID")
                .HasColumnType("bigint");
                b.Property <double>("Height")
                .HasColumnType("double precision");
                b.Property <bool>("IsCurrent")
                .HasColumnType("boolean");
                b.Property <bool>("IsDefault")
                .HasColumnType("boolean");
                b.Property <double>("Muscularity")
                .HasColumnType("double precision");
                b.Property <double>("Weight")
                .HasColumnType("double precision");
                b.HasKey("ID");
                b.HasIndex("CharacterID");
                b.ToTable("Appearances", "TransformationModule");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Transformations.Model.GlobalUserProtection", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <bool>("DefaultOptIn")
                .HasColumnType("boolean");
                b.Property <int>("DefaultType")
                .HasColumnType("integer");
                b.Property <long>("UserID")
                .HasColumnType("bigint");
                b.HasKey("ID");
                b.HasIndex("UserID");
                b.ToTable("GlobalUserProtections", "TransformationModule");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Transformations.Model.ServerUserProtection", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <bool>("HasOptedIn")
                .HasColumnType("boolean");
                b.Property <long>("ServerID")
                .HasColumnType("bigint");
                b.Property <int>("Type")
                .HasColumnType("integer");
                b.Property <long>("UserID")
                .HasColumnType("bigint");
                b.HasKey("ID");
                b.HasIndex("ServerID");
                b.HasIndex("UserID");
                b.ToTable("ServerUserProtections", "TransformationModule");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Transformations.Model.Species", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <string>("Author")
                .IsRequired()
                .HasColumnType("text");
                b.Property <string>("Description")
                .IsRequired()
                .HasColumnType("text");
                b.Property <string>("Name")
                .IsRequired()
                .HasColumnType("text");
                b.Property <long?>("ParentID")
                .HasColumnType("bigint");
                b.HasKey("ID");
                b.HasIndex("ParentID");
                b.ToTable("Species", "TransformationModule");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Transformations.Model.Transformation", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <int?>("DefaultPattern")
                .HasColumnType("integer");
                b.Property <string>("Description")
                .IsRequired()
                .HasColumnType("text");
                b.Property <string>("GrowMessage")
                .IsRequired()
                .HasColumnType("text");
                b.Property <bool>("IsNSFW")
                .HasColumnType("boolean");
                b.Property <int>("Part")
                .HasColumnType("integer");
                b.Property <string>("ShiftMessage")
                .IsRequired()
                .HasColumnType("text");
                b.Property <string>("SingleDescription")
                .IsRequired()
                .HasColumnType("text");
                b.Property <long>("SpeciesID")
                .HasColumnType("bigint");
                b.Property <string>("UniformDescription")
                .HasColumnType("text");
                b.Property <string>("UniformGrowMessage")
                .HasColumnType("text");
                b.Property <string>("UniformShiftMessage")
                .HasColumnType("text");
                b.HasKey("ID");
                b.HasIndex("SpeciesID");
                b.ToTable("Transformations", "TransformationModule");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Transformations.Model.UserProtectionEntry", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <long>("GlobalProtectionID")
                .HasColumnType("bigint");
                b.Property <int>("Type")
                .HasColumnType("integer");
                b.Property <long>("UserID")
                .HasColumnType("bigint");
                b.HasKey("ID");
                b.HasIndex("GlobalProtectionID");
                b.HasIndex("UserID");
                b.ToTable("UserProtectionEntries", "TransformationModule");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Characters.Model.Character", b =>
            {
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Users.User", "Owner")
                .WithMany()
                .HasForeignKey("OwnerID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
                b.HasOne("DIGOS.Ambassador.Plugins.Characters.Model.CharacterRole", "Role")
                .WithMany()
                .HasForeignKey("RoleID");
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Servers.Server", "Server")
                .WithMany()
                .HasForeignKey("ServerID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
                b.Navigation("Owner");
                b.Navigation("Role");
                b.Navigation("Server");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Characters.Model.CharacterRole", b =>
            {
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Servers.Server", "Server")
                .WithMany()
                .HasForeignKey("ServerID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
                b.Navigation("Server");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Characters.Model.Data.Image", b =>
            {
                b.HasOne("DIGOS.Ambassador.Plugins.Characters.Model.Character", null)
                .WithMany("Images")
                .HasForeignKey("CharacterID");
            });
            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();
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Users.User", "User")
                .WithMany()
                .HasForeignKey("UserID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
                b.Navigation("Server");
                b.Navigation("User");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Transformations.Model.Appearances.Appearance", b =>
            {
                b.HasOne("DIGOS.Ambassador.Plugins.Characters.Model.Character", "Character")
                .WithMany()
                .HasForeignKey("CharacterID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
                b.OwnsMany("DIGOS.Ambassador.Plugins.Transformations.Model.Appearances.AppearanceComponent", "Components", b1 =>
                {
                    b1.Property <long>("ID")
                    .ValueGeneratedOnAdd()
                    .HasColumnType("bigint");
                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property <long>("ID"));
                    b1.Property <long>("AppearanceID")
                    .HasColumnType("bigint");
                    b1.Property <int>("Chirality")
                    .HasColumnType("integer");
                    b1.Property <int?>("Pattern")
                    .HasColumnType("integer");
                    b1.Property <long>("TransformationID")
                    .HasColumnType("bigint");
                    b1.HasKey("ID");
                    b1.HasIndex("AppearanceID");
                    b1.HasIndex("TransformationID");
                    b1.ToTable("AppearanceComponents", "TransformationModule");
                    b1.WithOwner()
                    .HasForeignKey("AppearanceID");
                    b1.HasOne("DIGOS.Ambassador.Plugins.Transformations.Model.Transformation", "Transformation")
                    .WithMany()
                    .HasForeignKey("TransformationID")
                    .OnDelete(DeleteBehavior.Cascade)
                    .IsRequired();
                    b1.OwnsOne("DIGOS.Ambassador.Plugins.Transformations.Model.Appearances.Colour", "BaseColour", b2 =>
                    {
                        b2.Property <long>("AppearanceComponentID")
                        .HasColumnType("bigint");
                        b2.Property <int?>("Modifier")
                        .HasColumnType("integer");
                        b2.Property <int>("Shade")
                        .HasColumnType("integer");
                        b2.HasKey("AppearanceComponentID");
                        b2.ToTable("BaseColours", "TransformationModule");
                        b2.WithOwner()
                        .HasForeignKey("AppearanceComponentID");
                    });
                    b1.OwnsOne("DIGOS.Ambassador.Plugins.Transformations.Model.Appearances.Colour", "PatternColour", b2 =>
                    {
                        b2.Property <long>("AppearanceComponentID")
                        .HasColumnType("bigint");
                        b2.Property <int?>("Modifier")
                        .HasColumnType("integer");
                        b2.Property <int>("Shade")
                        .HasColumnType("integer");
                        b2.HasKey("AppearanceComponentID");
                        b2.ToTable("PatternColours", "TransformationModule");
                        b2.WithOwner()
                        .HasForeignKey("AppearanceComponentID");
                    });
                    b1.Navigation("BaseColour")
                    .IsRequired();
                    b1.Navigation("PatternColour");
                    b1.Navigation("Transformation");
                });
                b.Navigation("Character");
                b.Navigation("Components");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Transformations.Model.GlobalUserProtection", b =>
            {
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Users.User", "User")
                .WithMany()
                .HasForeignKey("UserID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
                b.Navigation("User");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Transformations.Model.ServerUserProtection", b =>
            {
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Servers.Server", "Server")
                .WithMany()
                .HasForeignKey("ServerID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Users.User", "User")
                .WithMany()
                .HasForeignKey("UserID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
                b.Navigation("Server");
                b.Navigation("User");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Transformations.Model.Species", b =>
            {
                b.HasOne("DIGOS.Ambassador.Plugins.Transformations.Model.Species", "Parent")
                .WithMany()
                .HasForeignKey("ParentID");
                b.Navigation("Parent");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Transformations.Model.Transformation", b =>
            {
                b.HasOne("DIGOS.Ambassador.Plugins.Transformations.Model.Species", "Species")
                .WithMany()
                .HasForeignKey("SpeciesID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
                b.OwnsOne("DIGOS.Ambassador.Plugins.Transformations.Model.Appearances.Colour", "DefaultBaseColour", b1 =>
                {
                    b1.Property <long>("TransformationID")
                    .HasColumnType("bigint");
                    b1.Property <int?>("Modifier")
                    .HasColumnType("integer");
                    b1.Property <int>("Shade")
                    .HasColumnType("integer");
                    b1.HasKey("TransformationID");
                    b1.ToTable("DefaultBaseColours", "TransformationModule");
                    b1.WithOwner()
                    .HasForeignKey("TransformationID");
                });
                b.OwnsOne("DIGOS.Ambassador.Plugins.Transformations.Model.Appearances.Colour", "DefaultPatternColour", b1 =>
                {
                    b1.Property <long>("TransformationID")
                    .HasColumnType("bigint");
                    b1.Property <int?>("Modifier")
                    .HasColumnType("integer");
                    b1.Property <int>("Shade")
                    .HasColumnType("integer");
                    b1.HasKey("TransformationID");
                    b1.ToTable("DefaultPatternColours", "TransformationModule");
                    b1.WithOwner()
                    .HasForeignKey("TransformationID");
                });
                b.Navigation("DefaultBaseColour")
                .IsRequired();
                b.Navigation("DefaultPatternColour");
                b.Navigation("Species");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Transformations.Model.UserProtectionEntry", b =>
            {
                b.HasOne("DIGOS.Ambassador.Plugins.Transformations.Model.GlobalUserProtection", "GlobalProtection")
                .WithMany("UserListing")
                .HasForeignKey("GlobalProtectionID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Users.User", "User")
                .WithMany()
                .HasForeignKey("UserID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
                b.Navigation("GlobalProtection");
                b.Navigation("User");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Characters.Model.Character", b =>
            {
                b.Navigation("Images");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Core.Model.Servers.Server", b =>
            {
                b.Navigation("KnownUsers");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Transformations.Model.GlobalUserProtection", b =>
            {
                b.Navigation("UserListing");
            });
#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("Scaffold.Domain.Aggregates.Bucket.Bucket", 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")
                .HasColumnType("text");

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

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

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

                b.HasKey("Id");

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

            modelBuilder.Entity("Scaffold.Domain.Aggregates.Bucket.Item", b =>
            {
                b.Property <int>("BucketId")
                .HasColumnType("integer");

                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")
                .HasColumnType("text");

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

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

                b.HasKey("BucketId", "Id");

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

            modelBuilder.Entity("Scaffold.Domain.Aggregates.Bucket.Item", b =>
            {
                b.HasOne("Scaffold.Domain.Aggregates.Bucket.Bucket", null)
                .WithMany("Items")
                .HasForeignKey("BucketId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Scaffold.Domain.Aggregates.Bucket.Bucket", b =>
            {
                b.Navigation("Items");
            });
#pragma warning restore 612, 618
        }
Beispiel #10
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("Goblin.Domain.Entities.BotUser", b =>
            {
                b.Property <long>("Id")
                .HasColumnType("bigint");

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

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

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

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

                b.Property <bool>("IsErrorsEnabled")
                .ValueGeneratedOnAdd()
                .HasColumnType("boolean")
                .HasDefaultValue(true);

                b.Property <int>("NarfuGroup")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasDefaultValue(0);

                b.Property <string>("WeatherCity")
                .ValueGeneratedOnAdd()
                .HasMaxLength(100)
                .HasColumnType("character varying(100)")
                .HasDefaultValue("");

                b.HasKey("Id", "ConsumerType");

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

            modelBuilder.Entity("Goblin.Domain.Entities.CronJob", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

                b.Property <int>("ConsumerType")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasDefaultValue(0);

                b.Property <int>("CronType")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasDefaultValue(4);

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

                b.Property <int>("NarfuGroup")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasDefaultValue(0);

                b.Property <string>("Text")
                .ValueGeneratedOnAdd()
                .HasMaxLength(500)
                .HasColumnType("character varying(500)")
                .HasDefaultValue("");

                b.Property <string>("WeatherCity")
                .ValueGeneratedOnAdd()
                .HasColumnType("text")
                .HasDefaultValue("");

                b.HasKey("Id");

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

            modelBuilder.Entity("Goblin.Domain.Entities.Remind", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

                b.Property <int>("ConsumerType")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasDefaultValue(0);

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

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

                b.HasKey("Id");

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

            modelBuilder.Entity("Goblin.Domain.Entities.CronJob", b =>
            {
                b.OwnsOne("Goblin.Domain.CronTime", "Time", b1 =>
                {
                    b1.Property <int>("CronJobId")
                    .HasColumnType("integer");

                    b1.Property <string>("DayOfMonth")
                    .HasColumnType("text");

                    b1.Property <string>("DayOfWeek")
                    .HasColumnType("text");

                    b1.Property <string>("Hour")
                    .HasColumnType("text");

                    b1.Property <string>("Minute")
                    .HasColumnType("text");

                    b1.Property <string>("Month")
                    .HasColumnType("text");

                    b1.HasKey("CronJobId");

                    b1.ToTable("CronJobs");

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

                b.Navigation("Time");
            });
#pragma warning restore 612, 618
        }
        protected override void BuildModel(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
        }
Beispiel #12
0
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.4")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

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

                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 <DateTime?>("LastAccessed")
                .HasColumnType("timestamp with time zone");

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

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

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

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

                b.HasKey("Id");

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

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

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

                b.HasKey("Id");

                b.HasIndex("ApiResourceId");

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("ApiResourceId");

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

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

                b.HasKey("Id");

                b.HasIndex("ApiResourceId");

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("ApiResourceId");

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

                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>("Name")
                .IsRequired()
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

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

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

                b.HasKey("Id");

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

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

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

                b.HasKey("Id");

                b.HasIndex("ScopeId");

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("ScopeId");

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.Client", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

                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 <int?>("ConsentLifetime")
                .HasColumnType("integer");

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

                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 <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 <DateTime?>("LastAccessed")
                .HasColumnType("timestamp with time zone");

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

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

                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 <DateTime?>("Updated")
                .HasColumnType("timestamp with time zone");

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

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

                b.HasKey("Id");

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

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("ClientId");

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

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

                b.HasKey("Id");

                b.HasIndex("ClientId");

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

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

                b.HasKey("Id");

                b.HasIndex("ClientId");

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

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

                b.HasKey("Id");

                b.HasIndex("ClientId");

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

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

                b.HasKey("Id");

                b.HasIndex("ClientId");

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("ClientId");

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

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

                b.HasKey("Id");

                b.HasIndex("ClientId");

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

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

                b.HasKey("Id");

                b.HasIndex("ClientId");

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("ClientId");

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResource", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

                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>("Name")
                .IsRequired()
                .HasMaxLength(200)
                .HasColumnType("character varying(200)");

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

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

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

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

                b.HasKey("Id");

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

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

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

                b.HasKey("Id");

                b.HasIndex("IdentityResourceId");

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("IdentityResourceId");

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b =>
            {
                b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource")
                .WithMany("UserClaims")
                .HasForeignKey("ApiResourceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b =>
            {
                b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource")
                .WithMany("Properties")
                .HasForeignKey("ApiResourceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b =>
            {
                b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource")
                .WithMany("Scopes")
                .HasForeignKey("ApiResourceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b =>
            {
                b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource")
                .WithMany("Secrets")
                .HasForeignKey("ApiResourceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b =>
            {
                b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope")
                .WithMany("UserClaims")
                .HasForeignKey("ScopeId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b =>
            {
                b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope")
                .WithMany("Properties")
                .HasForeignKey("ScopeId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b =>
            {
                b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
                .WithMany("Claims")
                .HasForeignKey("ClientId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b =>
            {
                b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
                .WithMany("AllowedCorsOrigins")
                .HasForeignKey("ClientId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b =>
            {
                b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
                .WithMany("AllowedGrantTypes")
                .HasForeignKey("ClientId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b =>
            {
                b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
                .WithMany("IdentityProviderRestrictions")
                .HasForeignKey("ClientId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b =>
            {
                b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
                .WithMany("PostLogoutRedirectUris")
                .HasForeignKey("ClientId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b =>
            {
                b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
                .WithMany("Properties")
                .HasForeignKey("ClientId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b =>
            {
                b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
                .WithMany("RedirectUris")
                .HasForeignKey("ClientId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b =>
            {
                b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
                .WithMany("AllowedScopes")
                .HasForeignKey("ClientId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b =>
            {
                b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
                .WithMany("ClientSecrets")
                .HasForeignKey("ClientId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b =>
            {
                b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource")
                .WithMany("UserClaims")
                .HasForeignKey("IdentityResourceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b =>
            {
                b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource")
                .WithMany("Properties")
                .HasForeignKey("IdentityResourceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b =>
            {
                b.Navigation("Properties");

                b.Navigation("Scopes");

                b.Navigation("Secrets");

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b =>
            {
                b.Navigation("Properties");

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.Client", b =>
            {
                b.Navigation("AllowedCorsOrigins");

                b.Navigation("AllowedGrantTypes");

                b.Navigation("AllowedScopes");

                b.Navigation("Claims");

                b.Navigation("ClientSecrets");

                b.Navigation("IdentityProviderRestrictions");

                b.Navigation("PostLogoutRedirectUris");

                b.Navigation("Properties");

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

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResource", b =>
            {
                b.Navigation("Properties");

                b.Navigation("UserClaims");
            });
#pragma warning restore 612, 618
        }
Beispiel #13
0
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasDefaultSchema("deposits")
            .HasAnnotation("ProductVersion", "6.0.1")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("Service.Bitgo.DepositDetector.Postgres.Models.DepositAddressSqlEntity", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

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

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

                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 <string>("ClientId")
                .HasMaxLength(128)
                .HasColumnType("character varying(128)");

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

                b.Property <string>("Integration")
                .HasMaxLength(64)
                .HasColumnType("character varying(64)");

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

                b.HasKey("Id");

                b.HasIndex("AssetSymbol", "Blockchain", "Address")
                .IsUnique();

                b.HasIndex("BrokerId", "ClientId", "WalletId", "Blockchain", "AssetSymbol")
                .IsUnique();

                b.ToTable("deposit_addresses", "deposits");
            });

            modelBuilder.Entity("Service.Bitgo.DepositDetector.Postgres.Models.DepositEntity", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

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

                b.Property <decimal>("Amount")
                .HasColumnType("numeric");

                b.Property <string>("AssetSymbol")
                .IsRequired()
                .HasMaxLength(64)
                .HasColumnType("character varying(64)");

                b.Property <string>("BrokerId")
                .IsRequired()
                .HasMaxLength(128)
                .HasColumnType("character varying(128)");

                b.Property <string>("CardLast4")
                .IsRequired()
                .ValueGeneratedOnAdd()
                .HasMaxLength(64)
                .HasColumnType("character varying(64)")
                .HasDefaultValue("");

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

                b.Property <string>("Comment")
                .IsRequired()
                .HasMaxLength(512)
                .HasColumnType("character varying(512)");

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

                b.Property <decimal>("FeeAmount")
                .HasColumnType("numeric");

                b.Property <string>("FeeAssetSymbol")
                .IsRequired()
                .HasMaxLength(64)
                .HasColumnType("character varying(64)");

                b.Property <string>("Integration")
                .IsRequired()
                .HasMaxLength(64)
                .HasColumnType("character varying(64)");

                b.Property <string>("LastError")
                .HasMaxLength(1024)
                .HasColumnType("character varying(1024)");

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

                b.Property <string>("Network")
                .IsRequired()
                .ValueGeneratedOnAdd()
                .HasMaxLength(64)
                .HasColumnType("character varying(64)")
                .HasDefaultValue("");

                b.Property <int>("RetriesCount")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer")
                .HasDefaultValue(0);

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

                b.Property <string>("TransactionId")
                .IsRequired()
                .HasMaxLength(128)
                .HasColumnType("character varying(128)");

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

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

                b.Property <string>("WalletId")
                .IsRequired()
                .HasMaxLength(128)
                .HasColumnType("character varying(128)");

                b.HasKey("Id");

                b.HasIndex("Status");

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

                b.ToTable("deposits", "deposits");
            });
#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("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
            .HasAnnotation("ProductVersion", "6.0.0")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("RestfulQr.Domain.ApiKey", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid")
                .HasColumnName("id");

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

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

                b.Property <long>("LocationId")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .HasColumnName("location_id");

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

                b.HasKey("Id");

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

                b.ToTable("api_keys", "identity");
            });

            modelBuilder.Entity("RestfulQr.Domain.RestfulQrCode", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid")
                .HasColumnName("id");

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

                b.Property <Guid>("CreatedBy")
                .HasColumnType("uuid")
                .HasColumnName("created_by");

                b.Property <string>("Filename")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("filename");

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

                b.Property <string>("PublicUrl")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("public_url");

                b.Property <int>("RenderType")
                .HasColumnType("integer")
                .HasColumnName("render_type");

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

                b.HasKey("Id");

                b.HasIndex("CreatedBy");

                b.ToTable("qr_codes", "qr_codes");
            });

            modelBuilder.Entity("RestfulQr.Domain.RestfulQrCode", b =>
            {
                b.HasOne("RestfulQr.Domain.ApiKey", null)
                .WithMany()
                .HasForeignKey("CreatedBy")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });
#pragma warning restore 612, 618
        }
Beispiel #16
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("API.Entities.AppRole", 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("AspNetRoles", (string)null);
            });

            modelBuilder.Entity("API.Entities.AppUser", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

                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 <DateTime>("Created")
                .HasColumnType("timestamp with time zone");

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

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

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

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

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

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

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

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

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

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

                b.Property <string>("LookingFor")
                .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>("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("NormalizedEmail")
                .HasDatabaseName("EmailIndex");

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

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

            modelBuilder.Entity("API.Entities.AppUserRole", b =>
            {
                b.Property <int>("UserId")
                .HasColumnType("integer");

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

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

                b.HasIndex("RoleId");

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

            modelBuilder.Entity("API.Entities.Connection", b =>
            {
                b.Property <string>("ConnectionId")
                .HasColumnType("text");

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

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

                b.HasKey("ConnectionId");

                b.HasIndex("GroupName");

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

            modelBuilder.Entity("API.Entities.Group", b =>
            {
                b.Property <string>("Name")
                .HasColumnType("text");

                b.HasKey("Name");

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

            modelBuilder.Entity("API.Entities.Message", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

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

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

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("RecipientId");

                b.HasIndex("SenderId");

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

            modelBuilder.Entity("API.Entities.Photo", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("AppUserId");

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

            modelBuilder.Entity("API.Entities.UserLike", b =>
            {
                b.Property <int>("SourceUserId")
                .HasColumnType("integer");

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

                b.HasKey("SourceUserId", "LikedUserId");

                b.HasIndex("LikedUserId");

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

            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("AspNetRoleClaims", (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("AspNetUserClaims", (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("AspNetUserLogins", (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("AspNetUserTokens", (string)null);
            });

            modelBuilder.Entity("API.Entities.AppUserRole", b =>
            {
                b.HasOne("API.Entities.AppRole", "Role")
                .WithMany("UserRoles")
                .HasForeignKey("RoleId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("API.Entities.AppUser", "User")
                .WithMany("UserRoles")
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Role");

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

            modelBuilder.Entity("API.Entities.Connection", b =>
            {
                b.HasOne("API.Entities.Group", null)
                .WithMany("Connections")
                .HasForeignKey("GroupName");
            });

            modelBuilder.Entity("API.Entities.Message", b =>
            {
                b.HasOne("API.Entities.AppUser", "Recipient")
                .WithMany("MessagesReceived")
                .HasForeignKey("RecipientId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();

                b.HasOne("API.Entities.AppUser", "Sender")
                .WithMany("MessagesSent")
                .HasForeignKey("SenderId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();

                b.Navigation("Recipient");

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

            modelBuilder.Entity("API.Entities.Photo", b =>
            {
                b.HasOne("API.Entities.AppUser", "AppUser")
                .WithMany("Photos")
                .HasForeignKey("AppUserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("API.Entities.UserLike", b =>
            {
                b.HasOne("API.Entities.AppUser", "LikedUser")
                .WithMany("LikedByUsers")
                .HasForeignKey("LikedUserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("API.Entities.AppUser", "SourceUser")
                .WithMany("LikedUsers")
                .HasForeignKey("SourceUserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("LikedUser");

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

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

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

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

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

            modelBuilder.Entity("API.Entities.AppRole", b =>
            {
                b.Navigation("UserRoles");
            });

            modelBuilder.Entity("API.Entities.AppUser", b =>
            {
                b.Navigation("LikedByUsers");

                b.Navigation("LikedUsers");

                b.Navigation("MessagesReceived");

                b.Navigation("MessagesSent");

                b.Navigation("Photos");

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

            modelBuilder.Entity("API.Entities.Group", b =>
            {
                b.Navigation("Connections");
            });
#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.DatabaseModels.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.DatabaseModels.Category", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

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

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

                b.HasKey("Id");

                b.HasIndex("ParentId");

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

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

            modelBuilder.Entity("DidacticalEnigma.Mem.DatabaseModels.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.DatabaseModels.NpgsqlQuery", b =>
            {
                b.Property <NpgsqlTsVector>("Vec")
                .IsRequired()
                .HasColumnType("tsvector");

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

            modelBuilder.Entity("DidacticalEnigma.Mem.DatabaseModels.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.DatabaseModels.Translation", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

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

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

                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("CategoryId");

                b.HasIndex("CorrelationId");

                b.HasIndex("SearchVector");

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

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

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

            modelBuilder.Entity("DidacticalEnigma.Mem.DatabaseModels.User", b =>
            {
                b.Property <string>("Id")
                .HasColumnType("text");

                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 <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("NormalizedEmail")
                .HasDatabaseName("EmailIndex");

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

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

            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("DidacticalEnigma.Mem.DatabaseModels.Category", b =>
            {
                b.HasOne("DidacticalEnigma.Mem.DatabaseModels.Project", "Parent")
                .WithMany("Categories")
                .HasForeignKey("ParentId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

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

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

                b.Navigation("MediaType");

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

            modelBuilder.Entity("DidacticalEnigma.Mem.DatabaseModels.Translation", b =>
            {
                b.HasOne("DidacticalEnigma.Mem.DatabaseModels.Category", "Category")
                .WithMany("Translations")
                .HasForeignKey("CategoryId")
                .OnDelete(DeleteBehavior.SetNull);

                b.HasOne("DidacticalEnigma.Mem.DatabaseModels.Project", "Parent")
                .WithMany("Translations")
                .HasForeignKey("ParentId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Category");

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

            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("DidacticalEnigma.Mem.DatabaseModels.User", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

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

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

                b.HasOne("DidacticalEnigma.Mem.DatabaseModels.User", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

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

            modelBuilder.Entity("DidacticalEnigma.Mem.DatabaseModels.Category", b =>
            {
                b.Navigation("Translations");
            });

            modelBuilder.Entity("DidacticalEnigma.Mem.DatabaseModels.Project", b =>
            {
                b.Navigation("Categories");

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

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("ThanksCardAPI.Models.Department", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("ParentId");

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

            modelBuilder.Entity("ThanksCardAPI.Models.Tag", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

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

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

                b.HasKey("Id");

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

            modelBuilder.Entity("ThanksCardAPI.Models.ThanksCard", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("FromId");

                b.HasIndex("ToId");

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

            modelBuilder.Entity("ThanksCardAPI.Models.ThanksCardTag", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

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

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

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

                b.HasKey("Id");

                b.HasIndex("TagId");

                b.HasIndex("ThanksCardId");

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

            modelBuilder.Entity("ThanksCardAPI.Models.User", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("DepartmentId");

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

            modelBuilder.Entity("ThanksCardAPI.Models.Department", b =>
            {
                b.HasOne("ThanksCardAPI.Models.Department", "Parent")
                .WithMany("Children")
                .HasForeignKey("ParentId");

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

            modelBuilder.Entity("ThanksCardAPI.Models.ThanksCard", b =>
            {
                b.HasOne("ThanksCardAPI.Models.User", "From")
                .WithMany()
                .HasForeignKey("FromId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("ThanksCardAPI.Models.User", "To")
                .WithMany()
                .HasForeignKey("ToId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("From");

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

            modelBuilder.Entity("ThanksCardAPI.Models.ThanksCardTag", b =>
            {
                b.HasOne("ThanksCardAPI.Models.Tag", "Tag")
                .WithMany("ThanksCardTags")
                .HasForeignKey("TagId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("ThanksCardAPI.Models.ThanksCard", "ThanksCard")
                .WithMany("ThanksCardTags")
                .HasForeignKey("ThanksCardId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Tag");

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

            modelBuilder.Entity("ThanksCardAPI.Models.User", b =>
            {
                b.HasOne("ThanksCardAPI.Models.Department", "Department")
                .WithMany("Users")
                .HasForeignKey("DepartmentId");

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

            modelBuilder.Entity("ThanksCardAPI.Models.Department", b =>
            {
                b.Navigation("Children");

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

            modelBuilder.Entity("ThanksCardAPI.Models.Tag", b =>
            {
                b.Navigation("ThanksCardTags");
            });

            modelBuilder.Entity("ThanksCardAPI.Models.ThanksCard", b =>
            {
                b.Navigation("ThanksCardTags");
            });
#pragma warning restore 612, 618
        }
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasDefaultSchema("RoleplayModule")
            .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.Roleplaying.Model.Roleplay", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .HasColumnName("id");

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

                b.Property <long?>("ActiveChannelID")
                .HasColumnType("bigint")
                .HasColumnName("active_channel_id");

                b.Property <long?>("DedicatedChannelID")
                .HasColumnType("bigint")
                .HasColumnName("dedicated_channel_id");

                b.Property <bool>("IsActive")
                .HasColumnType("boolean")
                .HasColumnName("is_active");

                b.Property <bool>("IsNSFW")
                .HasColumnType("boolean")
                .HasColumnName("is_nsfw");

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

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

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

                b.Property <long>("OwnerID")
                .HasColumnType("bigint")
                .HasColumnName("owner_id");

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

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

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

                b.HasIndex("OwnerID")
                .HasDatabaseName("ix_roleplays_owner_id");

                b.HasIndex("ServerID")
                .HasDatabaseName("ix_roleplays_server_id");

                b.ToTable("Roleplays", "RoleplayModule");
            });

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

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

                b.Property <long>("RoleplayID")
                .HasColumnType("bigint")
                .HasColumnName("roleplay_id");

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

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

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

                b.HasIndex("RoleplayID")
                .HasDatabaseName("ix_roleplay_participants_roleplay_id");

                b.HasIndex("UserID")
                .HasDatabaseName("ix_roleplay_participants_user_id");

                b.ToTable("RoleplayParticipants", "RoleplayModule");
            });

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

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

                b.Property <long?>("ArchiveChannel")
                .HasColumnType("bigint")
                .HasColumnName("archive_channel");

                b.Property <long?>("DedicatedRoleplayChannelsCategory")
                .HasColumnType("bigint")
                .HasColumnName("dedicated_roleplay_channels_category");

                b.Property <long?>("DefaultUserRole")
                .HasColumnType("bigint")
                .HasColumnName("default_user_role");

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

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

                b.HasIndex("ServerID")
                .HasDatabaseName("ix_server_settings_server_id");

                b.ToTable("ServerSettings", "RoleplayModule");
            });

            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Roleplaying.Model.UserMessage", 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>("AuthorNickname")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("author_nickname");

                b.Property <string>("Contents")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("contents");

                b.Property <long>("DiscordMessageID")
                .HasColumnType("bigint")
                .HasColumnName("discord_message_id");

                b.Property <long?>("RoleplayID")
                .HasColumnType("bigint")
                .HasColumnName("roleplay_id");

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

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

                b.HasIndex("AuthorID")
                .HasDatabaseName("ix_user_messages_author_id");

                b.HasIndex("RoleplayID")
                .HasDatabaseName("ix_user_messages_roleplay_id");

                b.ToTable("UserMessages", "RoleplayModule");
            });

            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.Roleplaying.Model.Roleplay", b =>
            {
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Users.User", "Owner")
                .WithMany()
                .HasForeignKey("OwnerID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_roleplays_users_owner_id");

                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Servers.Server", "Server")
                .WithMany()
                .HasForeignKey("ServerID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_roleplays_servers_server_id");

                b.Navigation("Owner");

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

            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Roleplaying.Model.RoleplayParticipant", b =>
            {
                b.HasOne("DIGOS.Ambassador.Plugins.Roleplaying.Model.Roleplay", "Roleplay")
                .WithMany("ParticipatingUsers")
                .HasForeignKey("RoleplayID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_roleplay_participants_roleplays_roleplay_id");

                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Users.User", "User")
                .WithMany()
                .HasForeignKey("UserID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_roleplay_participants_users_user_id");

                b.Navigation("Roleplay");

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

            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Roleplaying.Model.ServerRoleplaySettings", b =>
            {
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Servers.Server", "Server")
                .WithMany()
                .HasForeignKey("ServerID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_server_settings_servers_server_id");

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

            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Roleplaying.Model.UserMessage", b =>
            {
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Users.User", "Author")
                .WithMany()
                .HasForeignKey("AuthorID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_user_messages_users_author_id");

                b.HasOne("DIGOS.Ambassador.Plugins.Roleplaying.Model.Roleplay", null)
                .WithMany("Messages")
                .HasForeignKey("RoleplayID")
                .HasConstraintName("fk_user_messages_roleplays_roleplay_id");

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

            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Core.Model.Servers.Server", b =>
            {
                b.Navigation("KnownUsers");
            });

            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Roleplaying.Model.Roleplay", b =>
            {
                b.Navigation("Messages");

                b.Navigation("ParticipatingUsers");
            });
#pragma warning restore 612, 618
        }
Beispiel #20
0
        protected override void BuildModel(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
        }
Beispiel #21
0
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasDefaultSchema("balancehistory")
            .HasAnnotation("ProductVersion", "6.0.1")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("Service.BalanceHistory.Domain.Models.SnapshotEntity", b =>
            {
                b.Property <string>("WalletId")
                .HasMaxLength(128)
                .HasColumnType("character varying(128)");

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

                b.Property <decimal>("AvgOpenPrice")
                .HasColumnType("numeric");

                b.Property <decimal>("Balance")
                .HasColumnType("numeric");

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

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

                b.HasKey("WalletId", "AssetId");

                b.HasIndex("WalletId");

                b.HasIndex("WalletId", "AssetId", "LastTimestamp");

                b.ToTable("avgprice_snapshots", "balancehistory");
            });

            modelBuilder.Entity("Service.BalanceHistory.Postgres.Models.BalanceHistoryEntity", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

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

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

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

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

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

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

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

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

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

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

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

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

                b.Property <string>("Symbol")
                .HasMaxLength(64)
                .HasColumnType("character varying(64)");

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

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

                b.HasKey("Id");

                b.HasIndex("OperationId");

                b.HasIndex("SequenceId");

                b.HasIndex("WalletId");

                b.HasIndex("WalletId", "SequenceId");

                b.HasIndex("WalletId", "Symbol");

                b.HasIndex("OperationId", "WalletId", "Symbol")
                .IsUnique();

                b.HasIndex("WalletId", "Symbol", "SequenceId");

                b.HasIndex("WalletId", "Symbol", "Timestamp");

                b.ToTable("balance_history", "balancehistory");
            });

            modelBuilder.Entity("Service.BalanceHistory.Postgres.Models.OperationHistoryEntity", b =>
            {
                b.Property <string>("OperationId")
                .HasMaxLength(128)
                .HasColumnType("character varying(128)");

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

                b.Property <string>("AssetId")
                .HasMaxLength(64)
                .HasColumnType("character varying(64)");

                b.Property <decimal>("Amount")
                .HasColumnType("numeric");

                b.Property <decimal>("AssetPriceInUsd")
                .HasColumnType("numeric");

                b.Property <decimal>("AvgOpenPrice")
                .HasColumnType("numeric");

                b.Property <decimal>("Balance")
                .HasColumnType("numeric");

                b.Property <decimal>("BuyAmount")
                .HasColumnType("numeric");

                b.Property <string>("BuyAssetId")
                .HasMaxLength(64)
                .HasColumnType("character varying(64)");

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

                b.Property <string>("Comment")
                .HasMaxLength(2048)
                .HasColumnType("character varying(2048)");

                b.Property <decimal>("DepositAmount")
                .HasColumnType("numeric");

                b.Property <decimal>("FeeAmount")
                .HasColumnType("numeric");

                b.Property <string>("FeeAssetId")
                .HasMaxLength(64)
                .HasColumnType("character varying(64)");

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

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

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

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

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

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

                b.Property <decimal>("SellAmount")
                .HasColumnType("numeric");

                b.Property <string>("SellAssetId")
                .HasMaxLength(64)
                .HasColumnType("character varying(64)");

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

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

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

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

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

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

                b.Property <decimal>("WithdrawalAmount")
                .HasColumnType("numeric");

                b.Property <string>("WithdrawalAssetId")
                .HasMaxLength(64)
                .HasColumnType("character varying(64)");

                b.HasKey("OperationId", "WalletId", "AssetId");

                b.HasIndex("OperationId");

                b.HasIndex("WalletId");

                b.HasIndex("WalletId", "TimeStamp");

                b.HasIndex("WalletId", "AssetId", "TimeStamp");

                b.ToTable("operation_history", "balancehistory");
            });

            modelBuilder.Entity("Service.ChangeBalanceGateway.Grpc.Models.ManualChangeBalanceMessage", b =>
            {
                b.Property <string>("TransactionId")
                .HasColumnType("text");

                b.Property <decimal>("Amount")
                .HasColumnType("numeric");

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

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

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

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

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

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

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

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

                b.HasKey("TransactionId");

                b.ToTable("manual_change_audit", "balancehistory");
            });
#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 <string>("BlockingReason")
                .HasColumnType("text");

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

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

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

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

                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 BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.0")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

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

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

                b.Property <decimal>("AbsoluteDelay")
                .HasColumnType("numeric")
                .HasColumnName("absolute_delay");

                b.Property <int>("Index")
                .HasColumnType("integer")
                .HasColumnName("index");

                b.Property <string>("Key")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("key");

                b.Property <int>("KeyAction")
                .HasColumnType("integer")
                .HasColumnName("key_action");

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

                b.Property <string>("TextTypingResultId")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("text_typing_result_id");

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

                b.HasIndex("Order")
                .HasDatabaseName("ix_key_press_event_order");

                b.HasIndex("TextTypingResultId")
                .HasDatabaseName("ix_key_press_event_text_typing_result_id");

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

            modelBuilder.Entity("TypingRealm.Data.Infrastructure.DataAccess.Entities.Text", b =>
            {
                b.Property <string>("Id")
                .HasColumnType("text")
                .HasColumnName("id");

                b.Property <string>("CreatedByUser")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("created_by_user");

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

                b.Property <int?>("GenerationLength")
                .HasColumnType("integer")
                .HasColumnName("generation_length");

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

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

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

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

                b.Property <int?>("TextGenerationType")
                .HasColumnType("integer")
                .HasColumnName("text_generation_type");

                b.Property <int>("TextType")
                .HasColumnType("integer")
                .HasColumnName("text_type");

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

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

                b.HasIndex("CreatedByUser")
                .HasDatabaseName("ix_text_created_by_user");

                b.HasIndex("CreatedUtc")
                .HasDatabaseName("ix_text_created_utc");

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

                b.HasIndex("IsPublic")
                .HasDatabaseName("ix_text_is_public");

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

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

            modelBuilder.Entity("TypingRealm.Data.Infrastructure.DataAccess.Entities.TextTypingResult", b =>
            {
                b.Property <string>("Id")
                .HasColumnType("text")
                .HasColumnName("id");

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

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

                b.Property <int>("TypingSessionTextIndex")
                .HasColumnType("integer")
                .HasColumnName("typing_session_text_index");

                b.Property <string>("UserSessionId")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("user_session_id");

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

                b.HasIndex("StartedTypingUtc")
                .HasDatabaseName("ix_text_typing_result_started_typing_utc");

                b.HasIndex("SubmittedResultsUtc")
                .HasDatabaseName("ix_text_typing_result_submitted_results_utc");

                b.HasIndex("TypingSessionTextIndex")
                .HasDatabaseName("ix_text_typing_result_typing_session_text_index");

                b.HasIndex("UserSessionId")
                .HasDatabaseName("ix_text_typing_result_user_session_id");

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

            modelBuilder.Entity("TypingRealm.Data.Infrastructure.DataAccess.Entities.TypingSession", b =>
            {
                b.Property <string>("Id")
                .HasColumnType("text")
                .HasColumnName("id");

                b.Property <string>("CreatedByUser")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("created_by_user");

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

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

                b.HasIndex("CreatedByUser")
                .HasDatabaseName("ix_typing_session_created_by_user");

                b.HasIndex("CreatedUtc")
                .HasDatabaseName("ix_typing_session_created_utc");

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

            modelBuilder.Entity("TypingRealm.Data.Infrastructure.DataAccess.Entities.TypingSessionText", b =>
            {
                b.Property <long>("RowId")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .HasColumnName("row_id");

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

                b.Property <int>("IndexInTypingSession")
                .HasColumnType("integer")
                .HasColumnName("index_in_typing_session");

                b.Property <string>("TextId")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("text_id");

                b.Property <string>("TypingSessionId")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("typing_session_id");

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

                b.HasKey("RowId")
                .HasName("pk_typing_session_text");

                b.HasIndex("TextId")
                .HasDatabaseName("ix_typing_session_text_text_id");

                b.HasIndex("TypingSessionId")
                .HasDatabaseName("ix_typing_session_text_typing_session_id");

                b.HasIndex("IndexInTypingSession", "TypingSessionId")
                .IsUnique()
                .HasDatabaseName("ix_typing_session_text_index_in_typing_session_typing_session_");

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

            modelBuilder.Entity("TypingRealm.Data.Infrastructure.DataAccess.Entities.UserSession", b =>
            {
                b.Property <string>("Id")
                .HasColumnType("text")
                .HasColumnName("id");

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

                b.Property <string>("TypingSessionId")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("typing_session_id");

                b.Property <string>("UserId")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("user_id");

                b.Property <int>("UserTimeZoneOffsetMinutes")
                .HasColumnType("integer")
                .HasColumnName("user_time_zone_offset_minutes");

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

                b.HasIndex("TypingSessionId")
                .HasDatabaseName("ix_user_session_typing_session_id");

                b.HasIndex("UserId")
                .HasDatabaseName("ix_user_session_user_id");

                b.HasIndex("CreatedUtc", "UserTimeZoneOffsetMinutes")
                .HasDatabaseName("ix_user_session_created_utc_user_time_zone_offset_minutes");

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

            modelBuilder.Entity("TypingRealm.Data.Infrastructure.DataAccess.Entities.KeyPressEvent", b =>
            {
                b.HasOne("TypingRealm.Data.Infrastructure.DataAccess.Entities.TextTypingResult", "TextTypingResult")
                .WithMany("Events")
                .HasForeignKey("TextTypingResultId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_key_press_event_text_typing_result_text_typing_result_id");

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

            modelBuilder.Entity("TypingRealm.Data.Infrastructure.DataAccess.Entities.TextTypingResult", b =>
            {
                b.HasOne("TypingRealm.Data.Infrastructure.DataAccess.Entities.UserSession", "UserSession")
                .WithMany("TextTypingResults")
                .HasForeignKey("UserSessionId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_text_typing_result_user_session_user_session_id");

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

            modelBuilder.Entity("TypingRealm.Data.Infrastructure.DataAccess.Entities.TypingSessionText", b =>
            {
                b.HasOne("TypingRealm.Data.Infrastructure.DataAccess.Entities.Text", "Text")
                .WithMany()
                .HasForeignKey("TextId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_typing_session_text_text_text_id");

                b.HasOne("TypingRealm.Data.Infrastructure.DataAccess.Entities.TypingSession", "TypingSession")
                .WithMany("Texts")
                .HasForeignKey("TypingSessionId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_typing_session_text_typing_session_typing_session_id");

                b.Navigation("Text");

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

            modelBuilder.Entity("TypingRealm.Data.Infrastructure.DataAccess.Entities.UserSession", b =>
            {
                b.HasOne("TypingRealm.Data.Infrastructure.DataAccess.Entities.TypingSession", "TypingSession")
                .WithMany()
                .HasForeignKey("TypingSessionId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired()
                .HasConstraintName("fk_user_session_typing_session_typing_session_id");

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

            modelBuilder.Entity("TypingRealm.Data.Infrastructure.DataAccess.Entities.TextTypingResult", b =>
            {
                b.Navigation("Events");
            });

            modelBuilder.Entity("TypingRealm.Data.Infrastructure.DataAccess.Entities.TypingSession", b =>
            {
                b.Navigation("Texts");
            });

            modelBuilder.Entity("TypingRealm.Data.Infrastructure.DataAccess.Entities.UserSession", b =>
            {
                b.Navigation("TextTypingResults");
            });
#pragma warning restore 612, 618
        }
Beispiel #24
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("EMSApp.Core.Entities.Action", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("PageId");

                b.ToTable("Action");

                b.HasData(
                    new
                {
                    Id        = 7,
                    CreatedOn = new DateTime(2022, 3, 30, 22, 58, 25, 777, DateTimeKind.Local).AddTicks(6365),
                    Name      = "view",
                    PageId    = 1
                },
                    new
                {
                    Id        = 1,
                    CreatedOn = new DateTime(2022, 3, 30, 22, 58, 25, 777, DateTimeKind.Local).AddTicks(6367),
                    Name      = "create",
                    PageId    = 2,
                    Url       = "create"
                },
                    new
                {
                    Id        = 2,
                    CreatedOn = new DateTime(2022, 3, 30, 22, 58, 25, 777, DateTimeKind.Local).AddTicks(6369),
                    Name      = "edit",
                    PageId    = 2,
                    Url       = "edit"
                },
                    new
                {
                    Id        = 3,
                    CreatedOn = new DateTime(2022, 3, 30, 22, 58, 25, 777, DateTimeKind.Local).AddTicks(6372),
                    Name      = "delete",
                    PageId    = 2
                },
                    new
                {
                    Id        = 4,
                    CreatedOn = new DateTime(2022, 3, 30, 22, 58, 25, 777, DateTimeKind.Local).AddTicks(6373),
                    Name      = "create",
                    PageId    = 3,
                    Url       = "create"
                },
                    new
                {
                    Id        = 5,
                    CreatedOn = new DateTime(2022, 3, 30, 22, 58, 25, 777, DateTimeKind.Local).AddTicks(6375),
                    Name      = "edit",
                    PageId    = 3,
                    Url       = "edit"
                },
                    new
                {
                    Id        = 6,
                    CreatedOn = new DateTime(2022, 3, 30, 22, 58, 25, 777, DateTimeKind.Local).AddTicks(6377),
                    Name      = "delete",
                    PageId    = 3
                });
            });

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

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

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

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

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

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

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

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

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

                b.HasKey("Id");

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

                b.HasIndex("TenantId");

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

            modelBuilder.Entity("EMSApp.Core.Entities.ApplicationRoleAction", b =>
            {
                b.Property <Guid>("ApplicationRoleId")
                .HasColumnType("uuid");

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

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

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

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

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

                b.HasKey("ApplicationRoleId", "ActionId");

                b.HasIndex("ActionId");

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

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

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

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

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

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

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

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

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

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

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

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

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

                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 <Guid>("TenantId")
                .HasColumnType("uuid");

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

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

                b.HasKey("Id");

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

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

                b.HasIndex("TenantId");

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

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

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

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

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

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

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

                b.HasKey("Id");

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

            modelBuilder.Entity("EMSApp.Core.Entities.LicenceModule", b =>
            {
                b.Property <Guid>("LicenceId")
                .HasColumnType("uuid");

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

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

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

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

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

                b.HasKey("LicenceId", "ModuleId");

                b.HasIndex("ModuleId");

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

            modelBuilder.Entity("EMSApp.Core.Entities.Module", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

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

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

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

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

                b.HasKey("Id");

                b.ToTable("Module");

                b.HasData(
                    new
                {
                    Id        = 1,
                    CreatedOn = new DateTime(2022, 3, 30, 22, 58, 25, 777, DateTimeKind.Local).AddTicks(6193),
                    Name      = "Dashboard"
                },
                    new
                {
                    Id        = 2,
                    CreatedOn = new DateTime(2022, 3, 30, 22, 58, 25, 777, DateTimeKind.Local).AddTicks(6196),
                    Name      = "Fair"
                },
                    new
                {
                    Id        = 3,
                    CreatedOn = new DateTime(2022, 3, 30, 22, 58, 25, 777, DateTimeKind.Local).AddTicks(6198),
                    Name      = "Firm"
                });
            });

            modelBuilder.Entity("EMSApp.Core.Entities.Page", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

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

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

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

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

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

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

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("ModuleId");

                b.ToTable("Page");

                b.HasData(
                    new
                {
                    Id        = 1,
                    Component = "dashboard",
                    CreatedOn = new DateTime(2022, 3, 30, 22, 58, 25, 777, DateTimeKind.Local).AddTicks(6342),
                    FileUrl   = "./views/dashboard/analytics/AnalyticsDashboard",
                    Icon      = "Home",
                    ModuleId  = 1,
                    Name      = "view",
                    Url       = "dashboard"
                },
                    new
                {
                    Id        = 2,
                    Component = "fair",
                    CreatedOn = new DateTime(2022, 3, 30, 22, 58, 25, 777, DateTimeKind.Local).AddTicks(6346),
                    FileUrl   = "./views/fair/Fairs",
                    Icon      = "Layout",
                    ModuleId  = 2,
                    Name      = "list",
                    Url       = "fair"
                },
                    new
                {
                    Id        = 3,
                    Component = "firm",
                    CreatedOn = new DateTime(2022, 3, 30, 22, 58, 25, 777, DateTimeKind.Local).AddTicks(6348),
                    FileUrl   = "./views/fair/Firms",
                    Icon      = "Briefcase",
                    ModuleId  = 3,
                    Name      = "list",
                    Url       = "firm"
                });
            });

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

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

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

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

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

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

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("ApplicationUserId");

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

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

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

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

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

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

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("TenantSettingId");

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

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

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

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

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

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

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("TenantId");

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

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

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

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

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("TenantContactId");

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

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

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

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

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

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("LicenceId");

                b.HasIndex("TenantId");

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

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

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

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

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

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

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

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

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

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

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

                b.HasKey("Id");

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

            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("EMSApp.Core.Entities.Action", b =>
            {
                b.HasOne("EMSApp.Core.Entities.Page", "Page")
                .WithMany("Actions")
                .HasForeignKey("PageId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("EMSApp.Core.Entities.ApplicationRole", b =>
            {
                b.HasOne("EMSApp.Core.Entities.Tenant", "Tenant")
                .WithMany()
                .HasForeignKey("TenantId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("EMSApp.Core.Entities.ApplicationRoleAction", b =>
            {
                b.HasOne("EMSApp.Core.Entities.Action", "Action")
                .WithMany("AppRoleActions")
                .HasForeignKey("ActionId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("EMSApp.Core.Entities.ApplicationRole", "ApplicationRole")
                .WithMany("AppRoleActions")
                .HasForeignKey("ApplicationRoleId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Action");

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

            modelBuilder.Entity("EMSApp.Core.Entities.ApplicationUser", b =>
            {
                b.HasOne("EMSApp.Core.Entities.Tenant", "Tenant")
                .WithMany()
                .HasForeignKey("TenantId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("EMSApp.Core.Entities.LicenceModule", b =>
            {
                b.HasOne("EMSApp.Core.Entities.Licence", "Licence")
                .WithMany("LicenceModules")
                .HasForeignKey("LicenceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("EMSApp.Core.Entities.Module", "Module")
                .WithMany("LicenceModules")
                .HasForeignKey("ModuleId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Licence");

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

            modelBuilder.Entity("EMSApp.Core.Entities.Page", b =>
            {
                b.HasOne("EMSApp.Core.Entities.Module", "Module")
                .WithMany("Pages")
                .HasForeignKey("ModuleId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("EMSApp.Core.Entities.RefreshToken", b =>
            {
                b.HasOne("EMSApp.Core.Entities.ApplicationUser", "ApplicationUser")
                .WithMany()
                .HasForeignKey("ApplicationUserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("EMSApp.Core.Entities.Tenant", b =>
            {
                b.HasOne("EMSApp.Core.Entities.TenantSetting", "TenantSetting")
                .WithMany()
                .HasForeignKey("TenantSettingId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("EMSApp.Core.Entities.TenantContact", b =>
            {
                b.HasOne("EMSApp.Core.Entities.Tenant", "Tenant")
                .WithMany("Responsibles")
                .HasForeignKey("TenantId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("EMSApp.Core.Entities.TenantContactToken", b =>
            {
                b.HasOne("EMSApp.Core.Entities.TenantContact", "TenantContact")
                .WithMany("Tokens")
                .HasForeignKey("TenantContactId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

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

            modelBuilder.Entity("EMSApp.Core.Entities.TenantLicence", b =>
            {
                b.HasOne("EMSApp.Core.Entities.Licence", "Licence")
                .WithMany()
                .HasForeignKey("LicenceId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("EMSApp.Core.Entities.Tenant", "Tenant")
                .WithMany("Licences")
                .HasForeignKey("TenantId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Licence");

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

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

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

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

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

                b.HasOne("EMSApp.Core.Entities.ApplicationUser", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

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

            modelBuilder.Entity("EMSApp.Core.Entities.Action", b =>
            {
                b.Navigation("AppRoleActions");
            });

            modelBuilder.Entity("EMSApp.Core.Entities.ApplicationRole", b =>
            {
                b.Navigation("AppRoleActions");
            });

            modelBuilder.Entity("EMSApp.Core.Entities.Licence", b =>
            {
                b.Navigation("LicenceModules");
            });

            modelBuilder.Entity("EMSApp.Core.Entities.Module", b =>
            {
                b.Navigation("LicenceModules");

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

            modelBuilder.Entity("EMSApp.Core.Entities.Page", b =>
            {
                b.Navigation("Actions");
            });

            modelBuilder.Entity("EMSApp.Core.Entities.Tenant", b =>
            {
                b.Navigation("Licences");

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

            modelBuilder.Entity("EMSApp.Core.Entities.TenantContact", b =>
            {
                b.Navigation("Tokens");
            });
#pragma warning restore 612, 618
        }
        protected override void BuildModel(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")
                .HasColumnType("text");

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

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

                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 BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "6.0.3")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("InfoEducatie.Contest.Categories.CategoryEntity", b =>
            {
                b.Property <string>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("text");

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

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("Order");

                b.HasIndex("Published");

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

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

            modelBuilder.Entity("InfoEducatie.Contest.Judging.Judges.JudgeEntity", b =>
            {
                b.Property <string>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("text");

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("CategoryId");

                b.HasIndex("UserId");

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

            modelBuilder.Entity("InfoEducatie.Contest.Judging.JudgingCriteria.JudgingCriteriaSection.JudgingCriteriaSectionEntity", b =>
            {
                b.Property <string>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("text");

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("CategoryId");

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

            modelBuilder.Entity("InfoEducatie.Contest.Judging.JudgingCriteria.JudgingCriterionEntity", b =>
            {
                b.Property <string>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("text");

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

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

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

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("CategoryId");

                b.HasIndex("Order");

                b.HasIndex("SectionId");

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

            modelBuilder.Entity("InfoEducatie.Contest.Judging.ProjectJudgingCriterionPoints.ProjectJudgingCriterionPointsEntity", b =>
            {
                b.Property <string>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("text");

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("CriterionId");

                b.HasIndex("JudgeId");

                b.HasIndex("ProjectId");

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

            modelBuilder.Entity("InfoEducatie.Contest.Participants.Participant.ParticipantEntity", b =>
            {
                b.Property <string>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("text");

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("UserId");

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

            modelBuilder.Entity("InfoEducatie.Contest.Participants.Project.ProjectEntity", b =>
            {
                b.Property <string>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("text");

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("CategoryId");

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

            modelBuilder.Entity("InfoEducatie.Main.Pages.PageEntity", b =>
            {
                b.Property <string>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("text");

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

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

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

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("Order");

                b.HasIndex("Published");

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

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

            modelBuilder.Entity("InfoEducatie.Main.Seminars.SeminarEntity", b =>
            {
                b.Property <string>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("text");

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

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

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

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

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

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

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

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

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

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

                b.HasKey("Id");

                b.HasIndex("Published");

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

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

            modelBuilder.Entity("MCMS.Base.Auth.Role", b =>
            {
                b.Property <string>("Id")
                .HasColumnType("text");

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

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

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

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

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

                b.HasKey("Id");

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

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

            modelBuilder.Entity("MCMS.Base.Auth.User", b =>
            {
                b.Property <string>("Id")
                .HasColumnType("text");

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

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

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

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

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

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

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

                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 <DateTime>("Updated")
                .HasColumnType("timestamp without time zone");

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

                b.HasKey("Id");

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

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

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

            modelBuilder.Entity("MCMS.Base.Auth.UserRole", 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("MCMS.Common.Translations.Languages.LanguageEntity", b =>
            {
                b.Property <string>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("text");

                b.Property <string>("Code")
                .HasColumnType("text");

                b.Property <DateTime>("Created")
                .HasColumnType("timestamp without time zone");

                b.Property <string>("Name")
                .HasColumnType("text");

                b.Property <DateTime>("Updated")
                .HasColumnType("timestamp without time zone");

                b.HasKey("Id");

                b.ToTable("Languages", (string)null);
            });

            modelBuilder.Entity("MCMS.Common.Translations.Translations.Item.TranslationItemEntity", b =>
            {
                b.Property <string>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("text");

                b.Property <DateTime>("Created")
                .HasColumnType("timestamp without time zone");

                b.Property <string>("LanguageId")
                .IsRequired()
                .HasColumnType("text");

                b.Property <string>("TranslationId")
                .IsRequired()
                .HasColumnType("text");

                b.Property <DateTime>("Updated")
                .HasColumnType("timestamp without time zone");

                b.Property <string>("Value")
                .HasColumnType("text");

                b.HasKey("Id");

                b.HasIndex("LanguageId");

                b.HasIndex("TranslationId");

                b.ToTable("TranslationItems", (string)null);
            });

            modelBuilder.Entity("MCMS.Common.Translations.Translations.TranslationEntity", b =>
            {
                b.Property <string>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("text");

                b.Property <DateTime>("Created")
                .HasColumnType("timestamp without time zone");

                b.Property <bool>("IsRichText")
                .HasColumnType("boolean");

                b.Property <string>("Slug")
                .IsRequired()
                .HasColumnType("text");

                b.Property <string>("Tag")
                .HasColumnType("text");

                b.Property <DateTime>("Updated")
                .HasColumnType("timestamp without time zone");

                b.HasKey("Id");

                b.HasIndex("Slug")
                .IsUnique();

                b.ToTable("Translations", (string)null);
            });

            modelBuilder.Entity("MCMS.Files.Models.FileEntity", b =>
            {
                b.Property <string>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("text");

                b.Property <bool>("Claimed")
                .HasColumnType("boolean");

                b.Property <DateTime>("Created")
                .HasColumnType("timestamp without time zone");

                b.Property <string>("Description")
                .HasColumnType("text");

                b.Property <string>("Extension")
                .HasColumnType("text");

                b.Property <string>("Name")
                .HasColumnType("text");

                b.Property <string>("OriginalName")
                .HasColumnType("text");

                b.Property <string>("OwnerToken")
                .HasColumnType("text");

                b.Property <string>("PhysicalPath")
                .HasColumnType("text");

                b.Property <bool>("Protected")
                .HasColumnType("boolean");

                b.Property <string>("Purpose")
                .HasColumnType("text");

                b.Property <long>("Size")
                .HasColumnType("bigint");

                b.Property <DateTime>("Updated")
                .HasColumnType("timestamp without time zone");

                b.Property <string>("VirtualPath")
                .HasColumnType("text");

                b.HasKey("Id");

                b.ToTable("Files", (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.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("ParticipantEntityProjectEntity", b =>
            {
                b.Property <string>("ParticipantsId")
                .HasColumnType("text");

                b.Property <string>("ProjectsId")
                .HasColumnType("text");

                b.HasKey("ParticipantsId", "ProjectsId");

                b.HasIndex("ProjectsId");

                b.ToTable("ProjectParticipants", (string)null);
            });

            modelBuilder.Entity("InfoEducatie.Contest.Judging.Judges.JudgeEntity", b =>
            {
                b.HasOne("InfoEducatie.Contest.Categories.CategoryEntity", "Category")
                .WithMany()
                .HasForeignKey("CategoryId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("MCMS.Base.Auth.User", "User")
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade);

                b.Navigation("Category");

                b.Navigation("User");
            });

            modelBuilder.Entity("InfoEducatie.Contest.Judging.JudgingCriteria.JudgingCriteriaSection.JudgingCriteriaSectionEntity", b =>
            {
                b.HasOne("InfoEducatie.Contest.Categories.CategoryEntity", "Category")
                .WithMany()
                .HasForeignKey("CategoryId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();

                b.Navigation("Category");
            });

            modelBuilder.Entity("InfoEducatie.Contest.Judging.JudgingCriteria.JudgingCriterionEntity", b =>
            {
                b.HasOne("InfoEducatie.Contest.Categories.CategoryEntity", "Category")
                .WithMany()
                .HasForeignKey("CategoryId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("InfoEducatie.Contest.Judging.JudgingCriteria.JudgingCriteriaSection.JudgingCriteriaSectionEntity", "Section")
                .WithMany("Criteria")
                .HasForeignKey("SectionId")
                .OnDelete(DeleteBehavior.Restrict)
                .IsRequired();

                b.Navigation("Category");

                b.Navigation("Section");
            });

            modelBuilder.Entity("InfoEducatie.Contest.Judging.ProjectJudgingCriterionPoints.ProjectJudgingCriterionPointsEntity", b =>
            {
                b.HasOne("InfoEducatie.Contest.Judging.JudgingCriteria.JudgingCriterionEntity", "Criterion")
                .WithMany()
                .HasForeignKey("CriterionId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("InfoEducatie.Contest.Judging.Judges.JudgeEntity", "Judge")
                .WithMany()
                .HasForeignKey("JudgeId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("InfoEducatie.Contest.Participants.Project.ProjectEntity", "Project")
                .WithMany()
                .HasForeignKey("ProjectId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Criterion");

                b.Navigation("Judge");

                b.Navigation("Project");
            });

            modelBuilder.Entity("InfoEducatie.Contest.Participants.Participant.ParticipantEntity", b =>
            {
                b.HasOne("MCMS.Base.Auth.User", "User")
                .WithMany()
                .HasForeignKey("UserId");

                b.Navigation("User");
            });

            modelBuilder.Entity("InfoEducatie.Contest.Participants.Project.ProjectEntity", b =>
            {
                b.HasOne("InfoEducatie.Contest.Categories.CategoryEntity", "Category")
                .WithMany()
                .HasForeignKey("CategoryId");

                b.Navigation("Category");
            });

            modelBuilder.Entity("MCMS.Base.Auth.UserRole", b =>
            {
                b.HasOne("MCMS.Base.Auth.Role", "Role")
                .WithMany()
                .HasForeignKey("RoleId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("MCMS.Base.Auth.User", null)
                .WithMany("UserRoles")
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Role");
            });

            modelBuilder.Entity("MCMS.Common.Translations.Translations.Item.TranslationItemEntity", b =>
            {
                b.HasOne("MCMS.Common.Translations.Languages.LanguageEntity", "Language")
                .WithMany()
                .HasForeignKey("LanguageId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("MCMS.Common.Translations.Translations.TranslationEntity", "Translation")
                .WithMany("Items")
                .HasForeignKey("TranslationId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Language");

                b.Navigation("Translation");
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
            {
                b.HasOne("MCMS.Base.Auth.Role", null)
                .WithMany()
                .HasForeignKey("RoleId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
            {
                b.HasOne("MCMS.Base.Auth.User", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
            {
                b.HasOne("MCMS.Base.Auth.User", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
            {
                b.HasOne("MCMS.Base.Auth.User", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("ParticipantEntityProjectEntity", b =>
            {
                b.HasOne("InfoEducatie.Contest.Participants.Participant.ParticipantEntity", null)
                .WithMany()
                .HasForeignKey("ParticipantsId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("InfoEducatie.Contest.Participants.Project.ProjectEntity", null)
                .WithMany()
                .HasForeignKey("ProjectsId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("InfoEducatie.Contest.Judging.JudgingCriteria.JudgingCriteriaSection.JudgingCriteriaSectionEntity", b =>
            {
                b.Navigation("Criteria");
            });

            modelBuilder.Entity("MCMS.Base.Auth.User", b =>
            {
                b.Navigation("UserRoles");
            });

            modelBuilder.Entity("MCMS.Common.Translations.Translations.TranslationEntity", b =>
            {
                b.Navigation("Items");
            });
#pragma warning restore 612, 618
        }
Beispiel #27
0
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasDefaultSchema("AutoroleModule")
            .HasAnnotation("ProductVersion", "6.0.0")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);
            NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "fuzzystrmatch");
            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Autorole.Model.AutoroleConfiguration", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <long>("DiscordRoleID")
                .HasColumnType("bigint");
                b.Property <bool>("IsEnabled")
                .HasColumnType("boolean");
                b.Property <bool>("RequiresConfirmation")
                .HasColumnType("boolean");
                b.Property <long>("ServerID")
                .HasColumnType("bigint");
                b.HasKey("ID");
                b.HasIndex("ServerID");
                b.ToTable("AutoroleConfigurations", "AutoroleModule");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Autorole.Model.AutoroleConfirmation", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <long>("AutoroleID")
                .HasColumnType("bigint");
                b.Property <bool>("HasNotificationBeenSent")
                .HasColumnType("boolean");
                b.Property <bool>("IsConfirmed")
                .HasColumnType("boolean");
                b.Property <long>("UserID")
                .HasColumnType("bigint");
                b.HasKey("ID");
                b.HasIndex("AutoroleID");
                b.HasIndex("UserID");
                b.ToTable("AutoroleConfirmations", "AutoroleModule");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Autorole.Model.AutoroleServerSettings", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <long?>("AffirmationRequiredNotificationChannelID")
                .HasColumnType("bigint");
                b.Property <long>("ServerID")
                .HasColumnType("bigint");
                b.HasKey("ID");
                b.HasIndex("ServerID");
                b.ToTable("AutoroleServerSettings", "AutoroleModule");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.Bases.AutoroleCondition", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <long?>("AutoroleConfigurationID")
                .HasColumnType("bigint");
                b.Property <string>("Discriminator")
                .IsRequired()
                .HasColumnType("text");
                b.HasKey("ID");
                b.HasIndex("AutoroleConfigurationID");
                b.ToTable("AutoroleConditions", "AutoroleModule");
                b.HasDiscriminator <string>("Discriminator").HasValue("AutoroleCondition");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Autorole.Model.Statistics.UserChannelStatistics", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <long>("ChannelID")
                .HasColumnType("bigint");
                b.Property <long?>("MessageCount")
                .HasColumnType("bigint");
                b.Property <long?>("UserServerStatisticsID")
                .HasColumnType("bigint");
                b.HasKey("ID");
                b.HasIndex("UserServerStatisticsID");
                b.HasIndex("ChannelID", "UserServerStatisticsID")
                .IsUnique();
                b.ToTable("UserChannelStatistics", "AutoroleModule");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Autorole.Model.Statistics.UserServerStatistics", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <DateTime?>("LastActivityTime")
                .HasColumnType("timestamp with time zone");
                b.Property <long>("ServerID")
                .HasColumnType("bigint");
                b.Property <long?>("TotalMessageCount")
                .HasColumnType("bigint");
                b.Property <long?>("UserStatisticsID")
                .HasColumnType("bigint");
                b.HasKey("ID");
                b.HasIndex("UserStatisticsID");
                b.HasIndex("ServerID", "UserStatisticsID")
                .IsUnique();
                b.ToTable("UserServerStatistics", "AutoroleModule");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Autorole.Model.Statistics.UserStatistics", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <long>("UserID")
                .HasColumnType("bigint");
                b.HasKey("ID");
                b.HasIndex("UserID")
                .IsUnique();
                b.ToTable("UserStatistics", "AutoroleModule");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Core.Model.Servers.Server", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <string>("Description")
                .HasColumnType("text");
                b.Property <long>("DiscordID")
                .HasColumnType("bigint");
                b.Property <bool>("IsNSFW")
                .HasColumnType("boolean");
                b.Property <string>("JoinMessage")
                .HasColumnType("text");
                b.Property <bool>("SendJoinMessage")
                .HasColumnType("boolean");
                b.Property <bool>("SuppressPermissionWarnings")
                .HasColumnType("boolean");
                b.HasKey("ID");
                b.ToTable("Servers", "Core", t => t.ExcludeFromMigrations());
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Core.Model.Users.ServerUser", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <long>("ServerID")
                .HasColumnType("bigint");
                b.Property <long>("UserID")
                .HasColumnType("bigint");
                b.HasKey("ID");
                b.HasIndex("ServerID");
                b.HasIndex("UserID");
                b.ToTable("ServerUser", "Core", t => t.ExcludeFromMigrations());
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Core.Model.Users.User", b =>
            {
                b.Property <long>("ID")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");
                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("ID"));
                b.Property <string>("Bio")
                .IsRequired()
                .HasColumnType("text");
                b.Property <long>("DiscordID")
                .HasColumnType("bigint");
                b.Property <int?>("Timezone")
                .HasColumnType("integer");
                b.HasKey("ID");
                b.ToTable("Users", "Core", t => t.ExcludeFromMigrations());
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.Bases.MessageCountInSourceCondition<DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.MessageCountInChannelCondition>", b =>
            {
                b.HasBaseType("DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.Bases.AutoroleCondition");
                b.Property <long>("RequiredCount")
                .ValueGeneratedOnUpdateSometimes()
                .HasColumnType("bigint")
                .HasColumnName("RequiredCount");
                b.Property <long>("SourceID")
                .ValueGeneratedOnUpdateSometimes()
                .HasColumnType("bigint")
                .HasColumnName("SourceID");
                b.ToTable("AutoroleConditions", "AutoroleModule");
                b.HasDiscriminator().HasValue("MessageCountInSourceCondition<MessageCountInChannelCondition>");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.Bases.MessageCountInSourceCondition<DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.MessageCountInGuildCondition>", b =>
            {
                b.HasBaseType("DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.Bases.AutoroleCondition");
                b.Property <long>("RequiredCount")
                .ValueGeneratedOnUpdateSometimes()
                .HasColumnType("bigint")
                .HasColumnName("RequiredCount");
                b.Property <long>("SourceID")
                .ValueGeneratedOnUpdateSometimes()
                .HasColumnType("bigint")
                .HasColumnName("SourceID");
                b.ToTable("AutoroleConditions", "AutoroleModule");
                b.HasDiscriminator().HasValue("MessageCountInSourceCondition<MessageCountInGuildCondition>");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.Bases.TimeSinceEventCondition<DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.TimeSinceJoinCondition>", b =>
            {
                b.HasBaseType("DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.Bases.AutoroleCondition");
                b.Property <TimeSpan>("RequiredTime")
                .ValueGeneratedOnUpdateSometimes()
                .HasColumnType("interval")
                .HasColumnName("RequiredTime");
                b.ToTable("AutoroleConditions", "AutoroleModule");
                b.HasDiscriminator().HasValue("TimeSinceEventCondition<TimeSinceJoinCondition>");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.Bases.TimeSinceEventCondition<DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.TimeSinceLastActivityCondition>", b =>
            {
                b.HasBaseType("DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.Bases.AutoroleCondition");
                b.Property <TimeSpan>("RequiredTime")
                .ValueGeneratedOnUpdateSometimes()
                .HasColumnType("interval")
                .HasColumnName("RequiredTime");
                b.ToTable("AutoroleConditions", "AutoroleModule");
                b.HasDiscriminator().HasValue("TimeSinceEventCondition<TimeSinceLastActivityCondition>");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.ReactionCondition", b =>
            {
                b.HasBaseType("DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.Bases.AutoroleCondition");
                b.Property <long>("ChannelID")
                .HasColumnType("bigint");
                b.Property <string>("EmoteName")
                .IsRequired()
                .HasColumnType("text");
                b.Property <long>("MessageID")
                .HasColumnType("bigint");
                b.ToTable("AutoroleConditions", "AutoroleModule");
                b.HasDiscriminator().HasValue("ReactionCondition");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.RoleCondition", b =>
            {
                b.HasBaseType("DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.Bases.AutoroleCondition");
                b.Property <long>("RoleID")
                .HasColumnType("bigint");
                b.ToTable("AutoroleConditions", "AutoroleModule");
                b.HasDiscriminator().HasValue("RoleCondition");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.MessageCountInChannelCondition", b =>
            {
                b.HasBaseType("DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.Bases.MessageCountInSourceCondition<DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.MessageCountInChannelCondition>");
                b.ToTable("AutoroleConditions", "AutoroleModule");
                b.HasDiscriminator().HasValue("MessageCountInChannelCondition");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.MessageCountInGuildCondition", b =>
            {
                b.HasBaseType("DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.Bases.MessageCountInSourceCondition<DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.MessageCountInGuildCondition>");
                b.ToTable("AutoroleConditions", "AutoroleModule");
                b.HasDiscriminator().HasValue("MessageCountInGuildCondition");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.TimeSinceJoinCondition", b =>
            {
                b.HasBaseType("DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.Bases.TimeSinceEventCondition<DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.TimeSinceJoinCondition>");
                b.ToTable("AutoroleConditions", "AutoroleModule");
                b.HasDiscriminator().HasValue("TimeSinceJoinCondition");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.TimeSinceLastActivityCondition", b =>
            {
                b.HasBaseType("DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.Bases.TimeSinceEventCondition<DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.TimeSinceLastActivityCondition>");
                b.ToTable("AutoroleConditions", "AutoroleModule");
                b.HasDiscriminator().HasValue("TimeSinceLastActivityCondition");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Autorole.Model.AutoroleConfiguration", b =>
            {
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Servers.Server", "Server")
                .WithMany()
                .HasForeignKey("ServerID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
                b.Navigation("Server");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Autorole.Model.AutoroleConfirmation", b =>
            {
                b.HasOne("DIGOS.Ambassador.Plugins.Autorole.Model.AutoroleConfiguration", "Autorole")
                .WithMany()
                .HasForeignKey("AutoroleID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Users.User", "User")
                .WithMany()
                .HasForeignKey("UserID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
                b.Navigation("Autorole");
                b.Navigation("User");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Autorole.Model.AutoroleServerSettings", b =>
            {
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Servers.Server", "Server")
                .WithMany()
                .HasForeignKey("ServerID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
                b.Navigation("Server");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Autorole.Model.Conditions.Bases.AutoroleCondition", b =>
            {
                b.HasOne("DIGOS.Ambassador.Plugins.Autorole.Model.AutoroleConfiguration", null)
                .WithMany("Conditions")
                .HasForeignKey("AutoroleConfigurationID")
                .OnDelete(DeleteBehavior.Cascade);
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Autorole.Model.Statistics.UserChannelStatistics", b =>
            {
                b.HasOne("DIGOS.Ambassador.Plugins.Autorole.Model.Statistics.UserServerStatistics", null)
                .WithMany("ChannelStatistics")
                .HasForeignKey("UserServerStatisticsID")
                .OnDelete(DeleteBehavior.Cascade);
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Autorole.Model.Statistics.UserServerStatistics", b =>
            {
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Servers.Server", "Server")
                .WithMany()
                .HasForeignKey("ServerID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
                b.HasOne("DIGOS.Ambassador.Plugins.Autorole.Model.Statistics.UserStatistics", null)
                .WithMany("ServerStatistics")
                .HasForeignKey("UserStatisticsID")
                .OnDelete(DeleteBehavior.Cascade);
                b.Navigation("Server");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Autorole.Model.Statistics.UserStatistics", b =>
            {
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Users.User", "User")
                .WithMany()
                .HasForeignKey("UserID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
                b.Navigation("User");
            });
            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();
                b.HasOne("DIGOS.Ambassador.Plugins.Core.Model.Users.User", "User")
                .WithMany()
                .HasForeignKey("UserID")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
                b.Navigation("Server");
                b.Navigation("User");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Autorole.Model.AutoroleConfiguration", b =>
            {
                b.Navigation("Conditions");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Autorole.Model.Statistics.UserServerStatistics", b =>
            {
                b.Navigation("ChannelStatistics");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Autorole.Model.Statistics.UserStatistics", b =>
            {
                b.Navigation("ServerStatistics");
            });
            modelBuilder.Entity("DIGOS.Ambassador.Plugins.Core.Model.Servers.Server", b =>
            {
                b.Navigation("KnownUsers");
            });
#pragma warning restore 612, 618
        }
Beispiel #28
0
        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("Uchu.Core.ActivityScore", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("Id"));

                b.Property <int>("Activity")
                .HasColumnType("integer");

                b.Property <long>("CharacterId")
                .HasColumnType("bigint");

                b.Property <long>("LastPlayed")
                .HasColumnType("bigint");

                b.Property <int>("NumPlayed")
                .HasColumnType("integer");

                b.Property <int>("Points")
                .HasColumnType("integer");

                b.Property <int>("Time")
                .HasColumnType("integer");

                b.Property <int>("Week")
                .HasColumnType("integer");

                b.Property <int>("Zone")
                .HasColumnType("integer");

                b.HasKey("Id");

                b.ToTable("ActivityScores");
            });

            modelBuilder.Entity("Uchu.Core.Character", b =>
            {
                b.Property <long>("Id")
                .HasColumnType("bigint");

                b.Property <int>("BaseHealth")
                .HasColumnType("integer");

                b.Property <int>("BaseImagination")
                .HasColumnType("integer");

                b.Property <long>("Currency")
                .HasColumnType("bigint");

                b.Property <int>("CurrentArmor")
                .HasColumnType("integer");

                b.Property <int>("CurrentHealth")
                .HasColumnType("integer");

                b.Property <int>("CurrentImagination")
                .HasColumnType("integer");

                b.Property <string>("CustomName")
                .IsRequired()
                .HasMaxLength(33)
                .HasColumnType("character varying(33)");

                b.Property <long>("EyeStyle")
                .HasColumnType("bigint");

                b.Property <long>("EyebrowStyle")
                .HasColumnType("bigint");

                b.Property <bool>("FreeToPlay")
                .HasColumnType("boolean");

                b.Property <long>("GuildId")
                .HasColumnType("bigint");

                b.Property <long>("HairColor")
                .HasColumnType("bigint");

                b.Property <long>("HairStyle")
                .HasColumnType("bigint");

                b.Property <int>("InventorySize")
                .HasColumnType("integer");

                b.Property <bool>("LandingByRocket")
                .HasColumnType("boolean");

                b.Property <long>("LastActivity")
                .HasColumnType("bigint");

                b.Property <long>("LastClone")
                .HasColumnType("bigint");

                b.Property <int>("LastInstance")
                .HasColumnType("integer");

                b.Property <int>("LastZone")
                .HasColumnType("integer");

                b.Property <int>("LaunchedRocketFrom")
                .HasColumnType("integer");

                b.Property <long>("Level")
                .HasColumnType("bigint");

                b.Property <long>("Lh")
                .HasColumnType("bigint");

                b.Property <int>("MaximumArmor")
                .HasColumnType("integer");

                b.Property <int>("MaximumHealth")
                .HasColumnType("integer");

                b.Property <int>("MaximumImagination")
                .HasColumnType("integer");

                b.Property <long>("MouthStyle")
                .HasColumnType("bigint");

                b.Property <string>("Name")
                .IsRequired()
                .HasMaxLength(33)
                .HasColumnType("character varying(33)");

                b.Property <bool>("NameRejected")
                .HasColumnType("boolean");

                b.Property <long>("PantsColor")
                .HasColumnType("bigint");

                b.Property <long>("Rh")
                .HasColumnType("bigint");

                b.Property <string>("Rocket")
                .HasMaxLength(30)
                .HasColumnType("character varying(30)");

                b.Property <int>("SelectedConsumable")
                .HasColumnType("integer");

                b.Property <long>("ShirtColor")
                .HasColumnType("bigint");

                b.Property <long>("ShirtStyle")
                .HasColumnType("bigint");

                b.Property <string>("SpawnLocationName")
                .HasMaxLength(33)
                .HasColumnType("character varying(33)");

                b.Property <float?>("SpawnPositionX")
                .HasColumnType("real");

                b.Property <float?>("SpawnPositionY")
                .HasColumnType("real");

                b.Property <float?>("SpawnPositionZ")
                .HasColumnType("real");

                b.Property <float?>("SpawnRotationW")
                .HasColumnType("real");

                b.Property <float?>("SpawnRotationX")
                .HasColumnType("real");

                b.Property <float?>("SpawnRotationY")
                .HasColumnType("real");

                b.Property <float?>("SpawnRotationZ")
                .HasColumnType("real");

                b.Property <long>("TotalArmorPowerUpsCollected")
                .HasColumnType("bigint");

                b.Property <long>("TotalArmorRepaired")
                .HasColumnType("bigint");

                b.Property <long>("TotalBricksCollected")
                .HasColumnType("bigint");

                b.Property <long>("TotalCurrencyCollected")
                .HasColumnType("bigint");

                b.Property <long>("TotalDamageHealed")
                .HasColumnType("bigint");

                b.Property <long>("TotalDamageTaken")
                .HasColumnType("bigint");

                b.Property <long>("TotalDistanceDriven")
                .HasColumnType("bigint");

                b.Property <long>("TotalDistanceTraveled")
                .HasColumnType("bigint");

                b.Property <long>("TotalEnemiesSmashed")
                .HasColumnType("bigint");

                b.Property <long>("TotalFirstPlaceFinishes")
                .HasColumnType("bigint");

                b.Property <long>("TotalImaginationPowerUpsCollected")
                .HasColumnType("bigint");

                b.Property <long>("TotalImaginationRestored")
                .HasColumnType("bigint");

                b.Property <long>("TotalImaginationUsed")
                .HasColumnType("bigint");

                b.Property <long>("TotalLifePowerUpsCollected")
                .HasColumnType("bigint");

                b.Property <long>("TotalMissionsCompleted")
                .HasColumnType("bigint");

                b.Property <long>("TotalPetsTamed")
                .HasColumnType("bigint");

                b.Property <long>("TotalQuickBuildsCompleted")
                .HasColumnType("bigint");

                b.Property <long>("TotalRacecarBoostsActivated")
                .HasColumnType("bigint");

                b.Property <long>("TotalRacecarWrecks")
                .HasColumnType("bigint");

                b.Property <long>("TotalRacesFinished")
                .HasColumnType("bigint");

                b.Property <long>("TotalRacingImaginationCratesSmashed")
                .HasColumnType("bigint");

                b.Property <long>("TotalRacingImaginationPowerUpsCollected")
                .HasColumnType("bigint");

                b.Property <long>("TotalRacingSmashablesSmashed")
                .HasColumnType("bigint");

                b.Property <long>("TotalRocketsUsed")
                .HasColumnType("bigint");

                b.Property <long>("TotalSmashablesSmashed")
                .HasColumnType("bigint");

                b.Property <long>("TotalSuicides")
                .HasColumnType("bigint");

                b.Property <long>("TotalTimeAirborne")
                .HasColumnType("bigint");

                b.Property <long>("UniverseScore")
                .HasColumnType("bigint");

                b.Property <long>("UserId")
                .HasColumnType("bigint");

                b.Property <int>("VaultInventorySize")
                .HasColumnType("integer");

                b.HasKey("Id");

                b.HasIndex("UserId");

                b.ToTable("Characters");
            });

            modelBuilder.Entity("Uchu.Core.CharacterFlag", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("Id"));

                b.Property <long>("CharacterId")
                .HasColumnType("bigint");

                b.Property <int>("Flag")
                .HasColumnType("integer");

                b.HasKey("Id");

                b.HasIndex("CharacterId");

                b.ToTable("Flags");
            });

            modelBuilder.Entity("Uchu.Core.CharacterMail", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("Id"));

                b.Property <int>("AttachmentCount")
                .HasColumnType("integer");

                b.Property <decimal>("AttachmentCurrency")
                .HasColumnType("numeric(20,0)");

                b.Property <int>("AttachmentLot")
                .HasColumnType("integer");

                b.Property <long>("AuthorId")
                .HasColumnType("bigint");

                b.Property <string>("Body")
                .HasColumnType("text");

                b.Property <DateTime>("ExpirationTime")
                .HasColumnType("timestamp with time zone");

                b.Property <bool>("Read")
                .HasColumnType("boolean");

                b.Property <long>("RecipientId")
                .HasColumnType("bigint");

                b.Property <DateTime>("SentTime")
                .HasColumnType("timestamp with time zone");

                b.Property <string>("Subject")
                .HasColumnType("text");

                b.HasKey("Id");

                b.ToTable("Mails");
            });

            modelBuilder.Entity("Uchu.Core.CharacterTrade", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("Id"));

                b.Property <long>("CurrencyA")
                .HasColumnType("bigint");

                b.Property <long>("CurrencyB")
                .HasColumnType("bigint");

                b.Property <long>("PartyA")
                .HasColumnType("bigint");

                b.Property <long>("PartyB")
                .HasColumnType("bigint");

                b.HasKey("Id");

                b.ToTable("Trades");
            });

            modelBuilder.Entity("Uchu.Core.ChatTranscript", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("Id"));

                b.Property <long>("Author")
                .HasColumnType("bigint");

                b.Property <string>("Message")
                .HasColumnType("text");

                b.Property <long>("Receiver")
                .HasColumnType("bigint");

                b.Property <DateTime>("SentTime")
                .HasColumnType("timestamp with time zone");

                b.HasKey("Id");

                b.ToTable("ChatTranscript");
            });

            modelBuilder.Entity("Uchu.Core.Friend", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("Id"));

                b.Property <bool>("BestFriend")
                .HasColumnType("boolean");

                b.Property <long>("FriendA")
                .HasColumnType("bigint");

                b.Property <long>("FriendB")
                .HasColumnType("bigint");

                b.HasKey("Id");

                b.ToTable("Friends");
            });

            modelBuilder.Entity("Uchu.Core.FriendRequest", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("Id"));

                b.Property <bool>("BestFriend")
                .HasColumnType("boolean");

                b.Property <long>("Receiver")
                .HasColumnType("bigint");

                b.Property <long>("Sender")
                .HasColumnType("bigint");

                b.Property <bool>("Sent")
                .HasColumnType("boolean");

                b.HasKey("Id");

                b.ToTable("FriendRequests");
            });

            modelBuilder.Entity("Uchu.Core.Guild", b =>
            {
                b.Property <long>("Id")
                .HasColumnType("bigint");

                b.Property <long>("CreatorId")
                .HasColumnType("bigint");

                b.Property <string>("Name")
                .HasColumnType("text");

                b.HasKey("Id");

                b.ToTable("Guilds");
            });

            modelBuilder.Entity("Uchu.Core.GuildInvite", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("Id"));

                b.Property <long>("GuildId")
                .HasColumnType("bigint");

                b.Property <long>("RecipientId")
                .HasColumnType("bigint");

                b.Property <long>("SenderId")
                .HasColumnType("bigint");

                b.HasKey("Id");

                b.HasIndex("GuildId");

                b.ToTable("GuildInvites");
            });

            modelBuilder.Entity("Uchu.Core.InventoryItem", b =>
            {
                b.Property <long>("Id")
                .HasColumnType("bigint");

                b.Property <long>("CharacterId")
                .HasColumnType("bigint");

                b.Property <long>("Count")
                .HasColumnType("bigint");

                b.Property <string>("ExtraInfo")
                .HasColumnType("text");

                b.Property <int>("InventoryType")
                .HasColumnType("integer");

                b.Property <bool>("IsBound")
                .HasColumnType("boolean");

                b.Property <bool>("IsEquipped")
                .HasColumnType("boolean");

                b.Property <int>("Lot")
                .HasColumnType("integer");

                b.Property <long>("ParentId")
                .HasColumnType("bigint");

                b.Property <int>("Slot")
                .HasColumnType("integer");

                b.HasKey("Id");

                b.HasIndex("CharacterId");

                b.ToTable("InventoryItems");
            });

            modelBuilder.Entity("Uchu.Core.Mission", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <long>("CharacterId")
                .HasColumnType("bigint");

                b.Property <int>("CompletionCount")
                .HasColumnType("integer");

                b.Property <long>("LastCompletion")
                .HasColumnType("bigint");

                b.Property <int>("MissionId")
                .HasColumnType("integer");

                b.Property <int>("State")
                .HasColumnType("integer");

                b.HasKey("Id");

                b.HasIndex("CharacterId");

                b.ToTable("Missions");
            });

            modelBuilder.Entity("Uchu.Core.MissionTask", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("integer");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <int>("Id"));

                b.Property <int>("MissionId")
                .HasColumnType("integer");

                b.Property <int>("TaskId")
                .HasColumnType("integer");

                b.HasKey("Id");

                b.HasIndex("MissionId");

                b.ToTable("MissionTasks");
            });

            modelBuilder.Entity("Uchu.Core.MissionTaskValue", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("Id"));

                b.Property <int>("Count")
                .HasColumnType("integer");

                b.Property <int>("MissionTaskId")
                .HasColumnType("integer");

                b.Property <float>("Value")
                .HasColumnType("real");

                b.HasKey("Id");

                b.HasIndex("MissionTaskId");

                b.ToTable("MissionTaskValue");
            });

            modelBuilder.Entity("Uchu.Core.SessionCache", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uuid");

                b.Property <long>("CharacterId")
                .HasColumnType("bigint");

                b.Property <string>("Key")
                .HasColumnType("text");

                b.Property <long>("UserId")
                .HasColumnType("bigint");

                b.Property <int>("ZoneId")
                .HasColumnType("integer");

                b.HasKey("Id");

                b.ToTable("SessionCaches");
            });

            modelBuilder.Entity("Uchu.Core.TradeTransactionItem", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("Id"));

                b.Property <long>("ItemId")
                .HasColumnType("bigint");

                b.Property <long>("Party")
                .HasColumnType("bigint");

                b.Property <long>("TradeId")
                .HasColumnType("bigint");

                b.HasKey("Id");

                b.HasIndex("TradeId");

                b.ToTable("TransactionItems");
            });

            modelBuilder.Entity("Uchu.Core.UnlockedEmote", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("Id"));

                b.Property <long>("CharacterId")
                .HasColumnType("bigint");

                b.Property <int>("EmoteId")
                .HasColumnType("integer");

                b.HasKey("Id");

                b.HasIndex("CharacterId");

                b.ToTable("UnlockedEmote");
            });

            modelBuilder.Entity("Uchu.Core.User", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint");

                NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property <long>("Id"));

                b.Property <bool>("Banned")
                .HasColumnType("boolean");

                b.Property <string>("BannedReason")
                .HasColumnType("text");

                b.Property <int>("CharacterIndex")
                .HasColumnType("integer");

                b.Property <string>("CustomLockout")
                .HasColumnType("text");

                b.Property <bool>("FirstTimeOnSubscription")
                .HasColumnType("boolean");

                b.Property <bool>("FreeToPlay")
                .HasColumnType("boolean");

                b.Property <int>("GameMasterLevel")
                .HasColumnType("integer");

                b.Property <string>("Password")
                .HasMaxLength(60)
                .HasColumnType("character varying(60)");

                b.Property <bool>("Sso")
                .HasColumnType("boolean");

                b.Property <string>("Username")
                .IsRequired()
                .HasMaxLength(33)
                .HasColumnType("character varying(33)");

                b.HasKey("Id");

                b.ToTable("Users");
            });

            modelBuilder.Entity("Uchu.Core.Character", b =>
            {
                b.HasOne("Uchu.Core.User", "User")
                .WithMany("Characters")
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("User");
            });

            modelBuilder.Entity("Uchu.Core.CharacterFlag", b =>
            {
                b.HasOne("Uchu.Core.Character", "Character")
                .WithMany("Flags")
                .HasForeignKey("CharacterId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Character");
            });

            modelBuilder.Entity("Uchu.Core.GuildInvite", b =>
            {
                b.HasOne("Uchu.Core.Guild", "Guild")
                .WithMany("Invites")
                .HasForeignKey("GuildId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Guild");
            });

            modelBuilder.Entity("Uchu.Core.InventoryItem", b =>
            {
                b.HasOne("Uchu.Core.Character", "Character")
                .WithMany("Items")
                .HasForeignKey("CharacterId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Character");
            });

            modelBuilder.Entity("Uchu.Core.Mission", b =>
            {
                b.HasOne("Uchu.Core.Character", "Character")
                .WithMany("Missions")
                .HasForeignKey("CharacterId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Character");
            });

            modelBuilder.Entity("Uchu.Core.MissionTask", b =>
            {
                b.HasOne("Uchu.Core.Mission", "Mission")
                .WithMany("Tasks")
                .HasForeignKey("MissionId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Mission");
            });

            modelBuilder.Entity("Uchu.Core.MissionTaskValue", b =>
            {
                b.HasOne("Uchu.Core.MissionTask", "MissionTask")
                .WithMany("Values")
                .HasForeignKey("MissionTaskId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("MissionTask");
            });

            modelBuilder.Entity("Uchu.Core.TradeTransactionItem", b =>
            {
                b.HasOne("Uchu.Core.CharacterTrade", "Trade")
                .WithMany("TransactionItems")
                .HasForeignKey("TradeId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Trade");
            });

            modelBuilder.Entity("Uchu.Core.UnlockedEmote", b =>
            {
                b.HasOne("Uchu.Core.Character", "Character")
                .WithMany("UnlockedEmotes")
                .HasForeignKey("CharacterId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Character");
            });

            modelBuilder.Entity("Uchu.Core.Character", b =>
            {
                b.Navigation("Flags");

                b.Navigation("Items");

                b.Navigation("Missions");

                b.Navigation("UnlockedEmotes");
            });

            modelBuilder.Entity("Uchu.Core.CharacterTrade", b =>
            {
                b.Navigation("TransactionItems");
            });

            modelBuilder.Entity("Uchu.Core.Guild", b =>
            {
                b.Navigation("Invites");
            });

            modelBuilder.Entity("Uchu.Core.Mission", b =>
            {
                b.Navigation("Tasks");
            });

            modelBuilder.Entity("Uchu.Core.MissionTask", b =>
            {
                b.Navigation("Values");
            });

            modelBuilder.Entity("Uchu.Core.User", b =>
            {
                b.Navigation("Characters");
            });
#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.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>("Content")
                .IsRequired()
                .HasColumnType("text")
                .HasColumnName("content");

                b.Property <string>("Description")
                .IsRequired()
                .HasMaxLength(100)
                .HasColumnType("character varying(100)")
                .HasColumnName("description");

                b.Property <bool>("IsArchived")
                .HasColumnType("boolean")
                .HasColumnName("is_archived");

                b.Property <bool>("IsProcessed")
                .HasColumnType("boolean")
                .HasColumnName("is_processed");

                b.HasKey("Id")
                .HasName("pk_book");

                b.HasIndex("AddedAtUtc")
                .HasDatabaseName("ix_book_added_at_utc");

                b.HasIndex("Description")
                .HasDatabaseName("ix_book_description");

                b.HasIndex("IsArchived")
                .HasDatabaseName("ix_book_is_archived");

                b.HasIndex("IsProcessed")
                .HasDatabaseName("ix_book_is_processed");

                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.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()
                .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.SentenceDao", b =>
            {
                b.Navigation("Words");
            });

            modelBuilder.Entity("TypingRealm.Library.Infrastructure.DataAccess.Entities.WordDao", b =>
            {
                b.Navigation("KeyPairs");
            });
#pragma warning restore 612, 618
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasDefaultSchema("aspnet_identity")
            .HasAnnotation("ProductVersion", "6.0.0-rc.1.21452.10")
            .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            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")
                .HasColumnType("text");

                b.Property <string>("ProviderKey")
                .HasColumnType("text");

                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")
                .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("UnoBlazor.Shared.Entities.ApplicationUser", b =>
            {
                b.Property <string>("Id")
                .HasColumnType("text");

                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 <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 <string>("Status")
                .IsRequired()
                .HasColumnType("text");

                b.Property <bool>("TwoFactorEnabled")
                .HasColumnType("boolean");

                b.Property <string>("UserName")
                .HasMaxLength(256)
                .HasColumnType("character varying(256)");

                b.HasKey("Id");

                b.HasIndex("NormalizedEmail")
                .HasDatabaseName("EmailIndex");

                b.HasIndex("NormalizedUserName")
                .IsUnique()
                .HasDatabaseName("UserNameIndex");

                b.ToTable("AspNetUsers", (string)null);
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
            {
                b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
                .WithMany()
                .HasForeignKey("RoleId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
            {
                b.HasOne("UnoBlazor.Shared.Entities.ApplicationUser", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
            {
                b.HasOne("UnoBlazor.Shared.Entities.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("UnoBlazor.Shared.Entities.ApplicationUser", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
            {
                b.HasOne("UnoBlazor.Shared.Entities.ApplicationUser", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });
#pragma warning restore 612, 618
        }