diff --git a/Content.Server.Database/Migrations/Postgres/20240606175154_ReturnLastReadRules.Designer.cs b/Content.Server.Database/Migrations/Postgres/20240606175154_ReturnLastReadRules.Designer.cs deleted file mode 100644 index e82e58bf5ce..00000000000 --- a/Content.Server.Database/Migrations/Postgres/20240606175154_ReturnLastReadRules.Designer.cs +++ /dev/null @@ -1,1913 +0,0 @@ -// -using System; -using System.Net; -using System.Text.Json; -using Content.Server.Database; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using NpgsqlTypes; - -#nullable disable - -namespace Content.Server.Database.Migrations.Postgres -{ - [DbContext(typeof(PostgresServerDbContext))] - [Migration("20240606175154_ReturnLastReadRules")] - partial class ReturnLastReadRules - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Content.Server.Database.Admin", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.Property("AdminRankId") - .HasColumnType("integer") - .HasColumnName("admin_rank_id"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_flag_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminId") - .HasColumnType("uuid") - .HasColumnName("admin_id"); - - b.Property("Flag") - .IsRequired() - .HasColumnType("text") - .HasColumnName("flag"); - - b.Property("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("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("Id") - .HasColumnType("integer") - .HasColumnName("admin_log_id"); - - b.Property("Date") - .HasColumnType("timestamp with time zone") - .HasColumnName("date"); - - b.Property("Impact") - .HasColumnType("smallint") - .HasColumnName("impact"); - - b.Property("Json") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("json"); - - b.Property("Message") - .IsRequired() - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("RoundId", "Id") - .HasName("PK_admin_log"); - - b.HasIndex("Date"); - - b.HasIndex("Message") - .HasAnnotation("Npgsql:TsVectorConfig", "english"); - - NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex("Message"), "GIN"); - - b.HasIndex("Type") - .HasDatabaseName("IX_admin_log_type"); - - b.ToTable("admin_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminLogPlayer", b => - { - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("LogId") - .HasColumnType("integer") - .HasColumnName("log_id"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.HasKey("RoundId", "LogId", "PlayerUserId") - .HasName("PK_admin_log_player"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_log_player_player_user_id"); - - b.ToTable("admin_log_player", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_messages_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("uuid") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("boolean") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("uuid") - .HasColumnName("deleted_by_id"); - - b.Property("Dismissed") - .HasColumnType("boolean") - .HasColumnName("dismissed"); - - b.Property("ExpirationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("uuid") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("interval") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("Seen") - .HasColumnType("boolean") - .HasColumnName("seen"); - - b.HasKey("Id") - .HasName("PK_admin_messages"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_messages_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_messages_round_id"); - - b.ToTable("admin_messages", null, t => - { - t.HasCheckConstraint("NotDismissedAndSeen", "NOT dismissed OR seen"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.AdminNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_notes_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("uuid") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("boolean") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("uuid") - .HasColumnName("deleted_by_id"); - - b.Property("ExpirationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .IsRequired() - .HasColumnType("timestamp with time zone") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("uuid") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("interval") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("Secret") - .HasColumnType("boolean") - .HasColumnName("secret"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_admin_notes"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_notes_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_notes_round_id"); - - b.ToTable("admin_notes", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminRank", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_rank_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_rank_flag_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminRankId") - .HasColumnType("integer") - .HasColumnName("admin_rank_id"); - - b.Property("Flag") - .IsRequired() - .HasColumnType("text") - .HasColumnName("flag"); - - b.HasKey("Id") - .HasName("PK_admin_rank_flag"); - - b.HasIndex("AdminRankId"); - - b.HasIndex("Flag", "AdminRankId") - .IsUnique(); - - b.ToTable("admin_rank_flag", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminWatchlist", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_watchlists_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("uuid") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("boolean") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("uuid") - .HasColumnName("deleted_by_id"); - - b.Property("ExpirationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .IsRequired() - .HasColumnType("timestamp with time zone") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("uuid") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("interval") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.HasKey("Id") - .HasName("PK_admin_watchlists"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_watchlists_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_watchlists_round_id"); - - b.ToTable("admin_watchlists", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Antag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("antag_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AntagName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("antag_name"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("assigned_user_id_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("UserId") - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("connection_log_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("inet") - .HasColumnName("address"); - - b.Property("Denied") - .HasColumnType("smallint") - .HasColumnName("denied"); - - b.Property("HWId") - .HasColumnType("bytea") - .HasColumnName("hwid"); - - b.Property("ServerId") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("server_id"); - - b.Property("Time") - .HasColumnType("timestamp with time zone") - .HasColumnName("time"); - - b.Property("UserId") - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.Property("UserName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("user_name"); - - b.HasKey("Id") - .HasName("PK_connection_log"); - - b.HasIndex("ServerId") - .HasDatabaseName("IX_connection_log_server_id"); - - b.HasIndex("UserId"); - - b.ToTable("connection_log", null, t => - { - t.HasCheckConstraint("AddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= address"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.Job", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("job_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("JobName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("job_name"); - - b.Property("Priority") - .HasColumnType("integer") - .HasColumnName("priority"); - - b.Property("ProfileId") - .HasColumnType("integer") - .HasColumnName("profile_id"); - - b.HasKey("Id") - .HasName("PK_job"); - - b.HasIndex("ProfileId"); - - 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.PlayTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("play_time_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("PlayerId") - .HasColumnType("uuid") - .HasColumnName("player_id"); - - b.Property("TimeSpent") - .HasColumnType("interval") - .HasColumnName("time_spent"); - - b.Property("Tracker") - .IsRequired() - .HasColumnType("text") - .HasColumnName("tracker"); - - b.HasKey("Id") - .HasName("PK_play_time"); - - b.HasIndex("PlayerId", "Tracker") - .IsUnique(); - - b.ToTable("play_time", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Player", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("player_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("FirstSeenTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("first_seen_time"); - - b.Property("LastReadRules") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_read_rules"); - - b.Property("LastSeenAddress") - .IsRequired() - .HasColumnType("inet") - .HasColumnName("last_seen_address"); - - b.Property("LastSeenHWId") - .HasColumnType("bytea") - .HasColumnName("last_seen_hwid"); - - b.Property("LastSeenTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_seen_time"); - - b.Property("LastSeenUserName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("last_seen_user_name"); - - b.Property("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", null, t => - { - t.HasCheckConstraint("LastSeenAddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= last_seen_address"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.Preference", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("preference_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminOOCColor") - .IsRequired() - .HasColumnType("text") - .HasColumnName("admin_ooc_color"); - - b.Property("SelectedCharacterSlot") - .HasColumnType("integer") - .HasColumnName("selected_character_slot"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("profile_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Age") - .HasColumnType("integer") - .HasColumnName("age"); - - b.Property("CharacterName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("char_name"); - - b.Property("EyeColor") - .IsRequired() - .HasColumnType("text") - .HasColumnName("eye_color"); - - b.Property("FacialHairColor") - .IsRequired() - .HasColumnType("text") - .HasColumnName("facial_hair_color"); - - b.Property("FacialHairName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("facial_hair_name"); - - b.Property("FlavorText") - .IsRequired() - .HasColumnType("text") - .HasColumnName("flavor_text"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("text") - .HasColumnName("gender"); - - b.Property("HairColor") - .IsRequired() - .HasColumnType("text") - .HasColumnName("hair_color"); - - b.Property("HairName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("hair_name"); - - b.Property("Markings") - .HasColumnType("jsonb") - .HasColumnName("markings"); - - b.Property("PreferenceId") - .HasColumnType("integer") - .HasColumnName("preference_id"); - - b.Property("PreferenceUnavailable") - .HasColumnType("integer") - .HasColumnName("pref_unavailable"); - - b.Property("Sex") - .IsRequired() - .HasColumnType("text") - .HasColumnName("sex"); - - b.Property("SkinColor") - .IsRequired() - .HasColumnType("text") - .HasColumnName("skin_color"); - - b.Property("Slot") - .HasColumnType("integer") - .HasColumnName("slot"); - - b.Property("SpawnPriority") - .HasColumnType("integer") - .HasColumnName("spawn_priority"); - - b.Property("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.ProfileLoadout", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("profile_loadout_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("LoadoutName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("loadout_name"); - - b.Property("ProfileLoadoutGroupId") - .HasColumnType("integer") - .HasColumnName("profile_loadout_group_id"); - - b.HasKey("Id") - .HasName("PK_profile_loadout"); - - b.HasIndex("ProfileLoadoutGroupId"); - - b.ToTable("profile_loadout", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("profile_loadout_group_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("GroupName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("group_name"); - - b.Property("ProfileRoleLoadoutId") - .HasColumnType("integer") - .HasColumnName("profile_role_loadout_id"); - - b.HasKey("Id") - .HasName("PK_profile_loadout_group"); - - b.HasIndex("ProfileRoleLoadoutId"); - - b.ToTable("profile_loadout_group", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("profile_role_loadout_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ProfileId") - .HasColumnType("integer") - .HasColumnName("profile_id"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("role_name"); - - b.HasKey("Id") - .HasName("PK_profile_role_loadout"); - - b.HasIndex("ProfileId"); - - b.ToTable("profile_role_loadout", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.RoleWhitelist", b => - { - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("RoleId") - .HasColumnType("text") - .HasColumnName("role_id"); - - b.HasKey("PlayerUserId", "RoleId") - .HasName("PK_role_whitelists"); - - b.ToTable("role_whitelists", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("round_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ServerId") - .HasColumnType("integer") - .HasColumnName("server_id"); - - b.Property("StartDate") - .HasColumnType("timestamp with time zone") - .HasColumnName("start_date"); - - b.HasKey("Id") - .HasName("PK_round"); - - b.HasIndex("ServerId") - .HasDatabaseName("IX_round_server_id"); - - b.HasIndex("StartDate"); - - b.ToTable("round", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Server", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("server_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("PK_server"); - - b.ToTable("server", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("server_ban_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .HasColumnType("inet") - .HasColumnName("address"); - - b.Property("AutoDelete") - .HasColumnType("boolean") - .HasColumnName("auto_delete"); - - b.Property("BanTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("ban_time"); - - b.Property("BanningAdmin") - .HasColumnType("uuid") - .HasColumnName("banning_admin"); - - b.Property("ExemptFlags") - .HasColumnType("integer") - .HasColumnName("exempt_flags"); - - b.Property("ExpirationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("expiration_time"); - - b.Property("HWId") - .HasColumnType("bytea") - .HasColumnName("hwid"); - - b.Property("Hidden") - .HasColumnType("boolean") - .HasColumnName("hidden"); - - b.Property("LastEditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("uuid") - .HasColumnName("last_edited_by_id"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("interval") - .HasColumnName("playtime_at_note"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("text") - .HasColumnName("reason"); - - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_server_ban"); - - b.HasIndex("Address"); - - b.HasIndex("BanningAdmin"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_server_ban_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_server_ban_round_id"); - - b.ToTable("server_ban", null, t => - { - t.HasCheckConstraint("AddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= address"); - - t.HasCheckConstraint("HaveEitherAddressOrUserIdOrHWId", "address IS NOT NULL OR player_user_id IS NOT NULL OR hwid IS NOT NULL"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBanExemption", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.Property("Flags") - .HasColumnType("integer") - .HasColumnName("flags"); - - b.HasKey("UserId") - .HasName("PK_server_ban_exemption"); - - b.ToTable("server_ban_exemption", null, t => - { - t.HasCheckConstraint("FlagsNotZero", "flags != 0"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBanHit", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("server_ban_hit_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BanId") - .HasColumnType("integer") - .HasColumnName("ban_id"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("server_role_ban_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .HasColumnType("inet") - .HasColumnName("address"); - - b.Property("BanTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("ban_time"); - - b.Property("BanningAdmin") - .HasColumnType("uuid") - .HasColumnName("banning_admin"); - - b.Property("ExpirationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("expiration_time"); - - b.Property("HWId") - .HasColumnType("bytea") - .HasColumnName("hwid"); - - b.Property("Hidden") - .HasColumnType("boolean") - .HasColumnName("hidden"); - - b.Property("LastEditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("uuid") - .HasColumnName("last_edited_by_id"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("interval") - .HasColumnName("playtime_at_note"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("text") - .HasColumnName("reason"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("text") - .HasColumnName("role_id"); - - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_server_role_ban"); - - b.HasIndex("Address"); - - b.HasIndex("BanningAdmin"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_server_role_ban_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_server_role_ban_round_id"); - - b.ToTable("server_role_ban", null, t => - { - t.HasCheckConstraint("AddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= address"); - - t.HasCheckConstraint("HaveEitherAddressOrUserIdOrHWId", "address IS NOT NULL OR player_user_id IS NOT NULL OR hwid IS NOT NULL"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerRoleUnban", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("role_unban_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BanId") - .HasColumnType("integer") - .HasColumnName("ban_id"); - - b.Property("UnbanTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("unban_time"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("unban_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BanId") - .HasColumnType("integer") - .HasColumnName("ban_id"); - - b.Property("UnbanTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("unban_time"); - - b.Property("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.Trait", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("trait_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ProfileId") - .HasColumnType("integer") - .HasColumnName("profile_id"); - - b.Property("TraitName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("trait_name"); - - b.HasKey("Id") - .HasName("PK_trait"); - - b.HasIndex("ProfileId", "TraitName") - .IsUnique(); - - b.ToTable("trait", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.UploadedResourceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("uploaded_resource_log_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Data") - .IsRequired() - .HasColumnType("bytea") - .HasColumnName("data"); - - b.Property("Date") - .HasColumnType("timestamp with time zone") - .HasColumnName("date"); - - b.Property("Path") - .IsRequired() - .HasColumnType("text") - .HasColumnName("path"); - - b.Property("UserId") - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.HasKey("Id") - .HasName("PK_uploaded_resource_log"); - - b.ToTable("uploaded_resource_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Whitelist", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.HasKey("UserId") - .HasName("PK_whitelist"); - - b.ToTable("whitelist", (string)null); - }); - - modelBuilder.Entity("PlayerRound", b => - { - b.Property("PlayersId") - .HasColumnType("integer") - .HasColumnName("players_id"); - - b.Property("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.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("RoundId", "LogId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_admin_log_player_admin_log_round_id_log_id"); - - b.Navigation("Log"); - - b.Navigation("Player"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminMessage", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminMessagesCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminMessagesDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminMessagesLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminMessagesReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_messages_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_messages_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminNote", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminNotesCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminNotesDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminNotesLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminNotesReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_notes_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_notes_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - 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.AdminWatchlist", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminWatchlistsCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminWatchlistsDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminWatchlistsLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminWatchlistsReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_watchlists_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_watchlists_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - 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.ConnectionLog", b => - { - b.HasOne("Content.Server.Database.Server", "Server") - .WithMany("ConnectionLogs") - .HasForeignKey("ServerId") - .OnDelete(DeleteBehavior.SetNull) - .IsRequired() - .HasConstraintName("FK_connection_log_server_server_id"); - - b.Navigation("Server"); - }); - - 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.ProfileLoadout", b => - { - b.HasOne("Content.Server.Database.ProfileLoadoutGroup", "ProfileLoadoutGroup") - .WithMany("Loadouts") - .HasForeignKey("ProfileLoadoutGroupId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_profile_loadout_profile_loadout_group_profile_loadout_group~"); - - b.Navigation("ProfileLoadoutGroup"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => - { - b.HasOne("Content.Server.Database.ProfileRoleLoadout", "ProfileRoleLoadout") - .WithMany("Groups") - .HasForeignKey("ProfileRoleLoadoutId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_profile_loadout_group_profile_role_loadout_profile_role_loa~"); - - b.Navigation("ProfileRoleLoadout"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => - { - b.HasOne("Content.Server.Database.Profile", "Profile") - .WithMany("Loadouts") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_profile_role_loadout_profile_profile_id"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("Content.Server.Database.RoleWhitelist", b => - { - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("JobWhitelists") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_role_whitelists_player_player_user_id"); - - b.Navigation("Player"); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.HasOne("Content.Server.Database.Server", "Server") - .WithMany("Rounds") - .HasForeignKey("ServerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_round_server_server_id"); - - b.Navigation("Server"); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBan", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminServerBansCreated") - .HasForeignKey("BanningAdmin") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_ban_player_banning_admin"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminServerBansLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_ban_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_server_ban_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Round"); - }); - - 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.ServerRoleBan", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminServerRoleBansCreated") - .HasForeignKey("BanningAdmin") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_role_ban_player_banning_admin"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminServerRoleBansLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_role_ban_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_server_role_ban_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Round"); - }); - - 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("Content.Server.Database.Trait", b => - { - b.HasOne("Content.Server.Database.Profile", "Profile") - .WithMany("Traits") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_trait_profile_profile_id"); - - b.Navigation("Profile"); - }); - - 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("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"); - - b.Navigation("AdminMessagesCreated"); - - b.Navigation("AdminMessagesDeleted"); - - b.Navigation("AdminMessagesLastEdited"); - - b.Navigation("AdminMessagesReceived"); - - b.Navigation("AdminNotesCreated"); - - b.Navigation("AdminNotesDeleted"); - - b.Navigation("AdminNotesLastEdited"); - - b.Navigation("AdminNotesReceived"); - - b.Navigation("AdminServerBansCreated"); - - b.Navigation("AdminServerBansLastEdited"); - - b.Navigation("AdminServerRoleBansCreated"); - - b.Navigation("AdminServerRoleBansLastEdited"); - - b.Navigation("AdminWatchlistsCreated"); - - b.Navigation("AdminWatchlistsDeleted"); - - b.Navigation("AdminWatchlistsLastEdited"); - - b.Navigation("AdminWatchlistsReceived"); - - b.Navigation("JobWhitelists"); - }); - - modelBuilder.Entity("Content.Server.Database.Preference", b => - { - b.Navigation("Profiles"); - }); - - modelBuilder.Entity("Content.Server.Database.Profile", b => - { - b.Navigation("Antags"); - - b.Navigation("Jobs"); - - b.Navigation("Loadouts"); - - b.Navigation("Traits"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => - { - b.Navigation("Loadouts"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => - { - b.Navigation("Groups"); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.Navigation("AdminLogs"); - }); - - modelBuilder.Entity("Content.Server.Database.Server", b => - { - b.Navigation("ConnectionLogs"); - - b.Navigation("Rounds"); - }); - - 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 - } - } -} diff --git a/Content.Server.Database/Migrations/Postgres/20240606175154_ReturnLastReadRules.cs b/Content.Server.Database/Migrations/Postgres/20240606175154_ReturnLastReadRules.cs deleted file mode 100644 index af4e5ad4c40..00000000000 --- a/Content.Server.Database/Migrations/Postgres/20240606175154_ReturnLastReadRules.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Content.Server.Database.Migrations.Postgres -{ - /// - public partial class ReturnLastReadRules : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "last_read_rules", - table: "player", - type: "timestamp with time zone", - nullable: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "last_read_rules", - table: "player"); - } - } -} diff --git a/Content.Server.Database/Migrations/Postgres/20240623005121_BanTemplate.Designer.cs b/Content.Server.Database/Migrations/Postgres/20240623005121_BanTemplate.Designer.cs deleted file mode 100644 index 5d89f3dd29b..00000000000 --- a/Content.Server.Database/Migrations/Postgres/20240623005121_BanTemplate.Designer.cs +++ /dev/null @@ -1,1960 +0,0 @@ -// -using System; -using System.Net; -using System.Text.Json; -using Content.Server.Database; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using NpgsqlTypes; - -#nullable disable - -namespace Content.Server.Database.Migrations.Postgres -{ - [DbContext(typeof(PostgresServerDbContext))] - [Migration("20240623005121_BanTemplate")] - partial class BanTemplate - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Content.Server.Database.Admin", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.Property("AdminRankId") - .HasColumnType("integer") - .HasColumnName("admin_rank_id"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_flag_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminId") - .HasColumnType("uuid") - .HasColumnName("admin_id"); - - b.Property("Flag") - .IsRequired() - .HasColumnType("text") - .HasColumnName("flag"); - - b.Property("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("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("Id") - .HasColumnType("integer") - .HasColumnName("admin_log_id"); - - b.Property("Date") - .HasColumnType("timestamp with time zone") - .HasColumnName("date"); - - b.Property("Impact") - .HasColumnType("smallint") - .HasColumnName("impact"); - - b.Property("Json") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("json"); - - b.Property("Message") - .IsRequired() - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("RoundId", "Id") - .HasName("PK_admin_log"); - - b.HasIndex("Date"); - - b.HasIndex("Message") - .HasAnnotation("Npgsql:TsVectorConfig", "english"); - - NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex("Message"), "GIN"); - - b.HasIndex("Type") - .HasDatabaseName("IX_admin_log_type"); - - b.ToTable("admin_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminLogPlayer", b => - { - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("LogId") - .HasColumnType("integer") - .HasColumnName("log_id"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.HasKey("RoundId", "LogId", "PlayerUserId") - .HasName("PK_admin_log_player"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_log_player_player_user_id"); - - b.ToTable("admin_log_player", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_messages_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("uuid") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("boolean") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("uuid") - .HasColumnName("deleted_by_id"); - - b.Property("Dismissed") - .HasColumnType("boolean") - .HasColumnName("dismissed"); - - b.Property("ExpirationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("uuid") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("interval") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("Seen") - .HasColumnType("boolean") - .HasColumnName("seen"); - - b.HasKey("Id") - .HasName("PK_admin_messages"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_messages_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_messages_round_id"); - - b.ToTable("admin_messages", null, t => - { - t.HasCheckConstraint("NotDismissedAndSeen", "NOT dismissed OR seen"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.AdminNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_notes_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("uuid") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("boolean") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("uuid") - .HasColumnName("deleted_by_id"); - - b.Property("ExpirationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .IsRequired() - .HasColumnType("timestamp with time zone") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("uuid") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("interval") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("Secret") - .HasColumnType("boolean") - .HasColumnName("secret"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_admin_notes"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_notes_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_notes_round_id"); - - b.ToTable("admin_notes", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminRank", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_rank_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_rank_flag_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminRankId") - .HasColumnType("integer") - .HasColumnName("admin_rank_id"); - - b.Property("Flag") - .IsRequired() - .HasColumnType("text") - .HasColumnName("flag"); - - b.HasKey("Id") - .HasName("PK_admin_rank_flag"); - - b.HasIndex("AdminRankId"); - - b.HasIndex("Flag", "AdminRankId") - .IsUnique(); - - b.ToTable("admin_rank_flag", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminWatchlist", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_watchlists_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("uuid") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("boolean") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("uuid") - .HasColumnName("deleted_by_id"); - - b.Property("ExpirationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .IsRequired() - .HasColumnType("timestamp with time zone") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("uuid") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("interval") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.HasKey("Id") - .HasName("PK_admin_watchlists"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_watchlists_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_watchlists_round_id"); - - b.ToTable("admin_watchlists", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Antag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("antag_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AntagName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("antag_name"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("assigned_user_id_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("UserId") - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.Property("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.BanTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("ban_template_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoDelete") - .HasColumnType("boolean") - .HasColumnName("auto_delete"); - - b.Property("ExemptFlags") - .HasColumnType("integer") - .HasColumnName("exempt_flags"); - - b.Property("Hidden") - .HasColumnType("boolean") - .HasColumnName("hidden"); - - b.Property("Length") - .HasColumnType("interval") - .HasColumnName("length"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("text") - .HasColumnName("reason"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text") - .HasColumnName("title"); - - b.HasKey("Id") - .HasName("PK_ban_template"); - - b.ToTable("ban_template", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ConnectionLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("connection_log_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("inet") - .HasColumnName("address"); - - b.Property("Denied") - .HasColumnType("smallint") - .HasColumnName("denied"); - - b.Property("HWId") - .HasColumnType("bytea") - .HasColumnName("hwid"); - - b.Property("ServerId") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("server_id"); - - b.Property("Time") - .HasColumnType("timestamp with time zone") - .HasColumnName("time"); - - b.Property("UserId") - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.Property("UserName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("user_name"); - - b.HasKey("Id") - .HasName("PK_connection_log"); - - b.HasIndex("ServerId") - .HasDatabaseName("IX_connection_log_server_id"); - - b.HasIndex("Time"); - - b.HasIndex("UserId"); - - b.ToTable("connection_log", null, t => - { - t.HasCheckConstraint("AddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= address"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.Job", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("job_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("JobName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("job_name"); - - b.Property("Priority") - .HasColumnType("integer") - .HasColumnName("priority"); - - b.Property("ProfileId") - .HasColumnType("integer") - .HasColumnName("profile_id"); - - b.HasKey("Id") - .HasName("PK_job"); - - b.HasIndex("ProfileId"); - - 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.PlayTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("play_time_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("PlayerId") - .HasColumnType("uuid") - .HasColumnName("player_id"); - - b.Property("TimeSpent") - .HasColumnType("interval") - .HasColumnName("time_spent"); - - b.Property("Tracker") - .IsRequired() - .HasColumnType("text") - .HasColumnName("tracker"); - - b.HasKey("Id") - .HasName("PK_play_time"); - - b.HasIndex("PlayerId", "Tracker") - .IsUnique(); - - b.ToTable("play_time", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Player", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("player_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("FirstSeenTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("first_seen_time"); - - b.Property("LastReadRules") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_read_rules"); - - b.Property("LastSeenAddress") - .IsRequired() - .HasColumnType("inet") - .HasColumnName("last_seen_address"); - - b.Property("LastSeenHWId") - .HasColumnType("bytea") - .HasColumnName("last_seen_hwid"); - - b.Property("LastSeenTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_seen_time"); - - b.Property("LastSeenUserName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("last_seen_user_name"); - - b.Property("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", null, t => - { - t.HasCheckConstraint("LastSeenAddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= last_seen_address"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.Preference", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("preference_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminOOCColor") - .IsRequired() - .HasColumnType("text") - .HasColumnName("admin_ooc_color"); - - b.Property("SelectedCharacterSlot") - .HasColumnType("integer") - .HasColumnName("selected_character_slot"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("profile_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Age") - .HasColumnType("integer") - .HasColumnName("age"); - - b.Property("CharacterName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("char_name"); - - b.Property("EyeColor") - .IsRequired() - .HasColumnType("text") - .HasColumnName("eye_color"); - - b.Property("FacialHairColor") - .IsRequired() - .HasColumnType("text") - .HasColumnName("facial_hair_color"); - - b.Property("FacialHairName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("facial_hair_name"); - - b.Property("FlavorText") - .IsRequired() - .HasColumnType("text") - .HasColumnName("flavor_text"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("text") - .HasColumnName("gender"); - - b.Property("HairColor") - .IsRequired() - .HasColumnType("text") - .HasColumnName("hair_color"); - - b.Property("HairName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("hair_name"); - - b.Property("Markings") - .HasColumnType("jsonb") - .HasColumnName("markings"); - - b.Property("PreferenceId") - .HasColumnType("integer") - .HasColumnName("preference_id"); - - b.Property("PreferenceUnavailable") - .HasColumnType("integer") - .HasColumnName("pref_unavailable"); - - b.Property("Sex") - .IsRequired() - .HasColumnType("text") - .HasColumnName("sex"); - - b.Property("SkinColor") - .IsRequired() - .HasColumnType("text") - .HasColumnName("skin_color"); - - b.Property("Slot") - .HasColumnType("integer") - .HasColumnName("slot"); - - b.Property("SpawnPriority") - .HasColumnType("integer") - .HasColumnName("spawn_priority"); - - b.Property("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.ProfileLoadout", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("profile_loadout_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("LoadoutName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("loadout_name"); - - b.Property("ProfileLoadoutGroupId") - .HasColumnType("integer") - .HasColumnName("profile_loadout_group_id"); - - b.HasKey("Id") - .HasName("PK_profile_loadout"); - - b.HasIndex("ProfileLoadoutGroupId"); - - b.ToTable("profile_loadout", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("profile_loadout_group_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("GroupName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("group_name"); - - b.Property("ProfileRoleLoadoutId") - .HasColumnType("integer") - .HasColumnName("profile_role_loadout_id"); - - b.HasKey("Id") - .HasName("PK_profile_loadout_group"); - - b.HasIndex("ProfileRoleLoadoutId"); - - b.ToTable("profile_loadout_group", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("profile_role_loadout_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ProfileId") - .HasColumnType("integer") - .HasColumnName("profile_id"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("role_name"); - - b.HasKey("Id") - .HasName("PK_profile_role_loadout"); - - b.HasIndex("ProfileId"); - - b.ToTable("profile_role_loadout", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.RoleWhitelist", b => - { - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("RoleId") - .HasColumnType("text") - .HasColumnName("role_id"); - - b.HasKey("PlayerUserId", "RoleId") - .HasName("PK_role_whitelists"); - - b.ToTable("role_whitelists", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("round_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ServerId") - .HasColumnType("integer") - .HasColumnName("server_id"); - - b.Property("StartDate") - .HasColumnType("timestamp with time zone") - .HasColumnName("start_date"); - - b.HasKey("Id") - .HasName("PK_round"); - - b.HasIndex("ServerId") - .HasDatabaseName("IX_round_server_id"); - - b.HasIndex("StartDate"); - - b.ToTable("round", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Server", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("server_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("PK_server"); - - b.ToTable("server", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("server_ban_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .HasColumnType("inet") - .HasColumnName("address"); - - b.Property("AutoDelete") - .HasColumnType("boolean") - .HasColumnName("auto_delete"); - - b.Property("BanTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("ban_time"); - - b.Property("BanningAdmin") - .HasColumnType("uuid") - .HasColumnName("banning_admin"); - - b.Property("ExemptFlags") - .HasColumnType("integer") - .HasColumnName("exempt_flags"); - - b.Property("ExpirationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("expiration_time"); - - b.Property("HWId") - .HasColumnType("bytea") - .HasColumnName("hwid"); - - b.Property("Hidden") - .HasColumnType("boolean") - .HasColumnName("hidden"); - - b.Property("LastEditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("uuid") - .HasColumnName("last_edited_by_id"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("interval") - .HasColumnName("playtime_at_note"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("text") - .HasColumnName("reason"); - - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_server_ban"); - - b.HasIndex("Address"); - - b.HasIndex("BanningAdmin"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_server_ban_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_server_ban_round_id"); - - b.ToTable("server_ban", null, t => - { - t.HasCheckConstraint("AddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= address"); - - t.HasCheckConstraint("HaveEitherAddressOrUserIdOrHWId", "address IS NOT NULL OR player_user_id IS NOT NULL OR hwid IS NOT NULL"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBanExemption", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.Property("Flags") - .HasColumnType("integer") - .HasColumnName("flags"); - - b.HasKey("UserId") - .HasName("PK_server_ban_exemption"); - - b.ToTable("server_ban_exemption", null, t => - { - t.HasCheckConstraint("FlagsNotZero", "flags != 0"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBanHit", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("server_ban_hit_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BanId") - .HasColumnType("integer") - .HasColumnName("ban_id"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("server_role_ban_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .HasColumnType("inet") - .HasColumnName("address"); - - b.Property("BanTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("ban_time"); - - b.Property("BanningAdmin") - .HasColumnType("uuid") - .HasColumnName("banning_admin"); - - b.Property("ExpirationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("expiration_time"); - - b.Property("HWId") - .HasColumnType("bytea") - .HasColumnName("hwid"); - - b.Property("Hidden") - .HasColumnType("boolean") - .HasColumnName("hidden"); - - b.Property("LastEditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("uuid") - .HasColumnName("last_edited_by_id"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("interval") - .HasColumnName("playtime_at_note"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("text") - .HasColumnName("reason"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("text") - .HasColumnName("role_id"); - - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_server_role_ban"); - - b.HasIndex("Address"); - - b.HasIndex("BanningAdmin"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_server_role_ban_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_server_role_ban_round_id"); - - b.ToTable("server_role_ban", null, t => - { - t.HasCheckConstraint("AddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= address"); - - t.HasCheckConstraint("HaveEitherAddressOrUserIdOrHWId", "address IS NOT NULL OR player_user_id IS NOT NULL OR hwid IS NOT NULL"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerRoleUnban", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("role_unban_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BanId") - .HasColumnType("integer") - .HasColumnName("ban_id"); - - b.Property("UnbanTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("unban_time"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("unban_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BanId") - .HasColumnType("integer") - .HasColumnName("ban_id"); - - b.Property("UnbanTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("unban_time"); - - b.Property("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.Trait", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("trait_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ProfileId") - .HasColumnType("integer") - .HasColumnName("profile_id"); - - b.Property("TraitName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("trait_name"); - - b.HasKey("Id") - .HasName("PK_trait"); - - b.HasIndex("ProfileId", "TraitName") - .IsUnique(); - - b.ToTable("trait", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.UploadedResourceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("uploaded_resource_log_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Data") - .IsRequired() - .HasColumnType("bytea") - .HasColumnName("data"); - - b.Property("Date") - .HasColumnType("timestamp with time zone") - .HasColumnName("date"); - - b.Property("Path") - .IsRequired() - .HasColumnType("text") - .HasColumnName("path"); - - b.Property("UserId") - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.HasKey("Id") - .HasName("PK_uploaded_resource_log"); - - b.ToTable("uploaded_resource_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Whitelist", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.HasKey("UserId") - .HasName("PK_whitelist"); - - b.ToTable("whitelist", (string)null); - }); - - modelBuilder.Entity("PlayerRound", b => - { - b.Property("PlayersId") - .HasColumnType("integer") - .HasColumnName("players_id"); - - b.Property("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.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("RoundId", "LogId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_admin_log_player_admin_log_round_id_log_id"); - - b.Navigation("Log"); - - b.Navigation("Player"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminMessage", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminMessagesCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminMessagesDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminMessagesLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminMessagesReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_messages_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_messages_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminNote", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminNotesCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminNotesDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminNotesLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminNotesReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_notes_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_notes_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - 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.AdminWatchlist", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminWatchlistsCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminWatchlistsDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminWatchlistsLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminWatchlistsReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_watchlists_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_watchlists_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - 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.ConnectionLog", b => - { - b.HasOne("Content.Server.Database.Server", "Server") - .WithMany("ConnectionLogs") - .HasForeignKey("ServerId") - .OnDelete(DeleteBehavior.SetNull) - .IsRequired() - .HasConstraintName("FK_connection_log_server_server_id"); - - b.Navigation("Server"); - }); - - 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.ProfileLoadout", b => - { - b.HasOne("Content.Server.Database.ProfileLoadoutGroup", "ProfileLoadoutGroup") - .WithMany("Loadouts") - .HasForeignKey("ProfileLoadoutGroupId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_profile_loadout_profile_loadout_group_profile_loadout_group~"); - - b.Navigation("ProfileLoadoutGroup"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => - { - b.HasOne("Content.Server.Database.ProfileRoleLoadout", "ProfileRoleLoadout") - .WithMany("Groups") - .HasForeignKey("ProfileRoleLoadoutId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_profile_loadout_group_profile_role_loadout_profile_role_loa~"); - - b.Navigation("ProfileRoleLoadout"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => - { - b.HasOne("Content.Server.Database.Profile", "Profile") - .WithMany("Loadouts") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_profile_role_loadout_profile_profile_id"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("Content.Server.Database.RoleWhitelist", b => - { - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("JobWhitelists") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_role_whitelists_player_player_user_id"); - - b.Navigation("Player"); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.HasOne("Content.Server.Database.Server", "Server") - .WithMany("Rounds") - .HasForeignKey("ServerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_round_server_server_id"); - - b.Navigation("Server"); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBan", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminServerBansCreated") - .HasForeignKey("BanningAdmin") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_ban_player_banning_admin"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminServerBansLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_ban_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_server_ban_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Round"); - }); - - 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.ServerRoleBan", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminServerRoleBansCreated") - .HasForeignKey("BanningAdmin") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_role_ban_player_banning_admin"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminServerRoleBansLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_role_ban_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_server_role_ban_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Round"); - }); - - 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("Content.Server.Database.Trait", b => - { - b.HasOne("Content.Server.Database.Profile", "Profile") - .WithMany("Traits") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_trait_profile_profile_id"); - - b.Navigation("Profile"); - }); - - 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("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"); - - b.Navigation("AdminMessagesCreated"); - - b.Navigation("AdminMessagesDeleted"); - - b.Navigation("AdminMessagesLastEdited"); - - b.Navigation("AdminMessagesReceived"); - - b.Navigation("AdminNotesCreated"); - - b.Navigation("AdminNotesDeleted"); - - b.Navigation("AdminNotesLastEdited"); - - b.Navigation("AdminNotesReceived"); - - b.Navigation("AdminServerBansCreated"); - - b.Navigation("AdminServerBansLastEdited"); - - b.Navigation("AdminServerRoleBansCreated"); - - b.Navigation("AdminServerRoleBansLastEdited"); - - b.Navigation("AdminWatchlistsCreated"); - - b.Navigation("AdminWatchlistsDeleted"); - - b.Navigation("AdminWatchlistsLastEdited"); - - b.Navigation("AdminWatchlistsReceived"); - - b.Navigation("JobWhitelists"); - }); - - modelBuilder.Entity("Content.Server.Database.Preference", b => - { - b.Navigation("Profiles"); - }); - - modelBuilder.Entity("Content.Server.Database.Profile", b => - { - b.Navigation("Antags"); - - b.Navigation("Jobs"); - - b.Navigation("Loadouts"); - - b.Navigation("Traits"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => - { - b.Navigation("Loadouts"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => - { - b.Navigation("Groups"); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.Navigation("AdminLogs"); - }); - - modelBuilder.Entity("Content.Server.Database.Server", b => - { - b.Navigation("ConnectionLogs"); - - b.Navigation("Rounds"); - }); - - 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 - } - } -} diff --git a/Content.Server.Database/Migrations/Postgres/20240623005121_BanTemplate.cs b/Content.Server.Database/Migrations/Postgres/20240623005121_BanTemplate.cs deleted file mode 100644 index 192e87ac96b..00000000000 --- a/Content.Server.Database/Migrations/Postgres/20240623005121_BanTemplate.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Content.Server.Database.Migrations.Postgres -{ - /// - public partial class BanTemplate : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "ban_template", - columns: table => new - { - ban_template_id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - title = table.Column(type: "text", nullable: false), - length = table.Column(type: "interval", nullable: false), - reason = table.Column(type: "text", nullable: false), - exempt_flags = table.Column(type: "integer", nullable: false), - severity = table.Column(type: "integer", nullable: false), - auto_delete = table.Column(type: "boolean", nullable: false), - hidden = table.Column(type: "boolean", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ban_template", x => x.ban_template_id); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "ban_template"); - } - } -} diff --git a/Content.Server.Database/Migrations/Postgres/20241111170112_ModernHwid.Designer.cs b/Content.Server.Database/Migrations/Postgres/20241111170112_ModernHwid.Designer.cs deleted file mode 100644 index 155d6a163fd..00000000000 --- a/Content.Server.Database/Migrations/Postgres/20241111170112_ModernHwid.Designer.cs +++ /dev/null @@ -1,2072 +0,0 @@ -// -using System; -using System.Net; -using System.Text.Json; -using Content.Server.Database; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using NpgsqlTypes; - -#nullable disable - -namespace Content.Server.Database.Migrations.Postgres -{ - [DbContext(typeof(PostgresServerDbContext))] - [Migration("20241111170112_ModernHwid")] - partial class ModernHwid - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Content.Server.Database.Admin", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.Property("AdminRankId") - .HasColumnType("integer") - .HasColumnName("admin_rank_id"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_flag_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminId") - .HasColumnType("uuid") - .HasColumnName("admin_id"); - - b.Property("Flag") - .IsRequired() - .HasColumnType("text") - .HasColumnName("flag"); - - b.Property("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("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("Id") - .HasColumnType("integer") - .HasColumnName("admin_log_id"); - - b.Property("Date") - .HasColumnType("timestamp with time zone") - .HasColumnName("date"); - - b.Property("Impact") - .HasColumnType("smallint") - .HasColumnName("impact"); - - b.Property("Json") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("json"); - - b.Property("Message") - .IsRequired() - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("RoundId", "Id") - .HasName("PK_admin_log"); - - b.HasIndex("Date"); - - b.HasIndex("Message") - .HasAnnotation("Npgsql:TsVectorConfig", "english"); - - NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex("Message"), "GIN"); - - b.HasIndex("Type") - .HasDatabaseName("IX_admin_log_type"); - - b.ToTable("admin_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminLogPlayer", b => - { - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("LogId") - .HasColumnType("integer") - .HasColumnName("log_id"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.HasKey("RoundId", "LogId", "PlayerUserId") - .HasName("PK_admin_log_player"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_log_player_player_user_id"); - - b.ToTable("admin_log_player", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_messages_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("uuid") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("boolean") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("uuid") - .HasColumnName("deleted_by_id"); - - b.Property("Dismissed") - .HasColumnType("boolean") - .HasColumnName("dismissed"); - - b.Property("ExpirationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("uuid") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("interval") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("Seen") - .HasColumnType("boolean") - .HasColumnName("seen"); - - b.HasKey("Id") - .HasName("PK_admin_messages"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_messages_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_messages_round_id"); - - b.ToTable("admin_messages", null, t => - { - t.HasCheckConstraint("NotDismissedAndSeen", "NOT dismissed OR seen"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.AdminNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_notes_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("uuid") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("boolean") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("uuid") - .HasColumnName("deleted_by_id"); - - b.Property("ExpirationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .IsRequired() - .HasColumnType("timestamp with time zone") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("uuid") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("interval") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("Secret") - .HasColumnType("boolean") - .HasColumnName("secret"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_admin_notes"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_notes_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_notes_round_id"); - - b.ToTable("admin_notes", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminRank", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_rank_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_rank_flag_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminRankId") - .HasColumnType("integer") - .HasColumnName("admin_rank_id"); - - b.Property("Flag") - .IsRequired() - .HasColumnType("text") - .HasColumnName("flag"); - - b.HasKey("Id") - .HasName("PK_admin_rank_flag"); - - b.HasIndex("AdminRankId"); - - b.HasIndex("Flag", "AdminRankId") - .IsUnique(); - - b.ToTable("admin_rank_flag", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminWatchlist", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_watchlists_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("uuid") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("boolean") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("uuid") - .HasColumnName("deleted_by_id"); - - b.Property("ExpirationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .IsRequired() - .HasColumnType("timestamp with time zone") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("uuid") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("interval") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.HasKey("Id") - .HasName("PK_admin_watchlists"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_watchlists_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_watchlists_round_id"); - - b.ToTable("admin_watchlists", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Antag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("antag_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AntagName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("antag_name"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("assigned_user_id_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("UserId") - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.Property("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.BanTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("ban_template_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoDelete") - .HasColumnType("boolean") - .HasColumnName("auto_delete"); - - b.Property("ExemptFlags") - .HasColumnType("integer") - .HasColumnName("exempt_flags"); - - b.Property("Hidden") - .HasColumnType("boolean") - .HasColumnName("hidden"); - - b.Property("Length") - .HasColumnType("interval") - .HasColumnName("length"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("text") - .HasColumnName("reason"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text") - .HasColumnName("title"); - - b.HasKey("Id") - .HasName("PK_ban_template"); - - b.ToTable("ban_template", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Blacklist", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.HasKey("UserId") - .HasName("PK_blacklist"); - - b.ToTable("blacklist", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ConnectionLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("connection_log_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("inet") - .HasColumnName("address"); - - b.Property("Denied") - .HasColumnType("smallint") - .HasColumnName("denied"); - - b.Property("ServerId") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("server_id"); - - b.Property("Time") - .HasColumnType("timestamp with time zone") - .HasColumnName("time"); - - b.Property("UserId") - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.Property("UserName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("user_name"); - - b.HasKey("Id") - .HasName("PK_connection_log"); - - b.HasIndex("ServerId") - .HasDatabaseName("IX_connection_log_server_id"); - - b.HasIndex("Time"); - - b.HasIndex("UserId"); - - b.ToTable("connection_log", null, t => - { - t.HasCheckConstraint("AddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= address"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.Job", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("job_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("JobName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("job_name"); - - b.Property("Priority") - .HasColumnType("integer") - .HasColumnName("priority"); - - b.Property("ProfileId") - .HasColumnType("integer") - .HasColumnName("profile_id"); - - b.HasKey("Id") - .HasName("PK_job"); - - b.HasIndex("ProfileId"); - - 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.PlayTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("play_time_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("PlayerId") - .HasColumnType("uuid") - .HasColumnName("player_id"); - - b.Property("TimeSpent") - .HasColumnType("interval") - .HasColumnName("time_spent"); - - b.Property("Tracker") - .IsRequired() - .HasColumnType("text") - .HasColumnName("tracker"); - - b.HasKey("Id") - .HasName("PK_play_time"); - - b.HasIndex("PlayerId", "Tracker") - .IsUnique(); - - b.ToTable("play_time", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Player", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("player_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("FirstSeenTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("first_seen_time"); - - b.Property("LastReadRules") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_read_rules"); - - b.Property("LastSeenAddress") - .IsRequired() - .HasColumnType("inet") - .HasColumnName("last_seen_address"); - - b.Property("LastSeenTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_seen_time"); - - b.Property("LastSeenUserName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("last_seen_user_name"); - - b.Property("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", null, t => - { - t.HasCheckConstraint("LastSeenAddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= last_seen_address"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.Preference", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("preference_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminOOCColor") - .IsRequired() - .HasColumnType("text") - .HasColumnName("admin_ooc_color"); - - b.Property("SelectedCharacterSlot") - .HasColumnType("integer") - .HasColumnName("selected_character_slot"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("profile_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Age") - .HasColumnType("integer") - .HasColumnName("age"); - - b.Property("CharacterName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("char_name"); - - b.Property("EyeColor") - .IsRequired() - .HasColumnType("text") - .HasColumnName("eye_color"); - - b.Property("FacialHairColor") - .IsRequired() - .HasColumnType("text") - .HasColumnName("facial_hair_color"); - - b.Property("FacialHairName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("facial_hair_name"); - - b.Property("FlavorText") - .IsRequired() - .HasColumnType("text") - .HasColumnName("flavor_text"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("text") - .HasColumnName("gender"); - - b.Property("HairColor") - .IsRequired() - .HasColumnType("text") - .HasColumnName("hair_color"); - - b.Property("HairName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("hair_name"); - - b.Property("Markings") - .HasColumnType("jsonb") - .HasColumnName("markings"); - - b.Property("PreferenceId") - .HasColumnType("integer") - .HasColumnName("preference_id"); - - b.Property("PreferenceUnavailable") - .HasColumnType("integer") - .HasColumnName("pref_unavailable"); - - b.Property("Sex") - .IsRequired() - .HasColumnType("text") - .HasColumnName("sex"); - - b.Property("SkinColor") - .IsRequired() - .HasColumnType("text") - .HasColumnName("skin_color"); - - b.Property("Slot") - .HasColumnType("integer") - .HasColumnName("slot"); - - b.Property("SpawnPriority") - .HasColumnType("integer") - .HasColumnName("spawn_priority"); - - b.Property("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.ProfileLoadout", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("profile_loadout_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("LoadoutName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("loadout_name"); - - b.Property("ProfileLoadoutGroupId") - .HasColumnType("integer") - .HasColumnName("profile_loadout_group_id"); - - b.HasKey("Id") - .HasName("PK_profile_loadout"); - - b.HasIndex("ProfileLoadoutGroupId"); - - b.ToTable("profile_loadout", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("profile_loadout_group_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("GroupName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("group_name"); - - b.Property("ProfileRoleLoadoutId") - .HasColumnType("integer") - .HasColumnName("profile_role_loadout_id"); - - b.HasKey("Id") - .HasName("PK_profile_loadout_group"); - - b.HasIndex("ProfileRoleLoadoutId"); - - b.ToTable("profile_loadout_group", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("profile_role_loadout_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ProfileId") - .HasColumnType("integer") - .HasColumnName("profile_id"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("role_name"); - - b.HasKey("Id") - .HasName("PK_profile_role_loadout"); - - b.HasIndex("ProfileId"); - - b.ToTable("profile_role_loadout", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.RoleWhitelist", b => - { - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("RoleId") - .HasColumnType("text") - .HasColumnName("role_id"); - - b.HasKey("PlayerUserId", "RoleId") - .HasName("PK_role_whitelists"); - - b.ToTable("role_whitelists", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("round_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ServerId") - .HasColumnType("integer") - .HasColumnName("server_id"); - - b.Property("StartDate") - .HasColumnType("timestamp with time zone") - .HasColumnName("start_date"); - - b.HasKey("Id") - .HasName("PK_round"); - - b.HasIndex("ServerId") - .HasDatabaseName("IX_round_server_id"); - - b.HasIndex("StartDate"); - - b.ToTable("round", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Server", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("server_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("PK_server"); - - b.ToTable("server", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("server_ban_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .HasColumnType("inet") - .HasColumnName("address"); - - b.Property("AutoDelete") - .HasColumnType("boolean") - .HasColumnName("auto_delete"); - - b.Property("BanTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("ban_time"); - - b.Property("BanningAdmin") - .HasColumnType("uuid") - .HasColumnName("banning_admin"); - - b.Property("ExemptFlags") - .HasColumnType("integer") - .HasColumnName("exempt_flags"); - - b.Property("ExpirationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("expiration_time"); - - b.Property("Hidden") - .HasColumnType("boolean") - .HasColumnName("hidden"); - - b.Property("LastEditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("uuid") - .HasColumnName("last_edited_by_id"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("interval") - .HasColumnName("playtime_at_note"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("text") - .HasColumnName("reason"); - - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_server_ban"); - - b.HasIndex("Address"); - - b.HasIndex("BanningAdmin"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_server_ban_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_server_ban_round_id"); - - b.ToTable("server_ban", null, t => - { - t.HasCheckConstraint("AddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= address"); - - t.HasCheckConstraint("HaveEitherAddressOrUserIdOrHWId", "address IS NOT NULL OR player_user_id IS NOT NULL OR hwid IS NOT NULL"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBanExemption", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.Property("Flags") - .HasColumnType("integer") - .HasColumnName("flags"); - - b.HasKey("UserId") - .HasName("PK_server_ban_exemption"); - - b.ToTable("server_ban_exemption", null, t => - { - t.HasCheckConstraint("FlagsNotZero", "flags != 0"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBanHit", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("server_ban_hit_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BanId") - .HasColumnType("integer") - .HasColumnName("ban_id"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("server_role_ban_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .HasColumnType("inet") - .HasColumnName("address"); - - b.Property("BanTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("ban_time"); - - b.Property("BanningAdmin") - .HasColumnType("uuid") - .HasColumnName("banning_admin"); - - b.Property("ExpirationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("expiration_time"); - - b.Property("Hidden") - .HasColumnType("boolean") - .HasColumnName("hidden"); - - b.Property("LastEditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("uuid") - .HasColumnName("last_edited_by_id"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("interval") - .HasColumnName("playtime_at_note"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("text") - .HasColumnName("reason"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("text") - .HasColumnName("role_id"); - - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_server_role_ban"); - - b.HasIndex("Address"); - - b.HasIndex("BanningAdmin"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_server_role_ban_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_server_role_ban_round_id"); - - b.ToTable("server_role_ban", null, t => - { - t.HasCheckConstraint("AddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= address"); - - t.HasCheckConstraint("HaveEitherAddressOrUserIdOrHWId", "address IS NOT NULL OR player_user_id IS NOT NULL OR hwid IS NOT NULL"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerRoleUnban", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("role_unban_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BanId") - .HasColumnType("integer") - .HasColumnName("ban_id"); - - b.Property("UnbanTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("unban_time"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("unban_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BanId") - .HasColumnType("integer") - .HasColumnName("ban_id"); - - b.Property("UnbanTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("unban_time"); - - b.Property("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.Trait", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("trait_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ProfileId") - .HasColumnType("integer") - .HasColumnName("profile_id"); - - b.Property("TraitName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("trait_name"); - - b.HasKey("Id") - .HasName("PK_trait"); - - b.HasIndex("ProfileId", "TraitName") - .IsUnique(); - - b.ToTable("trait", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.UploadedResourceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("uploaded_resource_log_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Data") - .IsRequired() - .HasColumnType("bytea") - .HasColumnName("data"); - - b.Property("Date") - .HasColumnType("timestamp with time zone") - .HasColumnName("date"); - - b.Property("Path") - .IsRequired() - .HasColumnType("text") - .HasColumnName("path"); - - b.Property("UserId") - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.HasKey("Id") - .HasName("PK_uploaded_resource_log"); - - b.ToTable("uploaded_resource_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Whitelist", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.HasKey("UserId") - .HasName("PK_whitelist"); - - b.ToTable("whitelist", (string)null); - }); - - modelBuilder.Entity("PlayerRound", b => - { - b.Property("PlayersId") - .HasColumnType("integer") - .HasColumnName("players_id"); - - b.Property("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.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("RoundId", "LogId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_admin_log_player_admin_log_round_id_log_id"); - - b.Navigation("Log"); - - b.Navigation("Player"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminMessage", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminMessagesCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminMessagesDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminMessagesLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminMessagesReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_messages_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_messages_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminNote", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminNotesCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminNotesDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminNotesLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminNotesReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_notes_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_notes_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - 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.AdminWatchlist", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminWatchlistsCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminWatchlistsDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminWatchlistsLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminWatchlistsReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_watchlists_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_watchlists_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - 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.ConnectionLog", b => - { - b.HasOne("Content.Server.Database.Server", "Server") - .WithMany("ConnectionLogs") - .HasForeignKey("ServerId") - .OnDelete(DeleteBehavior.SetNull) - .IsRequired() - .HasConstraintName("FK_connection_log_server_server_id"); - - b.OwnsOne("Content.Server.Database.TypedHwid", "HWId", b1 => - { - b1.Property("ConnectionLogId") - .HasColumnType("integer") - .HasColumnName("connection_log_id"); - - b1.Property("Hwid") - .IsRequired() - .HasColumnType("bytea") - .HasColumnName("hwid"); - - b1.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("hwid_type"); - - b1.HasKey("ConnectionLogId"); - - b1.ToTable("connection_log"); - - b1.WithOwner() - .HasForeignKey("ConnectionLogId") - .HasConstraintName("FK_connection_log_connection_log_connection_log_id"); - }); - - b.Navigation("HWId"); - - b.Navigation("Server"); - }); - - 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.Player", b => - { - b.OwnsOne("Content.Server.Database.TypedHwid", "LastSeenHWId", b1 => - { - b1.Property("PlayerId") - .HasColumnType("integer") - .HasColumnName("player_id"); - - b1.Property("Hwid") - .IsRequired() - .HasColumnType("bytea") - .HasColumnName("last_seen_hwid"); - - b1.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("last_seen_hwid_type"); - - b1.HasKey("PlayerId"); - - b1.ToTable("player"); - - b1.WithOwner() - .HasForeignKey("PlayerId") - .HasConstraintName("FK_player_player_player_id"); - }); - - b.Navigation("LastSeenHWId"); - }); - - 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.ProfileLoadout", b => - { - b.HasOne("Content.Server.Database.ProfileLoadoutGroup", "ProfileLoadoutGroup") - .WithMany("Loadouts") - .HasForeignKey("ProfileLoadoutGroupId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_profile_loadout_profile_loadout_group_profile_loadout_group~"); - - b.Navigation("ProfileLoadoutGroup"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => - { - b.HasOne("Content.Server.Database.ProfileRoleLoadout", "ProfileRoleLoadout") - .WithMany("Groups") - .HasForeignKey("ProfileRoleLoadoutId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_profile_loadout_group_profile_role_loadout_profile_role_loa~"); - - b.Navigation("ProfileRoleLoadout"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => - { - b.HasOne("Content.Server.Database.Profile", "Profile") - .WithMany("Loadouts") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_profile_role_loadout_profile_profile_id"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("Content.Server.Database.RoleWhitelist", b => - { - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("JobWhitelists") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_role_whitelists_player_player_user_id"); - - b.Navigation("Player"); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.HasOne("Content.Server.Database.Server", "Server") - .WithMany("Rounds") - .HasForeignKey("ServerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_round_server_server_id"); - - b.Navigation("Server"); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBan", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminServerBansCreated") - .HasForeignKey("BanningAdmin") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_ban_player_banning_admin"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminServerBansLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_ban_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_server_ban_round_round_id"); - - b.OwnsOne("Content.Server.Database.TypedHwid", "HWId", b1 => - { - b1.Property("ServerBanId") - .HasColumnType("integer") - .HasColumnName("server_ban_id"); - - b1.Property("Hwid") - .IsRequired() - .HasColumnType("bytea") - .HasColumnName("hwid"); - - b1.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("hwid_type"); - - b1.HasKey("ServerBanId"); - - b1.ToTable("server_ban"); - - b1.WithOwner() - .HasForeignKey("ServerBanId") - .HasConstraintName("FK_server_ban_server_ban_server_ban_id"); - }); - - b.Navigation("CreatedBy"); - - b.Navigation("HWId"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Round"); - }); - - 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.ServerRoleBan", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminServerRoleBansCreated") - .HasForeignKey("BanningAdmin") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_role_ban_player_banning_admin"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminServerRoleBansLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_role_ban_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_server_role_ban_round_round_id"); - - b.OwnsOne("Content.Server.Database.TypedHwid", "HWId", b1 => - { - b1.Property("ServerRoleBanId") - .HasColumnType("integer") - .HasColumnName("server_role_ban_id"); - - b1.Property("Hwid") - .IsRequired() - .HasColumnType("bytea") - .HasColumnName("hwid"); - - b1.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("hwid_type"); - - b1.HasKey("ServerRoleBanId"); - - b1.ToTable("server_role_ban"); - - b1.WithOwner() - .HasForeignKey("ServerRoleBanId") - .HasConstraintName("FK_server_role_ban_server_role_ban_server_role_ban_id"); - }); - - b.Navigation("CreatedBy"); - - b.Navigation("HWId"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Round"); - }); - - 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("Content.Server.Database.Trait", b => - { - b.HasOne("Content.Server.Database.Profile", "Profile") - .WithMany("Traits") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_trait_profile_profile_id"); - - b.Navigation("Profile"); - }); - - 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("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"); - - b.Navigation("AdminMessagesCreated"); - - b.Navigation("AdminMessagesDeleted"); - - b.Navigation("AdminMessagesLastEdited"); - - b.Navigation("AdminMessagesReceived"); - - b.Navigation("AdminNotesCreated"); - - b.Navigation("AdminNotesDeleted"); - - b.Navigation("AdminNotesLastEdited"); - - b.Navigation("AdminNotesReceived"); - - b.Navigation("AdminServerBansCreated"); - - b.Navigation("AdminServerBansLastEdited"); - - b.Navigation("AdminServerRoleBansCreated"); - - b.Navigation("AdminServerRoleBansLastEdited"); - - b.Navigation("AdminWatchlistsCreated"); - - b.Navigation("AdminWatchlistsDeleted"); - - b.Navigation("AdminWatchlistsLastEdited"); - - b.Navigation("AdminWatchlistsReceived"); - - b.Navigation("JobWhitelists"); - }); - - modelBuilder.Entity("Content.Server.Database.Preference", b => - { - b.Navigation("Profiles"); - }); - - modelBuilder.Entity("Content.Server.Database.Profile", b => - { - b.Navigation("Antags"); - - b.Navigation("Jobs"); - - b.Navigation("Loadouts"); - - b.Navigation("Traits"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => - { - b.Navigation("Loadouts"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => - { - b.Navigation("Groups"); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.Navigation("AdminLogs"); - }); - - modelBuilder.Entity("Content.Server.Database.Server", b => - { - b.Navigation("ConnectionLogs"); - - b.Navigation("Rounds"); - }); - - 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 - } - } -} diff --git a/Content.Server.Database/Migrations/Postgres/20241111170112_ModernHwid.cs b/Content.Server.Database/Migrations/Postgres/20241111170112_ModernHwid.cs deleted file mode 100644 index c70a5ffaa58..00000000000 --- a/Content.Server.Database/Migrations/Postgres/20241111170112_ModernHwid.cs +++ /dev/null @@ -1,62 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Content.Server.Database.Migrations.Postgres -{ - /// - public partial class ModernHwid : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "hwid_type", - table: "server_role_ban", - type: "integer", - nullable: true, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "hwid_type", - table: "server_ban", - type: "integer", - nullable: true, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "last_seen_hwid_type", - table: "player", - type: "integer", - nullable: true, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "hwid_type", - table: "connection_log", - type: "integer", - nullable: true, - defaultValue: 0); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "hwid_type", - table: "server_role_ban"); - - migrationBuilder.DropColumn( - name: "hwid_type", - table: "server_ban"); - - migrationBuilder.DropColumn( - name: "last_seen_hwid_type", - table: "player"); - - migrationBuilder.DropColumn( - name: "hwid_type", - table: "connection_log"); - } - } -} diff --git a/Content.Server.Database/Migrations/Postgres/20241111193608_ConnectionTrust.Designer.cs b/Content.Server.Database/Migrations/Postgres/20241111193608_ConnectionTrust.Designer.cs deleted file mode 100644 index dc1b4a0eeb7..00000000000 --- a/Content.Server.Database/Migrations/Postgres/20241111193608_ConnectionTrust.Designer.cs +++ /dev/null @@ -1,2076 +0,0 @@ -// -using System; -using System.Net; -using System.Text.Json; -using Content.Server.Database; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using NpgsqlTypes; - -#nullable disable - -namespace Content.Server.Database.Migrations.Postgres -{ - [DbContext(typeof(PostgresServerDbContext))] - [Migration("20241111193608_ConnectionTrust")] - partial class ConnectionTrust - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Content.Server.Database.Admin", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.Property("AdminRankId") - .HasColumnType("integer") - .HasColumnName("admin_rank_id"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_flag_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminId") - .HasColumnType("uuid") - .HasColumnName("admin_id"); - - b.Property("Flag") - .IsRequired() - .HasColumnType("text") - .HasColumnName("flag"); - - b.Property("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("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("Id") - .HasColumnType("integer") - .HasColumnName("admin_log_id"); - - b.Property("Date") - .HasColumnType("timestamp with time zone") - .HasColumnName("date"); - - b.Property("Impact") - .HasColumnType("smallint") - .HasColumnName("impact"); - - b.Property("Json") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("json"); - - b.Property("Message") - .IsRequired() - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("RoundId", "Id") - .HasName("PK_admin_log"); - - b.HasIndex("Date"); - - b.HasIndex("Message") - .HasAnnotation("Npgsql:TsVectorConfig", "english"); - - NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex("Message"), "GIN"); - - b.HasIndex("Type") - .HasDatabaseName("IX_admin_log_type"); - - b.ToTable("admin_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminLogPlayer", b => - { - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("LogId") - .HasColumnType("integer") - .HasColumnName("log_id"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.HasKey("RoundId", "LogId", "PlayerUserId") - .HasName("PK_admin_log_player"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_log_player_player_user_id"); - - b.ToTable("admin_log_player", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_messages_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("uuid") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("boolean") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("uuid") - .HasColumnName("deleted_by_id"); - - b.Property("Dismissed") - .HasColumnType("boolean") - .HasColumnName("dismissed"); - - b.Property("ExpirationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("uuid") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("interval") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("Seen") - .HasColumnType("boolean") - .HasColumnName("seen"); - - b.HasKey("Id") - .HasName("PK_admin_messages"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_messages_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_messages_round_id"); - - b.ToTable("admin_messages", null, t => - { - t.HasCheckConstraint("NotDismissedAndSeen", "NOT dismissed OR seen"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.AdminNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_notes_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("uuid") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("boolean") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("uuid") - .HasColumnName("deleted_by_id"); - - b.Property("ExpirationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .IsRequired() - .HasColumnType("timestamp with time zone") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("uuid") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("interval") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("Secret") - .HasColumnType("boolean") - .HasColumnName("secret"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_admin_notes"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_notes_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_notes_round_id"); - - b.ToTable("admin_notes", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminRank", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_rank_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_rank_flag_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminRankId") - .HasColumnType("integer") - .HasColumnName("admin_rank_id"); - - b.Property("Flag") - .IsRequired() - .HasColumnType("text") - .HasColumnName("flag"); - - b.HasKey("Id") - .HasName("PK_admin_rank_flag"); - - b.HasIndex("AdminRankId"); - - b.HasIndex("Flag", "AdminRankId") - .IsUnique(); - - b.ToTable("admin_rank_flag", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminWatchlist", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_watchlists_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("uuid") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("boolean") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("uuid") - .HasColumnName("deleted_by_id"); - - b.Property("ExpirationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .IsRequired() - .HasColumnType("timestamp with time zone") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("uuid") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("interval") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.HasKey("Id") - .HasName("PK_admin_watchlists"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_watchlists_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_watchlists_round_id"); - - b.ToTable("admin_watchlists", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Antag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("antag_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AntagName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("antag_name"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("assigned_user_id_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("UserId") - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.Property("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.BanTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("ban_template_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoDelete") - .HasColumnType("boolean") - .HasColumnName("auto_delete"); - - b.Property("ExemptFlags") - .HasColumnType("integer") - .HasColumnName("exempt_flags"); - - b.Property("Hidden") - .HasColumnType("boolean") - .HasColumnName("hidden"); - - b.Property("Length") - .HasColumnType("interval") - .HasColumnName("length"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("text") - .HasColumnName("reason"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text") - .HasColumnName("title"); - - b.HasKey("Id") - .HasName("PK_ban_template"); - - b.ToTable("ban_template", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Blacklist", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.HasKey("UserId") - .HasName("PK_blacklist"); - - b.ToTable("blacklist", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ConnectionLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("connection_log_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("inet") - .HasColumnName("address"); - - b.Property("Denied") - .HasColumnType("smallint") - .HasColumnName("denied"); - - b.Property("ServerId") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("server_id"); - - b.Property("Time") - .HasColumnType("timestamp with time zone") - .HasColumnName("time"); - - b.Property("Trust") - .HasColumnType("real") - .HasColumnName("trust"); - - b.Property("UserId") - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.Property("UserName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("user_name"); - - b.HasKey("Id") - .HasName("PK_connection_log"); - - b.HasIndex("ServerId") - .HasDatabaseName("IX_connection_log_server_id"); - - b.HasIndex("Time"); - - b.HasIndex("UserId"); - - b.ToTable("connection_log", null, t => - { - t.HasCheckConstraint("AddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= address"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.Job", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("job_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("JobName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("job_name"); - - b.Property("Priority") - .HasColumnType("integer") - .HasColumnName("priority"); - - b.Property("ProfileId") - .HasColumnType("integer") - .HasColumnName("profile_id"); - - b.HasKey("Id") - .HasName("PK_job"); - - b.HasIndex("ProfileId"); - - 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.PlayTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("play_time_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("PlayerId") - .HasColumnType("uuid") - .HasColumnName("player_id"); - - b.Property("TimeSpent") - .HasColumnType("interval") - .HasColumnName("time_spent"); - - b.Property("Tracker") - .IsRequired() - .HasColumnType("text") - .HasColumnName("tracker"); - - b.HasKey("Id") - .HasName("PK_play_time"); - - b.HasIndex("PlayerId", "Tracker") - .IsUnique(); - - b.ToTable("play_time", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Player", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("player_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("FirstSeenTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("first_seen_time"); - - b.Property("LastReadRules") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_read_rules"); - - b.Property("LastSeenAddress") - .IsRequired() - .HasColumnType("inet") - .HasColumnName("last_seen_address"); - - b.Property("LastSeenTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_seen_time"); - - b.Property("LastSeenUserName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("last_seen_user_name"); - - b.Property("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", null, t => - { - t.HasCheckConstraint("LastSeenAddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= last_seen_address"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.Preference", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("preference_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminOOCColor") - .IsRequired() - .HasColumnType("text") - .HasColumnName("admin_ooc_color"); - - b.Property("SelectedCharacterSlot") - .HasColumnType("integer") - .HasColumnName("selected_character_slot"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("profile_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Age") - .HasColumnType("integer") - .HasColumnName("age"); - - b.Property("CharacterName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("char_name"); - - b.Property("EyeColor") - .IsRequired() - .HasColumnType("text") - .HasColumnName("eye_color"); - - b.Property("FacialHairColor") - .IsRequired() - .HasColumnType("text") - .HasColumnName("facial_hair_color"); - - b.Property("FacialHairName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("facial_hair_name"); - - b.Property("FlavorText") - .IsRequired() - .HasColumnType("text") - .HasColumnName("flavor_text"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("text") - .HasColumnName("gender"); - - b.Property("HairColor") - .IsRequired() - .HasColumnType("text") - .HasColumnName("hair_color"); - - b.Property("HairName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("hair_name"); - - b.Property("Markings") - .HasColumnType("jsonb") - .HasColumnName("markings"); - - b.Property("PreferenceId") - .HasColumnType("integer") - .HasColumnName("preference_id"); - - b.Property("PreferenceUnavailable") - .HasColumnType("integer") - .HasColumnName("pref_unavailable"); - - b.Property("Sex") - .IsRequired() - .HasColumnType("text") - .HasColumnName("sex"); - - b.Property("SkinColor") - .IsRequired() - .HasColumnType("text") - .HasColumnName("skin_color"); - - b.Property("Slot") - .HasColumnType("integer") - .HasColumnName("slot"); - - b.Property("SpawnPriority") - .HasColumnType("integer") - .HasColumnName("spawn_priority"); - - b.Property("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.ProfileLoadout", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("profile_loadout_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("LoadoutName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("loadout_name"); - - b.Property("ProfileLoadoutGroupId") - .HasColumnType("integer") - .HasColumnName("profile_loadout_group_id"); - - b.HasKey("Id") - .HasName("PK_profile_loadout"); - - b.HasIndex("ProfileLoadoutGroupId"); - - b.ToTable("profile_loadout", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("profile_loadout_group_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("GroupName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("group_name"); - - b.Property("ProfileRoleLoadoutId") - .HasColumnType("integer") - .HasColumnName("profile_role_loadout_id"); - - b.HasKey("Id") - .HasName("PK_profile_loadout_group"); - - b.HasIndex("ProfileRoleLoadoutId"); - - b.ToTable("profile_loadout_group", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("profile_role_loadout_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ProfileId") - .HasColumnType("integer") - .HasColumnName("profile_id"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("role_name"); - - b.HasKey("Id") - .HasName("PK_profile_role_loadout"); - - b.HasIndex("ProfileId"); - - b.ToTable("profile_role_loadout", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.RoleWhitelist", b => - { - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("RoleId") - .HasColumnType("text") - .HasColumnName("role_id"); - - b.HasKey("PlayerUserId", "RoleId") - .HasName("PK_role_whitelists"); - - b.ToTable("role_whitelists", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("round_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ServerId") - .HasColumnType("integer") - .HasColumnName("server_id"); - - b.Property("StartDate") - .HasColumnType("timestamp with time zone") - .HasColumnName("start_date"); - - b.HasKey("Id") - .HasName("PK_round"); - - b.HasIndex("ServerId") - .HasDatabaseName("IX_round_server_id"); - - b.HasIndex("StartDate"); - - b.ToTable("round", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Server", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("server_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("PK_server"); - - b.ToTable("server", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("server_ban_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .HasColumnType("inet") - .HasColumnName("address"); - - b.Property("AutoDelete") - .HasColumnType("boolean") - .HasColumnName("auto_delete"); - - b.Property("BanTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("ban_time"); - - b.Property("BanningAdmin") - .HasColumnType("uuid") - .HasColumnName("banning_admin"); - - b.Property("ExemptFlags") - .HasColumnType("integer") - .HasColumnName("exempt_flags"); - - b.Property("ExpirationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("expiration_time"); - - b.Property("Hidden") - .HasColumnType("boolean") - .HasColumnName("hidden"); - - b.Property("LastEditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("uuid") - .HasColumnName("last_edited_by_id"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("interval") - .HasColumnName("playtime_at_note"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("text") - .HasColumnName("reason"); - - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_server_ban"); - - b.HasIndex("Address"); - - b.HasIndex("BanningAdmin"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_server_ban_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_server_ban_round_id"); - - b.ToTable("server_ban", null, t => - { - t.HasCheckConstraint("AddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= address"); - - t.HasCheckConstraint("HaveEitherAddressOrUserIdOrHWId", "address IS NOT NULL OR player_user_id IS NOT NULL OR hwid IS NOT NULL"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBanExemption", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.Property("Flags") - .HasColumnType("integer") - .HasColumnName("flags"); - - b.HasKey("UserId") - .HasName("PK_server_ban_exemption"); - - b.ToTable("server_ban_exemption", null, t => - { - t.HasCheckConstraint("FlagsNotZero", "flags != 0"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBanHit", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("server_ban_hit_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BanId") - .HasColumnType("integer") - .HasColumnName("ban_id"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("server_role_ban_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .HasColumnType("inet") - .HasColumnName("address"); - - b.Property("BanTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("ban_time"); - - b.Property("BanningAdmin") - .HasColumnType("uuid") - .HasColumnName("banning_admin"); - - b.Property("ExpirationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("expiration_time"); - - b.Property("Hidden") - .HasColumnType("boolean") - .HasColumnName("hidden"); - - b.Property("LastEditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("uuid") - .HasColumnName("last_edited_by_id"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("interval") - .HasColumnName("playtime_at_note"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("text") - .HasColumnName("reason"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("text") - .HasColumnName("role_id"); - - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_server_role_ban"); - - b.HasIndex("Address"); - - b.HasIndex("BanningAdmin"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_server_role_ban_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_server_role_ban_round_id"); - - b.ToTable("server_role_ban", null, t => - { - t.HasCheckConstraint("AddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= address"); - - t.HasCheckConstraint("HaveEitherAddressOrUserIdOrHWId", "address IS NOT NULL OR player_user_id IS NOT NULL OR hwid IS NOT NULL"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerRoleUnban", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("role_unban_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BanId") - .HasColumnType("integer") - .HasColumnName("ban_id"); - - b.Property("UnbanTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("unban_time"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("unban_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BanId") - .HasColumnType("integer") - .HasColumnName("ban_id"); - - b.Property("UnbanTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("unban_time"); - - b.Property("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.Trait", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("trait_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ProfileId") - .HasColumnType("integer") - .HasColumnName("profile_id"); - - b.Property("TraitName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("trait_name"); - - b.HasKey("Id") - .HasName("PK_trait"); - - b.HasIndex("ProfileId", "TraitName") - .IsUnique(); - - b.ToTable("trait", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.UploadedResourceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("uploaded_resource_log_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Data") - .IsRequired() - .HasColumnType("bytea") - .HasColumnName("data"); - - b.Property("Date") - .HasColumnType("timestamp with time zone") - .HasColumnName("date"); - - b.Property("Path") - .IsRequired() - .HasColumnType("text") - .HasColumnName("path"); - - b.Property("UserId") - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.HasKey("Id") - .HasName("PK_uploaded_resource_log"); - - b.ToTable("uploaded_resource_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Whitelist", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.HasKey("UserId") - .HasName("PK_whitelist"); - - b.ToTable("whitelist", (string)null); - }); - - modelBuilder.Entity("PlayerRound", b => - { - b.Property("PlayersId") - .HasColumnType("integer") - .HasColumnName("players_id"); - - b.Property("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.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("RoundId", "LogId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_admin_log_player_admin_log_round_id_log_id"); - - b.Navigation("Log"); - - b.Navigation("Player"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminMessage", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminMessagesCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminMessagesDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminMessagesLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminMessagesReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_messages_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_messages_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminNote", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminNotesCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminNotesDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminNotesLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminNotesReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_notes_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_notes_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - 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.AdminWatchlist", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminWatchlistsCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminWatchlistsDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminWatchlistsLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminWatchlistsReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_watchlists_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_watchlists_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - 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.ConnectionLog", b => - { - b.HasOne("Content.Server.Database.Server", "Server") - .WithMany("ConnectionLogs") - .HasForeignKey("ServerId") - .OnDelete(DeleteBehavior.SetNull) - .IsRequired() - .HasConstraintName("FK_connection_log_server_server_id"); - - b.OwnsOne("Content.Server.Database.TypedHwid", "HWId", b1 => - { - b1.Property("ConnectionLogId") - .HasColumnType("integer") - .HasColumnName("connection_log_id"); - - b1.Property("Hwid") - .IsRequired() - .HasColumnType("bytea") - .HasColumnName("hwid"); - - b1.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("hwid_type"); - - b1.HasKey("ConnectionLogId"); - - b1.ToTable("connection_log"); - - b1.WithOwner() - .HasForeignKey("ConnectionLogId") - .HasConstraintName("FK_connection_log_connection_log_connection_log_id"); - }); - - b.Navigation("HWId"); - - b.Navigation("Server"); - }); - - 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.Player", b => - { - b.OwnsOne("Content.Server.Database.TypedHwid", "LastSeenHWId", b1 => - { - b1.Property("PlayerId") - .HasColumnType("integer") - .HasColumnName("player_id"); - - b1.Property("Hwid") - .IsRequired() - .HasColumnType("bytea") - .HasColumnName("last_seen_hwid"); - - b1.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("last_seen_hwid_type"); - - b1.HasKey("PlayerId"); - - b1.ToTable("player"); - - b1.WithOwner() - .HasForeignKey("PlayerId") - .HasConstraintName("FK_player_player_player_id"); - }); - - b.Navigation("LastSeenHWId"); - }); - - 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.ProfileLoadout", b => - { - b.HasOne("Content.Server.Database.ProfileLoadoutGroup", "ProfileLoadoutGroup") - .WithMany("Loadouts") - .HasForeignKey("ProfileLoadoutGroupId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_profile_loadout_profile_loadout_group_profile_loadout_group~"); - - b.Navigation("ProfileLoadoutGroup"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => - { - b.HasOne("Content.Server.Database.ProfileRoleLoadout", "ProfileRoleLoadout") - .WithMany("Groups") - .HasForeignKey("ProfileRoleLoadoutId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_profile_loadout_group_profile_role_loadout_profile_role_loa~"); - - b.Navigation("ProfileRoleLoadout"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => - { - b.HasOne("Content.Server.Database.Profile", "Profile") - .WithMany("Loadouts") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_profile_role_loadout_profile_profile_id"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("Content.Server.Database.RoleWhitelist", b => - { - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("JobWhitelists") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_role_whitelists_player_player_user_id"); - - b.Navigation("Player"); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.HasOne("Content.Server.Database.Server", "Server") - .WithMany("Rounds") - .HasForeignKey("ServerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_round_server_server_id"); - - b.Navigation("Server"); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBan", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminServerBansCreated") - .HasForeignKey("BanningAdmin") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_ban_player_banning_admin"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminServerBansLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_ban_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_server_ban_round_round_id"); - - b.OwnsOne("Content.Server.Database.TypedHwid", "HWId", b1 => - { - b1.Property("ServerBanId") - .HasColumnType("integer") - .HasColumnName("server_ban_id"); - - b1.Property("Hwid") - .IsRequired() - .HasColumnType("bytea") - .HasColumnName("hwid"); - - b1.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("hwid_type"); - - b1.HasKey("ServerBanId"); - - b1.ToTable("server_ban"); - - b1.WithOwner() - .HasForeignKey("ServerBanId") - .HasConstraintName("FK_server_ban_server_ban_server_ban_id"); - }); - - b.Navigation("CreatedBy"); - - b.Navigation("HWId"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Round"); - }); - - 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.ServerRoleBan", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminServerRoleBansCreated") - .HasForeignKey("BanningAdmin") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_role_ban_player_banning_admin"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminServerRoleBansLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_role_ban_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_server_role_ban_round_round_id"); - - b.OwnsOne("Content.Server.Database.TypedHwid", "HWId", b1 => - { - b1.Property("ServerRoleBanId") - .HasColumnType("integer") - .HasColumnName("server_role_ban_id"); - - b1.Property("Hwid") - .IsRequired() - .HasColumnType("bytea") - .HasColumnName("hwid"); - - b1.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("hwid_type"); - - b1.HasKey("ServerRoleBanId"); - - b1.ToTable("server_role_ban"); - - b1.WithOwner() - .HasForeignKey("ServerRoleBanId") - .HasConstraintName("FK_server_role_ban_server_role_ban_server_role_ban_id"); - }); - - b.Navigation("CreatedBy"); - - b.Navigation("HWId"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Round"); - }); - - 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("Content.Server.Database.Trait", b => - { - b.HasOne("Content.Server.Database.Profile", "Profile") - .WithMany("Traits") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_trait_profile_profile_id"); - - b.Navigation("Profile"); - }); - - 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("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"); - - b.Navigation("AdminMessagesCreated"); - - b.Navigation("AdminMessagesDeleted"); - - b.Navigation("AdminMessagesLastEdited"); - - b.Navigation("AdminMessagesReceived"); - - b.Navigation("AdminNotesCreated"); - - b.Navigation("AdminNotesDeleted"); - - b.Navigation("AdminNotesLastEdited"); - - b.Navigation("AdminNotesReceived"); - - b.Navigation("AdminServerBansCreated"); - - b.Navigation("AdminServerBansLastEdited"); - - b.Navigation("AdminServerRoleBansCreated"); - - b.Navigation("AdminServerRoleBansLastEdited"); - - b.Navigation("AdminWatchlistsCreated"); - - b.Navigation("AdminWatchlistsDeleted"); - - b.Navigation("AdminWatchlistsLastEdited"); - - b.Navigation("AdminWatchlistsReceived"); - - b.Navigation("JobWhitelists"); - }); - - modelBuilder.Entity("Content.Server.Database.Preference", b => - { - b.Navigation("Profiles"); - }); - - modelBuilder.Entity("Content.Server.Database.Profile", b => - { - b.Navigation("Antags"); - - b.Navigation("Jobs"); - - b.Navigation("Loadouts"); - - b.Navigation("Traits"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => - { - b.Navigation("Loadouts"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => - { - b.Navigation("Groups"); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.Navigation("AdminLogs"); - }); - - modelBuilder.Entity("Content.Server.Database.Server", b => - { - b.Navigation("ConnectionLogs"); - - b.Navigation("Rounds"); - }); - - 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 - } - } -} diff --git a/Content.Server.Database/Migrations/Postgres/20241111193608_ConnectionTrust.cs b/Content.Server.Database/Migrations/Postgres/20241111193608_ConnectionTrust.cs deleted file mode 100644 index debb36aaccb..00000000000 --- a/Content.Server.Database/Migrations/Postgres/20241111193608_ConnectionTrust.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Content.Server.Database.Migrations.Postgres -{ - /// - public partial class ConnectionTrust : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "trust", - table: "connection_log", - type: "real", - nullable: false, - defaultValue: 0f); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "trust", - table: "connection_log"); - } - } -} diff --git a/Content.Server.Database/Migrations/Postgres/20241222203147_UpstreamMerge.cs b/Content.Server.Database/Migrations/Postgres/20241222203147_UpstreamMerge.cs index 029a62460ba..4752ce9787d 100644 --- a/Content.Server.Database/Migrations/Postgres/20241222203147_UpstreamMerge.cs +++ b/Content.Server.Database/Migrations/Postgres/20241222203147_UpstreamMerge.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable @@ -12,6 +13,40 @@ protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.Sql("DROP TABLE IF EXISTS ProileLoadouts;"); + migrationBuilder.AddColumn( + name: "last_read_rules", + table: "player", + type: "timestamp with time zone", + nullable: true); + + migrationBuilder.AddColumn( + name: "hwid_type", + table: "server_role_ban", + type: "integer", + nullable: true, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "hwid_type", + table: "server_ban", + type: "integer", + nullable: true, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "last_seen_hwid_type", + table: "player", + type: "integer", + nullable: true, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "hwid_type", + table: "connection_log", + type: "integer", + nullable: true, + defaultValue: 0); + migrationBuilder.AddForeignKey( name: "FK_loadout_profile_profile_id", table: "loadout", @@ -19,6 +54,13 @@ protected override void Up(MigrationBuilder migrationBuilder) principalTable: "profile", principalColumn: "profile_id", onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddColumn( + name: "trust", + table: "connection_log", + type: "real", + nullable: false, + defaultValue: 0f); } /// @@ -28,6 +70,26 @@ protected override void Down(MigrationBuilder migrationBuilder) name: "FK_loadout_profile_profile_id", table: "loadout"); + migrationBuilder.DropColumn( + name: "last_read_rules", + table: "player"); + + migrationBuilder.DropColumn( + name: "hwid_type", + table: "server_role_ban"); + + migrationBuilder.DropColumn( + name: "hwid_type", + table: "server_ban"); + + migrationBuilder.DropColumn( + name: "last_seen_hwid_type", + table: "player"); + + migrationBuilder.DropColumn( + name: "hwid_type", + table: "connection_log"); + migrationBuilder.CreateTable( name: "ProfileLoadout", columns: table => new @@ -43,6 +105,10 @@ protected override void Down(MigrationBuilder migrationBuilder) principalColumn: "profile_id", onDelete: ReferentialAction.Cascade); }); + + migrationBuilder.DropColumn( + name: "trust", + table: "connection_log"); } } } diff --git a/Content.Server.Database/Migrations/Sqlite/20240606175141_ReturnLastReadRules.Designer.cs b/Content.Server.Database/Migrations/Sqlite/20240606175141_ReturnLastReadRules.Designer.cs deleted file mode 100644 index 043230b02b2..00000000000 --- a/Content.Server.Database/Migrations/Sqlite/20240606175141_ReturnLastReadRules.Designer.cs +++ /dev/null @@ -1,1838 +0,0 @@ -// -using System; -using Content.Server.Database; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Content.Server.Database.Migrations.Sqlite -{ - [DbContext(typeof(SqliteServerDbContext))] - [Migration("20240606175141_ReturnLastReadRules")] - partial class ReturnLastReadRules - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.0"); - - modelBuilder.Entity("Content.Server.Database.Admin", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.Property("AdminRankId") - .HasColumnType("INTEGER") - .HasColumnName("admin_rank_id"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_flag_id"); - - b.Property("AdminId") - .HasColumnType("TEXT") - .HasColumnName("admin_id"); - - b.Property("Flag") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("flag"); - - b.Property("Negative") - .HasColumnType("INTEGER") - .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("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Id") - .HasColumnType("INTEGER") - .HasColumnName("admin_log_id"); - - b.Property("Date") - .HasColumnType("TEXT") - .HasColumnName("date"); - - b.Property("Impact") - .HasColumnType("INTEGER") - .HasColumnName("impact"); - - b.Property("Json") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("json"); - - b.Property("Message") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("message"); - - b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("type"); - - b.HasKey("RoundId", "Id") - .HasName("PK_admin_log"); - - b.HasIndex("Date"); - - b.HasIndex("Type") - .HasDatabaseName("IX_admin_log_type"); - - b.ToTable("admin_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminLogPlayer", b => - { - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("LogId") - .HasColumnType("INTEGER") - .HasColumnName("log_id"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.HasKey("RoundId", "LogId", "PlayerUserId") - .HasName("PK_admin_log_player"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_log_player_player_user_id"); - - b.ToTable("admin_log_player", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_messages_id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("TEXT") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("INTEGER") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("TEXT") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("TEXT") - .HasColumnName("deleted_by_id"); - - b.Property("Dismissed") - .HasColumnType("INTEGER") - .HasColumnName("dismissed"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("TEXT") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Seen") - .HasColumnType("INTEGER") - .HasColumnName("seen"); - - b.HasKey("Id") - .HasName("PK_admin_messages"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_messages_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_messages_round_id"); - - b.ToTable("admin_messages", null, t => - { - t.HasCheckConstraint("NotDismissedAndSeen", "NOT dismissed OR seen"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.AdminNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_notes_id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("TEXT") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("INTEGER") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("TEXT") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("TEXT") - .HasColumnName("deleted_by_id"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("TEXT") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Secret") - .HasColumnType("INTEGER") - .HasColumnName("secret"); - - b.Property("Severity") - .HasColumnType("INTEGER") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_admin_notes"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_notes_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_notes_round_id"); - - b.ToTable("admin_notes", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminRank", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_rank_id"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_rank_flag_id"); - - b.Property("AdminRankId") - .HasColumnType("INTEGER") - .HasColumnName("admin_rank_id"); - - b.Property("Flag") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("flag"); - - b.HasKey("Id") - .HasName("PK_admin_rank_flag"); - - b.HasIndex("AdminRankId"); - - b.HasIndex("Flag", "AdminRankId") - .IsUnique(); - - b.ToTable("admin_rank_flag", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminWatchlist", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_watchlists_id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("TEXT") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("INTEGER") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("TEXT") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("TEXT") - .HasColumnName("deleted_by_id"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("TEXT") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.HasKey("Id") - .HasName("PK_admin_watchlists"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_watchlists_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_watchlists_round_id"); - - b.ToTable("admin_watchlists", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Antag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("antag_id"); - - b.Property("AntagName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("antag_name"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("assigned_user_id_id"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("connection_log_id"); - - b.Property("Address") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("address"); - - b.Property("Denied") - .HasColumnType("INTEGER") - .HasColumnName("denied"); - - b.Property("HWId") - .HasColumnType("BLOB") - .HasColumnName("hwid"); - - b.Property("ServerId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0) - .HasColumnName("server_id"); - - b.Property("Time") - .HasColumnType("TEXT") - .HasColumnName("time"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.Property("UserName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("user_name"); - - b.HasKey("Id") - .HasName("PK_connection_log"); - - b.HasIndex("ServerId") - .HasDatabaseName("IX_connection_log_server_id"); - - b.HasIndex("UserId"); - - b.ToTable("connection_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Job", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("job_id"); - - b.Property("JobName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("job_name"); - - b.Property("Priority") - .HasColumnType("INTEGER") - .HasColumnName("priority"); - - b.Property("ProfileId") - .HasColumnType("INTEGER") - .HasColumnName("profile_id"); - - b.HasKey("Id") - .HasName("PK_job"); - - b.HasIndex("ProfileId"); - - 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.PlayTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("play_time_id"); - - b.Property("PlayerId") - .HasColumnType("TEXT") - .HasColumnName("player_id"); - - b.Property("TimeSpent") - .HasColumnType("TEXT") - .HasColumnName("time_spent"); - - b.Property("Tracker") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("tracker"); - - b.HasKey("Id") - .HasName("PK_play_time"); - - b.HasIndex("PlayerId", "Tracker") - .IsUnique(); - - b.ToTable("play_time", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Player", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("player_id"); - - b.Property("FirstSeenTime") - .HasColumnType("TEXT") - .HasColumnName("first_seen_time"); - - b.Property("LastReadRules") - .HasColumnType("TEXT") - .HasColumnName("last_read_rules"); - - b.Property("LastSeenAddress") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("last_seen_address"); - - b.Property("LastSeenHWId") - .HasColumnType("BLOB") - .HasColumnName("last_seen_hwid"); - - b.Property("LastSeenTime") - .HasColumnType("TEXT") - .HasColumnName("last_seen_time"); - - b.Property("LastSeenUserName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("last_seen_user_name"); - - b.Property("UserId") - .HasColumnType("TEXT") - .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); - }); - - modelBuilder.Entity("Content.Server.Database.Preference", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("preference_id"); - - b.Property("AdminOOCColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("admin_ooc_color"); - - b.Property("SelectedCharacterSlot") - .HasColumnType("INTEGER") - .HasColumnName("selected_character_slot"); - - b.Property("UserId") - .HasColumnType("TEXT") - .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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("profile_id"); - - b.Property("Age") - .HasColumnType("INTEGER") - .HasColumnName("age"); - - b.Property("CharacterName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("char_name"); - - b.Property("EyeColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("eye_color"); - - b.Property("FacialHairColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("facial_hair_color"); - - b.Property("FacialHairName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("facial_hair_name"); - - b.Property("FlavorText") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("flavor_text"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("gender"); - - b.Property("HairColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("hair_color"); - - b.Property("HairName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("hair_name"); - - b.Property("Markings") - .HasColumnType("jsonb") - .HasColumnName("markings"); - - b.Property("PreferenceId") - .HasColumnType("INTEGER") - .HasColumnName("preference_id"); - - b.Property("PreferenceUnavailable") - .HasColumnType("INTEGER") - .HasColumnName("pref_unavailable"); - - b.Property("Sex") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("sex"); - - b.Property("SkinColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("skin_color"); - - b.Property("Slot") - .HasColumnType("INTEGER") - .HasColumnName("slot"); - - b.Property("SpawnPriority") - .HasColumnType("INTEGER") - .HasColumnName("spawn_priority"); - - b.Property("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.ProfileLoadout", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("profile_loadout_id"); - - b.Property("LoadoutName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("loadout_name"); - - b.Property("ProfileLoadoutGroupId") - .HasColumnType("INTEGER") - .HasColumnName("profile_loadout_group_id"); - - b.HasKey("Id") - .HasName("PK_profile_loadout"); - - b.HasIndex("ProfileLoadoutGroupId"); - - b.ToTable("profile_loadout", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("profile_loadout_group_id"); - - b.Property("GroupName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("group_name"); - - b.Property("ProfileRoleLoadoutId") - .HasColumnType("INTEGER") - .HasColumnName("profile_role_loadout_id"); - - b.HasKey("Id") - .HasName("PK_profile_loadout_group"); - - b.HasIndex("ProfileRoleLoadoutId"); - - b.ToTable("profile_loadout_group", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("profile_role_loadout_id"); - - b.Property("ProfileId") - .HasColumnType("INTEGER") - .HasColumnName("profile_id"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("role_name"); - - b.HasKey("Id") - .HasName("PK_profile_role_loadout"); - - b.HasIndex("ProfileId"); - - b.ToTable("profile_role_loadout", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.RoleWhitelist", b => - { - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("RoleId") - .HasColumnType("TEXT") - .HasColumnName("role_id"); - - b.HasKey("PlayerUserId", "RoleId") - .HasName("PK_role_whitelists"); - - b.ToTable("role_whitelists", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("ServerId") - .HasColumnType("INTEGER") - .HasColumnName("server_id"); - - b.Property("StartDate") - .HasColumnType("TEXT") - .HasColumnName("start_date"); - - b.HasKey("Id") - .HasName("PK_round"); - - b.HasIndex("ServerId") - .HasDatabaseName("IX_round_server_id"); - - b.HasIndex("StartDate"); - - b.ToTable("round", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Server", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("server_id"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("PK_server"); - - b.ToTable("server", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("server_ban_id"); - - b.Property("Address") - .HasColumnType("TEXT") - .HasColumnName("address"); - - b.Property("AutoDelete") - .HasColumnType("INTEGER") - .HasColumnName("auto_delete"); - - b.Property("BanTime") - .HasColumnType("TEXT") - .HasColumnName("ban_time"); - - b.Property("BanningAdmin") - .HasColumnType("TEXT") - .HasColumnName("banning_admin"); - - b.Property("ExemptFlags") - .HasColumnType("INTEGER") - .HasColumnName("exempt_flags"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("HWId") - .HasColumnType("BLOB") - .HasColumnName("hwid"); - - b.Property("Hidden") - .HasColumnType("INTEGER") - .HasColumnName("hidden"); - - b.Property("LastEditedAt") - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("reason"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Severity") - .HasColumnType("INTEGER") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_server_ban"); - - b.HasIndex("Address"); - - b.HasIndex("BanningAdmin"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_server_ban_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_server_ban_round_id"); - - b.ToTable("server_ban", null, t => - { - t.HasCheckConstraint("HaveEitherAddressOrUserIdOrHWId", "address IS NOT NULL OR player_user_id IS NOT NULL OR hwid IS NOT NULL"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBanExemption", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.Property("Flags") - .HasColumnType("INTEGER") - .HasColumnName("flags"); - - b.HasKey("UserId") - .HasName("PK_server_ban_exemption"); - - b.ToTable("server_ban_exemption", null, t => - { - t.HasCheckConstraint("FlagsNotZero", "flags != 0"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBanHit", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("server_ban_hit_id"); - - b.Property("BanId") - .HasColumnType("INTEGER") - .HasColumnName("ban_id"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("server_role_ban_id"); - - b.Property("Address") - .HasColumnType("TEXT") - .HasColumnName("address"); - - b.Property("BanTime") - .HasColumnType("TEXT") - .HasColumnName("ban_time"); - - b.Property("BanningAdmin") - .HasColumnType("TEXT") - .HasColumnName("banning_admin"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("HWId") - .HasColumnType("BLOB") - .HasColumnName("hwid"); - - b.Property("Hidden") - .HasColumnType("INTEGER") - .HasColumnName("hidden"); - - b.Property("LastEditedAt") - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("reason"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("role_id"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Severity") - .HasColumnType("INTEGER") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_server_role_ban"); - - b.HasIndex("Address"); - - b.HasIndex("BanningAdmin"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_server_role_ban_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_server_role_ban_round_id"); - - b.ToTable("server_role_ban", null, t => - { - t.HasCheckConstraint("HaveEitherAddressOrUserIdOrHWId", "address IS NOT NULL OR player_user_id IS NOT NULL OR hwid IS NOT NULL"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerRoleUnban", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("role_unban_id"); - - b.Property("BanId") - .HasColumnType("INTEGER") - .HasColumnName("ban_id"); - - b.Property("UnbanTime") - .HasColumnType("TEXT") - .HasColumnName("unban_time"); - - b.Property("UnbanningAdmin") - .HasColumnType("TEXT") - .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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("unban_id"); - - b.Property("BanId") - .HasColumnType("INTEGER") - .HasColumnName("ban_id"); - - b.Property("UnbanTime") - .HasColumnType("TEXT") - .HasColumnName("unban_time"); - - b.Property("UnbanningAdmin") - .HasColumnType("TEXT") - .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.Trait", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("trait_id"); - - b.Property("ProfileId") - .HasColumnType("INTEGER") - .HasColumnName("profile_id"); - - b.Property("TraitName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("trait_name"); - - b.HasKey("Id") - .HasName("PK_trait"); - - b.HasIndex("ProfileId", "TraitName") - .IsUnique(); - - b.ToTable("trait", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.UploadedResourceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("uploaded_resource_log_id"); - - b.Property("Data") - .IsRequired() - .HasColumnType("BLOB") - .HasColumnName("data"); - - b.Property("Date") - .HasColumnType("TEXT") - .HasColumnName("date"); - - b.Property("Path") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("path"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.HasKey("Id") - .HasName("PK_uploaded_resource_log"); - - b.ToTable("uploaded_resource_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Whitelist", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.HasKey("UserId") - .HasName("PK_whitelist"); - - b.ToTable("whitelist", (string)null); - }); - - modelBuilder.Entity("PlayerRound", b => - { - b.Property("PlayersId") - .HasColumnType("INTEGER") - .HasColumnName("players_id"); - - b.Property("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.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("RoundId", "LogId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_admin_log_player_admin_log_round_id_log_id"); - - b.Navigation("Log"); - - b.Navigation("Player"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminMessage", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminMessagesCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminMessagesDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminMessagesLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminMessagesReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_messages_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_messages_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminNote", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminNotesCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminNotesDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminNotesLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminNotesReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_notes_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_notes_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - 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.AdminWatchlist", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminWatchlistsCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminWatchlistsDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminWatchlistsLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminWatchlistsReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_watchlists_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_watchlists_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - 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.ConnectionLog", b => - { - b.HasOne("Content.Server.Database.Server", "Server") - .WithMany("ConnectionLogs") - .HasForeignKey("ServerId") - .OnDelete(DeleteBehavior.SetNull) - .IsRequired() - .HasConstraintName("FK_connection_log_server_server_id"); - - b.Navigation("Server"); - }); - - 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.ProfileLoadout", b => - { - b.HasOne("Content.Server.Database.ProfileLoadoutGroup", "ProfileLoadoutGroup") - .WithMany("Loadouts") - .HasForeignKey("ProfileLoadoutGroupId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_profile_loadout_profile_loadout_group_profile_loadout_group_id"); - - b.Navigation("ProfileLoadoutGroup"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => - { - b.HasOne("Content.Server.Database.ProfileRoleLoadout", "ProfileRoleLoadout") - .WithMany("Groups") - .HasForeignKey("ProfileRoleLoadoutId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_profile_loadout_group_profile_role_loadout_profile_role_loadout_id"); - - b.Navigation("ProfileRoleLoadout"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => - { - b.HasOne("Content.Server.Database.Profile", "Profile") - .WithMany("Loadouts") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_profile_role_loadout_profile_profile_id"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("Content.Server.Database.RoleWhitelist", b => - { - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("JobWhitelists") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_role_whitelists_player_player_user_id"); - - b.Navigation("Player"); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.HasOne("Content.Server.Database.Server", "Server") - .WithMany("Rounds") - .HasForeignKey("ServerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_round_server_server_id"); - - b.Navigation("Server"); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBan", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminServerBansCreated") - .HasForeignKey("BanningAdmin") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_ban_player_banning_admin"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminServerBansLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_ban_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_server_ban_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Round"); - }); - - 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.ServerRoleBan", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminServerRoleBansCreated") - .HasForeignKey("BanningAdmin") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_role_ban_player_banning_admin"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminServerRoleBansLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_role_ban_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_server_role_ban_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Round"); - }); - - 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("Content.Server.Database.Trait", b => - { - b.HasOne("Content.Server.Database.Profile", "Profile") - .WithMany("Traits") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_trait_profile_profile_id"); - - b.Navigation("Profile"); - }); - - 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("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"); - - b.Navigation("AdminMessagesCreated"); - - b.Navigation("AdminMessagesDeleted"); - - b.Navigation("AdminMessagesLastEdited"); - - b.Navigation("AdminMessagesReceived"); - - b.Navigation("AdminNotesCreated"); - - b.Navigation("AdminNotesDeleted"); - - b.Navigation("AdminNotesLastEdited"); - - b.Navigation("AdminNotesReceived"); - - b.Navigation("AdminServerBansCreated"); - - b.Navigation("AdminServerBansLastEdited"); - - b.Navigation("AdminServerRoleBansCreated"); - - b.Navigation("AdminServerRoleBansLastEdited"); - - b.Navigation("AdminWatchlistsCreated"); - - b.Navigation("AdminWatchlistsDeleted"); - - b.Navigation("AdminWatchlistsLastEdited"); - - b.Navigation("AdminWatchlistsReceived"); - - b.Navigation("JobWhitelists"); - }); - - modelBuilder.Entity("Content.Server.Database.Preference", b => - { - b.Navigation("Profiles"); - }); - - modelBuilder.Entity("Content.Server.Database.Profile", b => - { - b.Navigation("Antags"); - - b.Navigation("Jobs"); - - b.Navigation("Loadouts"); - - b.Navigation("Traits"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => - { - b.Navigation("Loadouts"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => - { - b.Navigation("Groups"); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.Navigation("AdminLogs"); - }); - - modelBuilder.Entity("Content.Server.Database.Server", b => - { - b.Navigation("ConnectionLogs"); - - b.Navigation("Rounds"); - }); - - 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 - } - } -} diff --git a/Content.Server.Database/Migrations/Sqlite/20240606175141_ReturnLastReadRules.cs b/Content.Server.Database/Migrations/Sqlite/20240606175141_ReturnLastReadRules.cs deleted file mode 100644 index 0b0fd8725c0..00000000000 --- a/Content.Server.Database/Migrations/Sqlite/20240606175141_ReturnLastReadRules.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Content.Server.Database.Migrations.Sqlite -{ - /// - public partial class ReturnLastReadRules : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "last_read_rules", - table: "player", - type: "TEXT", - nullable: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "last_read_rules", - table: "player"); - } - } -} diff --git a/Content.Server.Database/Migrations/Sqlite/20240623005113_BanTemplate.Designer.cs b/Content.Server.Database/Migrations/Sqlite/20240623005113_BanTemplate.Designer.cs deleted file mode 100644 index acce21c2bd9..00000000000 --- a/Content.Server.Database/Migrations/Sqlite/20240623005113_BanTemplate.Designer.cs +++ /dev/null @@ -1,1883 +0,0 @@ -// -using System; -using Content.Server.Database; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Content.Server.Database.Migrations.Sqlite -{ - [DbContext(typeof(SqliteServerDbContext))] - [Migration("20240623005113_BanTemplate")] - partial class BanTemplate - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.0"); - - modelBuilder.Entity("Content.Server.Database.Admin", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.Property("AdminRankId") - .HasColumnType("INTEGER") - .HasColumnName("admin_rank_id"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_flag_id"); - - b.Property("AdminId") - .HasColumnType("TEXT") - .HasColumnName("admin_id"); - - b.Property("Flag") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("flag"); - - b.Property("Negative") - .HasColumnType("INTEGER") - .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("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Id") - .HasColumnType("INTEGER") - .HasColumnName("admin_log_id"); - - b.Property("Date") - .HasColumnType("TEXT") - .HasColumnName("date"); - - b.Property("Impact") - .HasColumnType("INTEGER") - .HasColumnName("impact"); - - b.Property("Json") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("json"); - - b.Property("Message") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("message"); - - b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("type"); - - b.HasKey("RoundId", "Id") - .HasName("PK_admin_log"); - - b.HasIndex("Date"); - - b.HasIndex("Type") - .HasDatabaseName("IX_admin_log_type"); - - b.ToTable("admin_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminLogPlayer", b => - { - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("LogId") - .HasColumnType("INTEGER") - .HasColumnName("log_id"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.HasKey("RoundId", "LogId", "PlayerUserId") - .HasName("PK_admin_log_player"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_log_player_player_user_id"); - - b.ToTable("admin_log_player", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_messages_id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("TEXT") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("INTEGER") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("TEXT") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("TEXT") - .HasColumnName("deleted_by_id"); - - b.Property("Dismissed") - .HasColumnType("INTEGER") - .HasColumnName("dismissed"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("TEXT") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Seen") - .HasColumnType("INTEGER") - .HasColumnName("seen"); - - b.HasKey("Id") - .HasName("PK_admin_messages"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_messages_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_messages_round_id"); - - b.ToTable("admin_messages", null, t => - { - t.HasCheckConstraint("NotDismissedAndSeen", "NOT dismissed OR seen"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.AdminNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_notes_id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("TEXT") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("INTEGER") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("TEXT") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("TEXT") - .HasColumnName("deleted_by_id"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("TEXT") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Secret") - .HasColumnType("INTEGER") - .HasColumnName("secret"); - - b.Property("Severity") - .HasColumnType("INTEGER") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_admin_notes"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_notes_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_notes_round_id"); - - b.ToTable("admin_notes", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminRank", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_rank_id"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_rank_flag_id"); - - b.Property("AdminRankId") - .HasColumnType("INTEGER") - .HasColumnName("admin_rank_id"); - - b.Property("Flag") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("flag"); - - b.HasKey("Id") - .HasName("PK_admin_rank_flag"); - - b.HasIndex("AdminRankId"); - - b.HasIndex("Flag", "AdminRankId") - .IsUnique(); - - b.ToTable("admin_rank_flag", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminWatchlist", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_watchlists_id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("TEXT") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("INTEGER") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("TEXT") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("TEXT") - .HasColumnName("deleted_by_id"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("TEXT") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.HasKey("Id") - .HasName("PK_admin_watchlists"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_watchlists_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_watchlists_round_id"); - - b.ToTable("admin_watchlists", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Antag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("antag_id"); - - b.Property("AntagName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("antag_name"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("assigned_user_id_id"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.Property("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.BanTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("ban_template_id"); - - b.Property("AutoDelete") - .HasColumnType("INTEGER") - .HasColumnName("auto_delete"); - - b.Property("ExemptFlags") - .HasColumnType("INTEGER") - .HasColumnName("exempt_flags"); - - b.Property("Hidden") - .HasColumnType("INTEGER") - .HasColumnName("hidden"); - - b.Property("Length") - .HasColumnType("TEXT") - .HasColumnName("length"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("reason"); - - b.Property("Severity") - .HasColumnType("INTEGER") - .HasColumnName("severity"); - - b.Property("Title") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("title"); - - b.HasKey("Id") - .HasName("PK_ban_template"); - - b.ToTable("ban_template", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ConnectionLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("connection_log_id"); - - b.Property("Address") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("address"); - - b.Property("Denied") - .HasColumnType("INTEGER") - .HasColumnName("denied"); - - b.Property("HWId") - .HasColumnType("BLOB") - .HasColumnName("hwid"); - - b.Property("ServerId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0) - .HasColumnName("server_id"); - - b.Property("Time") - .HasColumnType("TEXT") - .HasColumnName("time"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.Property("UserName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("user_name"); - - b.HasKey("Id") - .HasName("PK_connection_log"); - - b.HasIndex("ServerId") - .HasDatabaseName("IX_connection_log_server_id"); - - b.HasIndex("Time"); - - b.HasIndex("UserId"); - - b.ToTable("connection_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Job", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("job_id"); - - b.Property("JobName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("job_name"); - - b.Property("Priority") - .HasColumnType("INTEGER") - .HasColumnName("priority"); - - b.Property("ProfileId") - .HasColumnType("INTEGER") - .HasColumnName("profile_id"); - - b.HasKey("Id") - .HasName("PK_job"); - - b.HasIndex("ProfileId"); - - 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.PlayTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("play_time_id"); - - b.Property("PlayerId") - .HasColumnType("TEXT") - .HasColumnName("player_id"); - - b.Property("TimeSpent") - .HasColumnType("TEXT") - .HasColumnName("time_spent"); - - b.Property("Tracker") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("tracker"); - - b.HasKey("Id") - .HasName("PK_play_time"); - - b.HasIndex("PlayerId", "Tracker") - .IsUnique(); - - b.ToTable("play_time", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Player", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("player_id"); - - b.Property("FirstSeenTime") - .HasColumnType("TEXT") - .HasColumnName("first_seen_time"); - - b.Property("LastReadRules") - .HasColumnType("TEXT") - .HasColumnName("last_read_rules"); - - b.Property("LastSeenAddress") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("last_seen_address"); - - b.Property("LastSeenHWId") - .HasColumnType("BLOB") - .HasColumnName("last_seen_hwid"); - - b.Property("LastSeenTime") - .HasColumnType("TEXT") - .HasColumnName("last_seen_time"); - - b.Property("LastSeenUserName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("last_seen_user_name"); - - b.Property("UserId") - .HasColumnType("TEXT") - .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); - }); - - modelBuilder.Entity("Content.Server.Database.Preference", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("preference_id"); - - b.Property("AdminOOCColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("admin_ooc_color"); - - b.Property("SelectedCharacterSlot") - .HasColumnType("INTEGER") - .HasColumnName("selected_character_slot"); - - b.Property("UserId") - .HasColumnType("TEXT") - .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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("profile_id"); - - b.Property("Age") - .HasColumnType("INTEGER") - .HasColumnName("age"); - - b.Property("CharacterName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("char_name"); - - b.Property("EyeColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("eye_color"); - - b.Property("FacialHairColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("facial_hair_color"); - - b.Property("FacialHairName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("facial_hair_name"); - - b.Property("FlavorText") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("flavor_text"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("gender"); - - b.Property("HairColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("hair_color"); - - b.Property("HairName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("hair_name"); - - b.Property("Markings") - .HasColumnType("jsonb") - .HasColumnName("markings"); - - b.Property("PreferenceId") - .HasColumnType("INTEGER") - .HasColumnName("preference_id"); - - b.Property("PreferenceUnavailable") - .HasColumnType("INTEGER") - .HasColumnName("pref_unavailable"); - - b.Property("Sex") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("sex"); - - b.Property("SkinColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("skin_color"); - - b.Property("Slot") - .HasColumnType("INTEGER") - .HasColumnName("slot"); - - b.Property("SpawnPriority") - .HasColumnType("INTEGER") - .HasColumnName("spawn_priority"); - - b.Property("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.ProfileLoadout", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("profile_loadout_id"); - - b.Property("LoadoutName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("loadout_name"); - - b.Property("ProfileLoadoutGroupId") - .HasColumnType("INTEGER") - .HasColumnName("profile_loadout_group_id"); - - b.HasKey("Id") - .HasName("PK_profile_loadout"); - - b.HasIndex("ProfileLoadoutGroupId"); - - b.ToTable("profile_loadout", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("profile_loadout_group_id"); - - b.Property("GroupName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("group_name"); - - b.Property("ProfileRoleLoadoutId") - .HasColumnType("INTEGER") - .HasColumnName("profile_role_loadout_id"); - - b.HasKey("Id") - .HasName("PK_profile_loadout_group"); - - b.HasIndex("ProfileRoleLoadoutId"); - - b.ToTable("profile_loadout_group", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("profile_role_loadout_id"); - - b.Property("ProfileId") - .HasColumnType("INTEGER") - .HasColumnName("profile_id"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("role_name"); - - b.HasKey("Id") - .HasName("PK_profile_role_loadout"); - - b.HasIndex("ProfileId"); - - b.ToTable("profile_role_loadout", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.RoleWhitelist", b => - { - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("RoleId") - .HasColumnType("TEXT") - .HasColumnName("role_id"); - - b.HasKey("PlayerUserId", "RoleId") - .HasName("PK_role_whitelists"); - - b.ToTable("role_whitelists", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("ServerId") - .HasColumnType("INTEGER") - .HasColumnName("server_id"); - - b.Property("StartDate") - .HasColumnType("TEXT") - .HasColumnName("start_date"); - - b.HasKey("Id") - .HasName("PK_round"); - - b.HasIndex("ServerId") - .HasDatabaseName("IX_round_server_id"); - - b.HasIndex("StartDate"); - - b.ToTable("round", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Server", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("server_id"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("PK_server"); - - b.ToTable("server", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("server_ban_id"); - - b.Property("Address") - .HasColumnType("TEXT") - .HasColumnName("address"); - - b.Property("AutoDelete") - .HasColumnType("INTEGER") - .HasColumnName("auto_delete"); - - b.Property("BanTime") - .HasColumnType("TEXT") - .HasColumnName("ban_time"); - - b.Property("BanningAdmin") - .HasColumnType("TEXT") - .HasColumnName("banning_admin"); - - b.Property("ExemptFlags") - .HasColumnType("INTEGER") - .HasColumnName("exempt_flags"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("HWId") - .HasColumnType("BLOB") - .HasColumnName("hwid"); - - b.Property("Hidden") - .HasColumnType("INTEGER") - .HasColumnName("hidden"); - - b.Property("LastEditedAt") - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("reason"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Severity") - .HasColumnType("INTEGER") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_server_ban"); - - b.HasIndex("Address"); - - b.HasIndex("BanningAdmin"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_server_ban_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_server_ban_round_id"); - - b.ToTable("server_ban", null, t => - { - t.HasCheckConstraint("HaveEitherAddressOrUserIdOrHWId", "address IS NOT NULL OR player_user_id IS NOT NULL OR hwid IS NOT NULL"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBanExemption", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.Property("Flags") - .HasColumnType("INTEGER") - .HasColumnName("flags"); - - b.HasKey("UserId") - .HasName("PK_server_ban_exemption"); - - b.ToTable("server_ban_exemption", null, t => - { - t.HasCheckConstraint("FlagsNotZero", "flags != 0"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBanHit", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("server_ban_hit_id"); - - b.Property("BanId") - .HasColumnType("INTEGER") - .HasColumnName("ban_id"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("server_role_ban_id"); - - b.Property("Address") - .HasColumnType("TEXT") - .HasColumnName("address"); - - b.Property("BanTime") - .HasColumnType("TEXT") - .HasColumnName("ban_time"); - - b.Property("BanningAdmin") - .HasColumnType("TEXT") - .HasColumnName("banning_admin"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("HWId") - .HasColumnType("BLOB") - .HasColumnName("hwid"); - - b.Property("Hidden") - .HasColumnType("INTEGER") - .HasColumnName("hidden"); - - b.Property("LastEditedAt") - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("reason"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("role_id"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Severity") - .HasColumnType("INTEGER") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_server_role_ban"); - - b.HasIndex("Address"); - - b.HasIndex("BanningAdmin"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_server_role_ban_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_server_role_ban_round_id"); - - b.ToTable("server_role_ban", null, t => - { - t.HasCheckConstraint("HaveEitherAddressOrUserIdOrHWId", "address IS NOT NULL OR player_user_id IS NOT NULL OR hwid IS NOT NULL"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerRoleUnban", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("role_unban_id"); - - b.Property("BanId") - .HasColumnType("INTEGER") - .HasColumnName("ban_id"); - - b.Property("UnbanTime") - .HasColumnType("TEXT") - .HasColumnName("unban_time"); - - b.Property("UnbanningAdmin") - .HasColumnType("TEXT") - .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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("unban_id"); - - b.Property("BanId") - .HasColumnType("INTEGER") - .HasColumnName("ban_id"); - - b.Property("UnbanTime") - .HasColumnType("TEXT") - .HasColumnName("unban_time"); - - b.Property("UnbanningAdmin") - .HasColumnType("TEXT") - .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.Trait", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("trait_id"); - - b.Property("ProfileId") - .HasColumnType("INTEGER") - .HasColumnName("profile_id"); - - b.Property("TraitName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("trait_name"); - - b.HasKey("Id") - .HasName("PK_trait"); - - b.HasIndex("ProfileId", "TraitName") - .IsUnique(); - - b.ToTable("trait", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.UploadedResourceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("uploaded_resource_log_id"); - - b.Property("Data") - .IsRequired() - .HasColumnType("BLOB") - .HasColumnName("data"); - - b.Property("Date") - .HasColumnType("TEXT") - .HasColumnName("date"); - - b.Property("Path") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("path"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.HasKey("Id") - .HasName("PK_uploaded_resource_log"); - - b.ToTable("uploaded_resource_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Whitelist", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.HasKey("UserId") - .HasName("PK_whitelist"); - - b.ToTable("whitelist", (string)null); - }); - - modelBuilder.Entity("PlayerRound", b => - { - b.Property("PlayersId") - .HasColumnType("INTEGER") - .HasColumnName("players_id"); - - b.Property("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.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("RoundId", "LogId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_admin_log_player_admin_log_round_id_log_id"); - - b.Navigation("Log"); - - b.Navigation("Player"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminMessage", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminMessagesCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminMessagesDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminMessagesLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminMessagesReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_messages_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_messages_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminNote", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminNotesCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminNotesDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminNotesLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminNotesReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_notes_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_notes_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - 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.AdminWatchlist", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminWatchlistsCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminWatchlistsDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminWatchlistsLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminWatchlistsReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_watchlists_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_watchlists_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - 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.ConnectionLog", b => - { - b.HasOne("Content.Server.Database.Server", "Server") - .WithMany("ConnectionLogs") - .HasForeignKey("ServerId") - .OnDelete(DeleteBehavior.SetNull) - .IsRequired() - .HasConstraintName("FK_connection_log_server_server_id"); - - b.Navigation("Server"); - }); - - 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.ProfileLoadout", b => - { - b.HasOne("Content.Server.Database.ProfileLoadoutGroup", "ProfileLoadoutGroup") - .WithMany("Loadouts") - .HasForeignKey("ProfileLoadoutGroupId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_profile_loadout_profile_loadout_group_profile_loadout_group_id"); - - b.Navigation("ProfileLoadoutGroup"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => - { - b.HasOne("Content.Server.Database.ProfileRoleLoadout", "ProfileRoleLoadout") - .WithMany("Groups") - .HasForeignKey("ProfileRoleLoadoutId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_profile_loadout_group_profile_role_loadout_profile_role_loadout_id"); - - b.Navigation("ProfileRoleLoadout"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => - { - b.HasOne("Content.Server.Database.Profile", "Profile") - .WithMany("Loadouts") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_profile_role_loadout_profile_profile_id"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("Content.Server.Database.RoleWhitelist", b => - { - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("JobWhitelists") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_role_whitelists_player_player_user_id"); - - b.Navigation("Player"); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.HasOne("Content.Server.Database.Server", "Server") - .WithMany("Rounds") - .HasForeignKey("ServerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_round_server_server_id"); - - b.Navigation("Server"); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBan", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminServerBansCreated") - .HasForeignKey("BanningAdmin") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_ban_player_banning_admin"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminServerBansLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_ban_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_server_ban_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Round"); - }); - - 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.ServerRoleBan", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminServerRoleBansCreated") - .HasForeignKey("BanningAdmin") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_role_ban_player_banning_admin"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminServerRoleBansLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_role_ban_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_server_role_ban_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Round"); - }); - - 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("Content.Server.Database.Trait", b => - { - b.HasOne("Content.Server.Database.Profile", "Profile") - .WithMany("Traits") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_trait_profile_profile_id"); - - b.Navigation("Profile"); - }); - - 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("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"); - - b.Navigation("AdminMessagesCreated"); - - b.Navigation("AdminMessagesDeleted"); - - b.Navigation("AdminMessagesLastEdited"); - - b.Navigation("AdminMessagesReceived"); - - b.Navigation("AdminNotesCreated"); - - b.Navigation("AdminNotesDeleted"); - - b.Navigation("AdminNotesLastEdited"); - - b.Navigation("AdminNotesReceived"); - - b.Navigation("AdminServerBansCreated"); - - b.Navigation("AdminServerBansLastEdited"); - - b.Navigation("AdminServerRoleBansCreated"); - - b.Navigation("AdminServerRoleBansLastEdited"); - - b.Navigation("AdminWatchlistsCreated"); - - b.Navigation("AdminWatchlistsDeleted"); - - b.Navigation("AdminWatchlistsLastEdited"); - - b.Navigation("AdminWatchlistsReceived"); - - b.Navigation("JobWhitelists"); - }); - - modelBuilder.Entity("Content.Server.Database.Preference", b => - { - b.Navigation("Profiles"); - }); - - modelBuilder.Entity("Content.Server.Database.Profile", b => - { - b.Navigation("Antags"); - - b.Navigation("Jobs"); - - b.Navigation("Loadouts"); - - b.Navigation("Traits"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => - { - b.Navigation("Loadouts"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => - { - b.Navigation("Groups"); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.Navigation("AdminLogs"); - }); - - modelBuilder.Entity("Content.Server.Database.Server", b => - { - b.Navigation("ConnectionLogs"); - - b.Navigation("Rounds"); - }); - - 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 - } - } -} diff --git a/Content.Server.Database/Migrations/Sqlite/20240623005113_BanTemplate.cs b/Content.Server.Database/Migrations/Sqlite/20240623005113_BanTemplate.cs deleted file mode 100644 index ffe5a475507..00000000000 --- a/Content.Server.Database/Migrations/Sqlite/20240623005113_BanTemplate.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Content.Server.Database.Migrations.Sqlite -{ - /// - public partial class BanTemplate : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "ban_template", - columns: table => new - { - ban_template_id = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - title = table.Column(type: "TEXT", nullable: false), - length = table.Column(type: "TEXT", nullable: false), - reason = table.Column(type: "TEXT", nullable: false), - exempt_flags = table.Column(type: "INTEGER", nullable: false), - severity = table.Column(type: "INTEGER", nullable: false), - auto_delete = table.Column(type: "INTEGER", nullable: false), - hidden = table.Column(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ban_template", x => x.ban_template_id); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "ban_template"); - } - } -} diff --git a/Content.Server.Database/Migrations/Sqlite/20241018043307_RoleWhitelist.Designer.cs b/Content.Server.Database/Migrations/Sqlite/20241018043307_RoleWhitelist.Designer.cs deleted file mode 100644 index bef2d1038fa..00000000000 --- a/Content.Server.Database/Migrations/Sqlite/20241018043307_RoleWhitelist.Designer.cs +++ /dev/null @@ -1,1823 +0,0 @@ -// -using System; -using Content.Server.Database; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Content.Server.Database.Migrations.Sqlite -{ - [DbContext(typeof(SqliteServerDbContext))] - [Migration("20241018043307_RoleWhitelist")] - partial class RoleWhitelist - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.0"); - - modelBuilder.Entity("Content.Server.Database.Admin", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.Property("AdminRankId") - .HasColumnType("INTEGER") - .HasColumnName("admin_rank_id"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_flag_id"); - - b.Property("AdminId") - .HasColumnType("TEXT") - .HasColumnName("admin_id"); - - b.Property("Flag") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("flag"); - - b.Property("Negative") - .HasColumnType("INTEGER") - .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("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Id") - .HasColumnType("INTEGER") - .HasColumnName("admin_log_id"); - - b.Property("Date") - .HasColumnType("TEXT") - .HasColumnName("date"); - - b.Property("Impact") - .HasColumnType("INTEGER") - .HasColumnName("impact"); - - b.Property("Json") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("json"); - - b.Property("Message") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("message"); - - b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("type"); - - b.HasKey("RoundId", "Id") - .HasName("PK_admin_log"); - - b.HasIndex("Date"); - - b.HasIndex("Type") - .HasDatabaseName("IX_admin_log_type"); - - b.ToTable("admin_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminLogPlayer", b => - { - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("LogId") - .HasColumnType("INTEGER") - .HasColumnName("log_id"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.HasKey("RoundId", "LogId", "PlayerUserId") - .HasName("PK_admin_log_player"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_log_player_player_user_id"); - - b.ToTable("admin_log_player", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_messages_id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("TEXT") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("INTEGER") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("TEXT") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("TEXT") - .HasColumnName("deleted_by_id"); - - b.Property("Dismissed") - .HasColumnType("INTEGER") - .HasColumnName("dismissed"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("TEXT") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Seen") - .HasColumnType("INTEGER") - .HasColumnName("seen"); - - b.HasKey("Id") - .HasName("PK_admin_messages"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_messages_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_messages_round_id"); - - b.ToTable("admin_messages", null, t => - { - t.HasCheckConstraint("NotDismissedAndSeen", "NOT dismissed OR seen"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.AdminNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_notes_id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("TEXT") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("INTEGER") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("TEXT") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("TEXT") - .HasColumnName("deleted_by_id"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("TEXT") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Secret") - .HasColumnType("INTEGER") - .HasColumnName("secret"); - - b.Property("Severity") - .HasColumnType("INTEGER") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_admin_notes"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_notes_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_notes_round_id"); - - b.ToTable("admin_notes", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminRank", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_rank_id"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_rank_flag_id"); - - b.Property("AdminRankId") - .HasColumnType("INTEGER") - .HasColumnName("admin_rank_id"); - - b.Property("Flag") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("flag"); - - b.HasKey("Id") - .HasName("PK_admin_rank_flag"); - - b.HasIndex("AdminRankId"); - - b.HasIndex("Flag", "AdminRankId") - .IsUnique(); - - b.ToTable("admin_rank_flag", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminWatchlist", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_watchlists_id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("TEXT") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("INTEGER") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("TEXT") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("TEXT") - .HasColumnName("deleted_by_id"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("TEXT") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.HasKey("Id") - .HasName("PK_admin_watchlists"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_watchlists_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_watchlists_round_id"); - - b.ToTable("admin_watchlists", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Antag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("antag_id"); - - b.Property("AntagName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("antag_name"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("assigned_user_id_id"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.Property("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.BanTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("ban_template_id"); - - b.Property("AutoDelete") - .HasColumnType("INTEGER") - .HasColumnName("auto_delete"); - - b.Property("ExemptFlags") - .HasColumnType("INTEGER") - .HasColumnName("exempt_flags"); - - b.Property("Hidden") - .HasColumnType("INTEGER") - .HasColumnName("hidden"); - - b.Property("Length") - .HasColumnType("TEXT") - .HasColumnName("length"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("reason"); - - b.Property("Severity") - .HasColumnType("INTEGER") - .HasColumnName("severity"); - - b.Property("Title") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("title"); - - b.HasKey("Id") - .HasName("PK_ban_template"); - - b.ToTable("ban_template", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ConnectionLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("connection_log_id"); - - b.Property("Address") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("address"); - - b.Property("Denied") - .HasColumnType("INTEGER") - .HasColumnName("denied"); - - b.Property("HWId") - .HasColumnType("BLOB") - .HasColumnName("hwid"); - - b.Property("ServerId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0) - .HasColumnName("server_id"); - - b.Property("Time") - .HasColumnType("TEXT") - .HasColumnName("time"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.Property("UserName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("user_name"); - - b.HasKey("Id") - .HasName("PK_connection_log"); - - b.HasIndex("ServerId") - .HasDatabaseName("IX_connection_log_server_id"); - - b.HasIndex("UserId"); - - b.ToTable("connection_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Job", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("job_id"); - - b.Property("JobName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("job_name"); - - b.Property("Priority") - .HasColumnType("INTEGER") - .HasColumnName("priority"); - - b.Property("ProfileId") - .HasColumnType("INTEGER") - .HasColumnName("profile_id"); - - b.HasKey("Id") - .HasName("PK_job"); - - b.HasIndex("ProfileId"); - - 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.Loadout", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("loadout_id"); - - b.Property("LoadoutName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("loadout_name"); - - b.Property("ProfileId") - .HasColumnType("INTEGER") - .HasColumnName("profile_id"); - - b.HasKey("Id") - .HasName("PK_loadout"); - - b.HasIndex("ProfileId", "LoadoutName") - .IsUnique(); - - b.ToTable("loadout", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.PlayTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("play_time_id"); - - b.Property("PlayerId") - .HasColumnType("TEXT") - .HasColumnName("player_id"); - - b.Property("TimeSpent") - .HasColumnType("TEXT") - .HasColumnName("time_spent"); - - b.Property("Tracker") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("tracker"); - - b.HasKey("Id") - .HasName("PK_play_time"); - - b.HasIndex("PlayerId", "Tracker") - .IsUnique(); - - b.ToTable("play_time", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Player", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("player_id"); - - b.Property("FirstSeenTime") - .HasColumnType("TEXT") - .HasColumnName("first_seen_time"); - - b.Property("LastReadRules") - .HasColumnType("TEXT") - .HasColumnName("last_read_rules"); - - b.Property("LastSeenAddress") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("last_seen_address"); - - b.Property("LastSeenHWId") - .HasColumnType("BLOB") - .HasColumnName("last_seen_hwid"); - - b.Property("LastSeenTime") - .HasColumnType("TEXT") - .HasColumnName("last_seen_time"); - - b.Property("LastSeenUserName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("last_seen_user_name"); - - b.Property("UserId") - .HasColumnType("TEXT") - .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); - }); - - modelBuilder.Entity("Content.Server.Database.Preference", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("preference_id"); - - b.Property("AdminOOCColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("admin_ooc_color"); - - b.Property("SelectedCharacterSlot") - .HasColumnType("INTEGER") - .HasColumnName("selected_character_slot"); - - b.Property("UserId") - .HasColumnType("TEXT") - .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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("profile_id"); - - b.Property("Age") - .HasColumnType("INTEGER") - .HasColumnName("age"); - - b.Property("Backpack") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("backpack"); - - b.Property("CharacterName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("char_name"); - - b.Property("Clothing") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("clothing"); - - b.Property("CustomSpecieName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("custom_specie_name"); - - b.Property("EyeColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("eye_color"); - - b.Property("FacialHairColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("facial_hair_color"); - - b.Property("FacialHairName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("facial_hair_name"); - - b.Property("FlavorText") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("flavor_text"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("gender"); - - b.Property("HairColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("hair_color"); - - b.Property("HairName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("hair_name"); - - b.Property("Height") - .HasColumnType("REAL") - .HasColumnName("height"); - - b.Property("Markings") - .HasColumnType("jsonb") - .HasColumnName("markings"); - - b.Property("PreferenceId") - .HasColumnType("INTEGER") - .HasColumnName("preference_id"); - - b.Property("PreferenceUnavailable") - .HasColumnType("INTEGER") - .HasColumnName("pref_unavailable"); - - b.Property("Sex") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("sex"); - - b.Property("SkinColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("skin_color"); - - b.Property("Slot") - .HasColumnType("INTEGER") - .HasColumnName("slot"); - - b.Property("SpawnPriority") - .HasColumnType("INTEGER") - .HasColumnName("spawn_priority"); - - b.Property("Species") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("species"); - - b.Property("Width") - .HasColumnType("REAL") - .HasColumnName("width"); - - 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.RoleWhitelist", b => - { - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("RoleId") - .HasColumnType("TEXT") - .HasColumnName("role_id"); - - b.HasKey("PlayerUserId", "RoleId") - .HasName("PK_role_whitelists"); - - b.ToTable("role_whitelists", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("ServerId") - .HasColumnType("INTEGER") - .HasColumnName("server_id"); - - b.Property("StartDate") - .HasColumnType("TEXT") - .HasColumnName("start_date"); - - b.HasKey("Id") - .HasName("PK_round"); - - b.HasIndex("ServerId") - .HasDatabaseName("IX_round_server_id"); - - b.HasIndex("StartDate"); - - b.ToTable("round", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Server", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("server_id"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("PK_server"); - - b.ToTable("server", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("server_ban_id"); - - b.Property("Address") - .HasColumnType("TEXT") - .HasColumnName("address"); - - b.Property("AutoDelete") - .HasColumnType("INTEGER") - .HasColumnName("auto_delete"); - - b.Property("BanTime") - .HasColumnType("TEXT") - .HasColumnName("ban_time"); - - b.Property("BanningAdmin") - .HasColumnType("TEXT") - .HasColumnName("banning_admin"); - - b.Property("ExemptFlags") - .HasColumnType("INTEGER") - .HasColumnName("exempt_flags"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("HWId") - .HasColumnType("BLOB") - .HasColumnName("hwid"); - - b.Property("Hidden") - .HasColumnType("INTEGER") - .HasColumnName("hidden"); - - b.Property("LastEditedAt") - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("reason"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Severity") - .HasColumnType("INTEGER") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_server_ban"); - - b.HasIndex("Address"); - - b.HasIndex("BanningAdmin"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_server_ban_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_server_ban_round_id"); - - b.ToTable("server_ban", null, t => - { - t.HasCheckConstraint("HaveEitherAddressOrUserIdOrHWId", "address IS NOT NULL OR player_user_id IS NOT NULL OR hwid IS NOT NULL"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBanExemption", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.Property("Flags") - .HasColumnType("INTEGER") - .HasColumnName("flags"); - - b.HasKey("UserId") - .HasName("PK_server_ban_exemption"); - - b.ToTable("server_ban_exemption", null, t => - { - t.HasCheckConstraint("FlagsNotZero", "flags != 0"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBanHit", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("server_ban_hit_id"); - - b.Property("BanId") - .HasColumnType("INTEGER") - .HasColumnName("ban_id"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("server_role_ban_id"); - - b.Property("Address") - .HasColumnType("TEXT") - .HasColumnName("address"); - - b.Property("BanTime") - .HasColumnType("TEXT") - .HasColumnName("ban_time"); - - b.Property("BanningAdmin") - .HasColumnType("TEXT") - .HasColumnName("banning_admin"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("HWId") - .HasColumnType("BLOB") - .HasColumnName("hwid"); - - b.Property("Hidden") - .HasColumnType("INTEGER") - .HasColumnName("hidden"); - - b.Property("LastEditedAt") - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("reason"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("role_id"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Severity") - .HasColumnType("INTEGER") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_server_role_ban"); - - b.HasIndex("Address"); - - b.HasIndex("BanningAdmin"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_server_role_ban_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_server_role_ban_round_id"); - - b.ToTable("server_role_ban", null, t => - { - t.HasCheckConstraint("HaveEitherAddressOrUserIdOrHWId", "address IS NOT NULL OR player_user_id IS NOT NULL OR hwid IS NOT NULL"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerRoleUnban", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("role_unban_id"); - - b.Property("BanId") - .HasColumnType("INTEGER") - .HasColumnName("ban_id"); - - b.Property("UnbanTime") - .HasColumnType("TEXT") - .HasColumnName("unban_time"); - - b.Property("UnbanningAdmin") - .HasColumnType("TEXT") - .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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("unban_id"); - - b.Property("BanId") - .HasColumnType("INTEGER") - .HasColumnName("ban_id"); - - b.Property("UnbanTime") - .HasColumnType("TEXT") - .HasColumnName("unban_time"); - - b.Property("UnbanningAdmin") - .HasColumnType("TEXT") - .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.Trait", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("trait_id"); - - b.Property("ProfileId") - .HasColumnType("INTEGER") - .HasColumnName("profile_id"); - - b.Property("TraitName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("trait_name"); - - b.HasKey("Id") - .HasName("PK_trait"); - - b.HasIndex("ProfileId", "TraitName") - .IsUnique(); - - b.ToTable("trait", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.UploadedResourceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("uploaded_resource_log_id"); - - b.Property("Data") - .IsRequired() - .HasColumnType("BLOB") - .HasColumnName("data"); - - b.Property("Date") - .HasColumnType("TEXT") - .HasColumnName("date"); - - b.Property("Path") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("path"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.HasKey("Id") - .HasName("PK_uploaded_resource_log"); - - b.ToTable("uploaded_resource_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Whitelist", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.HasKey("UserId") - .HasName("PK_whitelist"); - - b.ToTable("whitelist", (string)null); - }); - - modelBuilder.Entity("PlayerRound", b => - { - b.Property("PlayersId") - .HasColumnType("INTEGER") - .HasColumnName("players_id"); - - b.Property("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.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("RoundId", "LogId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_admin_log_player_admin_log_round_id_log_id"); - - b.Navigation("Log"); - - b.Navigation("Player"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminMessage", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminMessagesCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminMessagesDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminMessagesLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminMessagesReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_messages_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_messages_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminNote", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminNotesCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminNotesDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminNotesLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminNotesReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_notes_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_notes_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - 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.AdminWatchlist", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminWatchlistsCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminWatchlistsDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminWatchlistsLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminWatchlistsReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_watchlists_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_watchlists_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - 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.ConnectionLog", b => - { - b.HasOne("Content.Server.Database.Server", "Server") - .WithMany("ConnectionLogs") - .HasForeignKey("ServerId") - .OnDelete(DeleteBehavior.SetNull) - .IsRequired() - .HasConstraintName("FK_connection_log_server_server_id"); - - b.Navigation("Server"); - }); - - 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.Loadout", b => - { - b.HasOne("Content.Server.Database.Profile", "Profile") - .WithMany("Loadouts") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_loadout_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.RoleWhitelist", b => - { - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("JobWhitelists") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_role_whitelists_player_player_user_id"); - - b.Navigation("Player"); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.HasOne("Content.Server.Database.Server", "Server") - .WithMany("Rounds") - .HasForeignKey("ServerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_round_server_server_id"); - - b.Navigation("Server"); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBan", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminServerBansCreated") - .HasForeignKey("BanningAdmin") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_ban_player_banning_admin"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminServerBansLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_ban_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_server_ban_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Round"); - }); - - 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.ServerRoleBan", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminServerRoleBansCreated") - .HasForeignKey("BanningAdmin") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_role_ban_player_banning_admin"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminServerRoleBansLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_role_ban_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_server_role_ban_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Round"); - }); - - 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("Content.Server.Database.Trait", b => - { - b.HasOne("Content.Server.Database.Profile", "Profile") - .WithMany("Traits") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_trait_profile_profile_id"); - - b.Navigation("Profile"); - }); - - 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("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"); - - b.Navigation("AdminMessagesCreated"); - - b.Navigation("AdminMessagesDeleted"); - - b.Navigation("AdminMessagesLastEdited"); - - b.Navigation("AdminMessagesReceived"); - - b.Navigation("AdminNotesCreated"); - - b.Navigation("AdminNotesDeleted"); - - b.Navigation("AdminNotesLastEdited"); - - b.Navigation("AdminNotesReceived"); - - b.Navigation("AdminServerBansCreated"); - - b.Navigation("AdminServerBansLastEdited"); - - b.Navigation("AdminServerRoleBansCreated"); - - b.Navigation("AdminServerRoleBansLastEdited"); - - b.Navigation("AdminWatchlistsCreated"); - - b.Navigation("AdminWatchlistsDeleted"); - - b.Navigation("AdminWatchlistsLastEdited"); - - b.Navigation("AdminWatchlistsReceived"); - - b.Navigation("JobWhitelists"); - }); - - modelBuilder.Entity("Content.Server.Database.Preference", b => - { - b.Navigation("Profiles"); - }); - - modelBuilder.Entity("Content.Server.Database.Profile", b => - { - b.Navigation("Antags"); - - b.Navigation("Jobs"); - - b.Navigation("Loadouts"); - - b.Navigation("Traits"); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.Navigation("AdminLogs"); - }); - - modelBuilder.Entity("Content.Server.Database.Server", b => - { - b.Navigation("ConnectionLogs"); - - b.Navigation("Rounds"); - }); - - 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 - } - } -} diff --git a/Content.Server.Database/Migrations/Sqlite/20241018043307_RoleWhitelist.cs b/Content.Server.Database/Migrations/Sqlite/20241018043307_RoleWhitelist.cs deleted file mode 100644 index 9d192fc6853..00000000000 --- a/Content.Server.Database/Migrations/Sqlite/20241018043307_RoleWhitelist.cs +++ /dev/null @@ -1,40 +0,0 @@ -#nullable disable - -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Content.Server.Database.Migrations.Sqlite -{ - /// - public partial class RoleWhitelist : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "role_whitelists", - columns: table => new - { - player_user_id = table.Column(type: "TEXT", nullable: false), - role_id = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_role_whitelists", x => new { x.player_user_id, x.role_id }); - table.ForeignKey( - name: "FK_role_whitelists_player_player_user_id", - column: x => x.player_user_id, - principalTable: "player", - principalColumn: "user_id", - onDelete: ReferentialAction.Cascade); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "role_whitelists"); - } - } -} diff --git a/Content.Server.Database/Migrations/Sqlite/20241111170107_ModernHwid.Designer.cs b/Content.Server.Database/Migrations/Sqlite/20241111170107_ModernHwid.Designer.cs deleted file mode 100644 index 56a9fe0a059..00000000000 --- a/Content.Server.Database/Migrations/Sqlite/20241111170107_ModernHwid.Designer.cs +++ /dev/null @@ -1,1995 +0,0 @@ -// -using System; -using Content.Server.Database; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Content.Server.Database.Migrations.Sqlite -{ - [DbContext(typeof(SqliteServerDbContext))] - [Migration("20241111170107_ModernHwid")] - partial class ModernHwid - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.0"); - - modelBuilder.Entity("Content.Server.Database.Admin", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.Property("AdminRankId") - .HasColumnType("INTEGER") - .HasColumnName("admin_rank_id"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_flag_id"); - - b.Property("AdminId") - .HasColumnType("TEXT") - .HasColumnName("admin_id"); - - b.Property("Flag") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("flag"); - - b.Property("Negative") - .HasColumnType("INTEGER") - .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("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Id") - .HasColumnType("INTEGER") - .HasColumnName("admin_log_id"); - - b.Property("Date") - .HasColumnType("TEXT") - .HasColumnName("date"); - - b.Property("Impact") - .HasColumnType("INTEGER") - .HasColumnName("impact"); - - b.Property("Json") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("json"); - - b.Property("Message") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("message"); - - b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("type"); - - b.HasKey("RoundId", "Id") - .HasName("PK_admin_log"); - - b.HasIndex("Date"); - - b.HasIndex("Type") - .HasDatabaseName("IX_admin_log_type"); - - b.ToTable("admin_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminLogPlayer", b => - { - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("LogId") - .HasColumnType("INTEGER") - .HasColumnName("log_id"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.HasKey("RoundId", "LogId", "PlayerUserId") - .HasName("PK_admin_log_player"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_log_player_player_user_id"); - - b.ToTable("admin_log_player", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_messages_id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("TEXT") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("INTEGER") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("TEXT") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("TEXT") - .HasColumnName("deleted_by_id"); - - b.Property("Dismissed") - .HasColumnType("INTEGER") - .HasColumnName("dismissed"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("TEXT") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Seen") - .HasColumnType("INTEGER") - .HasColumnName("seen"); - - b.HasKey("Id") - .HasName("PK_admin_messages"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_messages_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_messages_round_id"); - - b.ToTable("admin_messages", null, t => - { - t.HasCheckConstraint("NotDismissedAndSeen", "NOT dismissed OR seen"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.AdminNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_notes_id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("TEXT") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("INTEGER") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("TEXT") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("TEXT") - .HasColumnName("deleted_by_id"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("TEXT") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Secret") - .HasColumnType("INTEGER") - .HasColumnName("secret"); - - b.Property("Severity") - .HasColumnType("INTEGER") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_admin_notes"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_notes_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_notes_round_id"); - - b.ToTable("admin_notes", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminRank", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_rank_id"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_rank_flag_id"); - - b.Property("AdminRankId") - .HasColumnType("INTEGER") - .HasColumnName("admin_rank_id"); - - b.Property("Flag") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("flag"); - - b.HasKey("Id") - .HasName("PK_admin_rank_flag"); - - b.HasIndex("AdminRankId"); - - b.HasIndex("Flag", "AdminRankId") - .IsUnique(); - - b.ToTable("admin_rank_flag", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminWatchlist", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_watchlists_id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("TEXT") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("INTEGER") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("TEXT") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("TEXT") - .HasColumnName("deleted_by_id"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("TEXT") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.HasKey("Id") - .HasName("PK_admin_watchlists"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_watchlists_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_watchlists_round_id"); - - b.ToTable("admin_watchlists", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Antag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("antag_id"); - - b.Property("AntagName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("antag_name"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("assigned_user_id_id"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.Property("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.BanTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("ban_template_id"); - - b.Property("AutoDelete") - .HasColumnType("INTEGER") - .HasColumnName("auto_delete"); - - b.Property("ExemptFlags") - .HasColumnType("INTEGER") - .HasColumnName("exempt_flags"); - - b.Property("Hidden") - .HasColumnType("INTEGER") - .HasColumnName("hidden"); - - b.Property("Length") - .HasColumnType("TEXT") - .HasColumnName("length"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("reason"); - - b.Property("Severity") - .HasColumnType("INTEGER") - .HasColumnName("severity"); - - b.Property("Title") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("title"); - - b.HasKey("Id") - .HasName("PK_ban_template"); - - b.ToTable("ban_template", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Blacklist", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.HasKey("UserId") - .HasName("PK_blacklist"); - - b.ToTable("blacklist", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ConnectionLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("connection_log_id"); - - b.Property("Address") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("address"); - - b.Property("Denied") - .HasColumnType("INTEGER") - .HasColumnName("denied"); - - b.Property("ServerId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0) - .HasColumnName("server_id"); - - b.Property("Time") - .HasColumnType("TEXT") - .HasColumnName("time"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.Property("UserName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("user_name"); - - b.HasKey("Id") - .HasName("PK_connection_log"); - - b.HasIndex("ServerId") - .HasDatabaseName("IX_connection_log_server_id"); - - b.HasIndex("Time"); - - b.HasIndex("UserId"); - - b.ToTable("connection_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Job", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("job_id"); - - b.Property("JobName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("job_name"); - - b.Property("Priority") - .HasColumnType("INTEGER") - .HasColumnName("priority"); - - b.Property("ProfileId") - .HasColumnType("INTEGER") - .HasColumnName("profile_id"); - - b.HasKey("Id") - .HasName("PK_job"); - - b.HasIndex("ProfileId"); - - 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.PlayTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("play_time_id"); - - b.Property("PlayerId") - .HasColumnType("TEXT") - .HasColumnName("player_id"); - - b.Property("TimeSpent") - .HasColumnType("TEXT") - .HasColumnName("time_spent"); - - b.Property("Tracker") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("tracker"); - - b.HasKey("Id") - .HasName("PK_play_time"); - - b.HasIndex("PlayerId", "Tracker") - .IsUnique(); - - b.ToTable("play_time", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Player", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("player_id"); - - b.Property("FirstSeenTime") - .HasColumnType("TEXT") - .HasColumnName("first_seen_time"); - - b.Property("LastReadRules") - .HasColumnType("TEXT") - .HasColumnName("last_read_rules"); - - b.Property("LastSeenAddress") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("last_seen_address"); - - b.Property("LastSeenTime") - .HasColumnType("TEXT") - .HasColumnName("last_seen_time"); - - b.Property("LastSeenUserName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("last_seen_user_name"); - - b.Property("UserId") - .HasColumnType("TEXT") - .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); - }); - - modelBuilder.Entity("Content.Server.Database.Preference", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("preference_id"); - - b.Property("AdminOOCColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("admin_ooc_color"); - - b.Property("SelectedCharacterSlot") - .HasColumnType("INTEGER") - .HasColumnName("selected_character_slot"); - - b.Property("UserId") - .HasColumnType("TEXT") - .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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("profile_id"); - - b.Property("Age") - .HasColumnType("INTEGER") - .HasColumnName("age"); - - b.Property("CharacterName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("char_name"); - - b.Property("EyeColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("eye_color"); - - b.Property("FacialHairColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("facial_hair_color"); - - b.Property("FacialHairName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("facial_hair_name"); - - b.Property("FlavorText") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("flavor_text"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("gender"); - - b.Property("HairColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("hair_color"); - - b.Property("HairName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("hair_name"); - - b.Property("Markings") - .HasColumnType("jsonb") - .HasColumnName("markings"); - - b.Property("PreferenceId") - .HasColumnType("INTEGER") - .HasColumnName("preference_id"); - - b.Property("PreferenceUnavailable") - .HasColumnType("INTEGER") - .HasColumnName("pref_unavailable"); - - b.Property("Sex") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("sex"); - - b.Property("SkinColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("skin_color"); - - b.Property("Slot") - .HasColumnType("INTEGER") - .HasColumnName("slot"); - - b.Property("SpawnPriority") - .HasColumnType("INTEGER") - .HasColumnName("spawn_priority"); - - b.Property("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.ProfileLoadout", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("profile_loadout_id"); - - b.Property("LoadoutName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("loadout_name"); - - b.Property("ProfileLoadoutGroupId") - .HasColumnType("INTEGER") - .HasColumnName("profile_loadout_group_id"); - - b.HasKey("Id") - .HasName("PK_profile_loadout"); - - b.HasIndex("ProfileLoadoutGroupId"); - - b.ToTable("profile_loadout", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("profile_loadout_group_id"); - - b.Property("GroupName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("group_name"); - - b.Property("ProfileRoleLoadoutId") - .HasColumnType("INTEGER") - .HasColumnName("profile_role_loadout_id"); - - b.HasKey("Id") - .HasName("PK_profile_loadout_group"); - - b.HasIndex("ProfileRoleLoadoutId"); - - b.ToTable("profile_loadout_group", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("profile_role_loadout_id"); - - b.Property("ProfileId") - .HasColumnType("INTEGER") - .HasColumnName("profile_id"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("role_name"); - - b.HasKey("Id") - .HasName("PK_profile_role_loadout"); - - b.HasIndex("ProfileId"); - - b.ToTable("profile_role_loadout", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.RoleWhitelist", b => - { - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("RoleId") - .HasColumnType("TEXT") - .HasColumnName("role_id"); - - b.HasKey("PlayerUserId", "RoleId") - .HasName("PK_role_whitelists"); - - b.ToTable("role_whitelists", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("ServerId") - .HasColumnType("INTEGER") - .HasColumnName("server_id"); - - b.Property("StartDate") - .HasColumnType("TEXT") - .HasColumnName("start_date"); - - b.HasKey("Id") - .HasName("PK_round"); - - b.HasIndex("ServerId") - .HasDatabaseName("IX_round_server_id"); - - b.HasIndex("StartDate"); - - b.ToTable("round", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Server", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("server_id"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("PK_server"); - - b.ToTable("server", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("server_ban_id"); - - b.Property("Address") - .HasColumnType("TEXT") - .HasColumnName("address"); - - b.Property("AutoDelete") - .HasColumnType("INTEGER") - .HasColumnName("auto_delete"); - - b.Property("BanTime") - .HasColumnType("TEXT") - .HasColumnName("ban_time"); - - b.Property("BanningAdmin") - .HasColumnType("TEXT") - .HasColumnName("banning_admin"); - - b.Property("ExemptFlags") - .HasColumnType("INTEGER") - .HasColumnName("exempt_flags"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("Hidden") - .HasColumnType("INTEGER") - .HasColumnName("hidden"); - - b.Property("LastEditedAt") - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("reason"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Severity") - .HasColumnType("INTEGER") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_server_ban"); - - b.HasIndex("Address"); - - b.HasIndex("BanningAdmin"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_server_ban_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_server_ban_round_id"); - - b.ToTable("server_ban", null, t => - { - t.HasCheckConstraint("HaveEitherAddressOrUserIdOrHWId", "address IS NOT NULL OR player_user_id IS NOT NULL OR hwid IS NOT NULL"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBanExemption", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.Property("Flags") - .HasColumnType("INTEGER") - .HasColumnName("flags"); - - b.HasKey("UserId") - .HasName("PK_server_ban_exemption"); - - b.ToTable("server_ban_exemption", null, t => - { - t.HasCheckConstraint("FlagsNotZero", "flags != 0"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBanHit", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("server_ban_hit_id"); - - b.Property("BanId") - .HasColumnType("INTEGER") - .HasColumnName("ban_id"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("server_role_ban_id"); - - b.Property("Address") - .HasColumnType("TEXT") - .HasColumnName("address"); - - b.Property("BanTime") - .HasColumnType("TEXT") - .HasColumnName("ban_time"); - - b.Property("BanningAdmin") - .HasColumnType("TEXT") - .HasColumnName("banning_admin"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("Hidden") - .HasColumnType("INTEGER") - .HasColumnName("hidden"); - - b.Property("LastEditedAt") - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("reason"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("role_id"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Severity") - .HasColumnType("INTEGER") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_server_role_ban"); - - b.HasIndex("Address"); - - b.HasIndex("BanningAdmin"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_server_role_ban_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_server_role_ban_round_id"); - - b.ToTable("server_role_ban", null, t => - { - t.HasCheckConstraint("HaveEitherAddressOrUserIdOrHWId", "address IS NOT NULL OR player_user_id IS NOT NULL OR hwid IS NOT NULL"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerRoleUnban", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("role_unban_id"); - - b.Property("BanId") - .HasColumnType("INTEGER") - .HasColumnName("ban_id"); - - b.Property("UnbanTime") - .HasColumnType("TEXT") - .HasColumnName("unban_time"); - - b.Property("UnbanningAdmin") - .HasColumnType("TEXT") - .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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("unban_id"); - - b.Property("BanId") - .HasColumnType("INTEGER") - .HasColumnName("ban_id"); - - b.Property("UnbanTime") - .HasColumnType("TEXT") - .HasColumnName("unban_time"); - - b.Property("UnbanningAdmin") - .HasColumnType("TEXT") - .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.Trait", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("trait_id"); - - b.Property("ProfileId") - .HasColumnType("INTEGER") - .HasColumnName("profile_id"); - - b.Property("TraitName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("trait_name"); - - b.HasKey("Id") - .HasName("PK_trait"); - - b.HasIndex("ProfileId", "TraitName") - .IsUnique(); - - b.ToTable("trait", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.UploadedResourceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("uploaded_resource_log_id"); - - b.Property("Data") - .IsRequired() - .HasColumnType("BLOB") - .HasColumnName("data"); - - b.Property("Date") - .HasColumnType("TEXT") - .HasColumnName("date"); - - b.Property("Path") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("path"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.HasKey("Id") - .HasName("PK_uploaded_resource_log"); - - b.ToTable("uploaded_resource_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Whitelist", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.HasKey("UserId") - .HasName("PK_whitelist"); - - b.ToTable("whitelist", (string)null); - }); - - modelBuilder.Entity("PlayerRound", b => - { - b.Property("PlayersId") - .HasColumnType("INTEGER") - .HasColumnName("players_id"); - - b.Property("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.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("RoundId", "LogId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_admin_log_player_admin_log_round_id_log_id"); - - b.Navigation("Log"); - - b.Navigation("Player"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminMessage", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminMessagesCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminMessagesDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminMessagesLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminMessagesReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_messages_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_messages_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminNote", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminNotesCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminNotesDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminNotesLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminNotesReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_notes_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_notes_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - 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.AdminWatchlist", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminWatchlistsCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminWatchlistsDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminWatchlistsLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminWatchlistsReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_watchlists_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_watchlists_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - 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.ConnectionLog", b => - { - b.HasOne("Content.Server.Database.Server", "Server") - .WithMany("ConnectionLogs") - .HasForeignKey("ServerId") - .OnDelete(DeleteBehavior.SetNull) - .IsRequired() - .HasConstraintName("FK_connection_log_server_server_id"); - - b.OwnsOne("Content.Server.Database.TypedHwid", "HWId", b1 => - { - b1.Property("ConnectionLogId") - .HasColumnType("INTEGER") - .HasColumnName("connection_log_id"); - - b1.Property("Hwid") - .IsRequired() - .HasColumnType("BLOB") - .HasColumnName("hwid"); - - b1.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0) - .HasColumnName("hwid_type"); - - b1.HasKey("ConnectionLogId"); - - b1.ToTable("connection_log"); - - b1.WithOwner() - .HasForeignKey("ConnectionLogId") - .HasConstraintName("FK_connection_log_connection_log_connection_log_id"); - }); - - b.Navigation("HWId"); - - b.Navigation("Server"); - }); - - 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.Player", b => - { - b.OwnsOne("Content.Server.Database.TypedHwid", "LastSeenHWId", b1 => - { - b1.Property("PlayerId") - .HasColumnType("INTEGER") - .HasColumnName("player_id"); - - b1.Property("Hwid") - .IsRequired() - .HasColumnType("BLOB") - .HasColumnName("last_seen_hwid"); - - b1.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0) - .HasColumnName("last_seen_hwid_type"); - - b1.HasKey("PlayerId"); - - b1.ToTable("player"); - - b1.WithOwner() - .HasForeignKey("PlayerId") - .HasConstraintName("FK_player_player_player_id"); - }); - - b.Navigation("LastSeenHWId"); - }); - - 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.ProfileLoadout", b => - { - b.HasOne("Content.Server.Database.ProfileLoadoutGroup", "ProfileLoadoutGroup") - .WithMany("Loadouts") - .HasForeignKey("ProfileLoadoutGroupId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_profile_loadout_profile_loadout_group_profile_loadout_group_id"); - - b.Navigation("ProfileLoadoutGroup"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => - { - b.HasOne("Content.Server.Database.ProfileRoleLoadout", "ProfileRoleLoadout") - .WithMany("Groups") - .HasForeignKey("ProfileRoleLoadoutId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_profile_loadout_group_profile_role_loadout_profile_role_loadout_id"); - - b.Navigation("ProfileRoleLoadout"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => - { - b.HasOne("Content.Server.Database.Profile", "Profile") - .WithMany("Loadouts") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_profile_role_loadout_profile_profile_id"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("Content.Server.Database.RoleWhitelist", b => - { - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("JobWhitelists") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_role_whitelists_player_player_user_id"); - - b.Navigation("Player"); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.HasOne("Content.Server.Database.Server", "Server") - .WithMany("Rounds") - .HasForeignKey("ServerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_round_server_server_id"); - - b.Navigation("Server"); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBan", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminServerBansCreated") - .HasForeignKey("BanningAdmin") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_ban_player_banning_admin"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminServerBansLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_ban_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_server_ban_round_round_id"); - - b.OwnsOne("Content.Server.Database.TypedHwid", "HWId", b1 => - { - b1.Property("ServerBanId") - .HasColumnType("INTEGER") - .HasColumnName("server_ban_id"); - - b1.Property("Hwid") - .IsRequired() - .HasColumnType("BLOB") - .HasColumnName("hwid"); - - b1.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0) - .HasColumnName("hwid_type"); - - b1.HasKey("ServerBanId"); - - b1.ToTable("server_ban"); - - b1.WithOwner() - .HasForeignKey("ServerBanId") - .HasConstraintName("FK_server_ban_server_ban_server_ban_id"); - }); - - b.Navigation("CreatedBy"); - - b.Navigation("HWId"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Round"); - }); - - 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.ServerRoleBan", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminServerRoleBansCreated") - .HasForeignKey("BanningAdmin") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_role_ban_player_banning_admin"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminServerRoleBansLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_role_ban_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_server_role_ban_round_round_id"); - - b.OwnsOne("Content.Server.Database.TypedHwid", "HWId", b1 => - { - b1.Property("ServerRoleBanId") - .HasColumnType("INTEGER") - .HasColumnName("server_role_ban_id"); - - b1.Property("Hwid") - .IsRequired() - .HasColumnType("BLOB") - .HasColumnName("hwid"); - - b1.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0) - .HasColumnName("hwid_type"); - - b1.HasKey("ServerRoleBanId"); - - b1.ToTable("server_role_ban"); - - b1.WithOwner() - .HasForeignKey("ServerRoleBanId") - .HasConstraintName("FK_server_role_ban_server_role_ban_server_role_ban_id"); - }); - - b.Navigation("CreatedBy"); - - b.Navigation("HWId"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Round"); - }); - - 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("Content.Server.Database.Trait", b => - { - b.HasOne("Content.Server.Database.Profile", "Profile") - .WithMany("Traits") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_trait_profile_profile_id"); - - b.Navigation("Profile"); - }); - - 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("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"); - - b.Navigation("AdminMessagesCreated"); - - b.Navigation("AdminMessagesDeleted"); - - b.Navigation("AdminMessagesLastEdited"); - - b.Navigation("AdminMessagesReceived"); - - b.Navigation("AdminNotesCreated"); - - b.Navigation("AdminNotesDeleted"); - - b.Navigation("AdminNotesLastEdited"); - - b.Navigation("AdminNotesReceived"); - - b.Navigation("AdminServerBansCreated"); - - b.Navigation("AdminServerBansLastEdited"); - - b.Navigation("AdminServerRoleBansCreated"); - - b.Navigation("AdminServerRoleBansLastEdited"); - - b.Navigation("AdminWatchlistsCreated"); - - b.Navigation("AdminWatchlistsDeleted"); - - b.Navigation("AdminWatchlistsLastEdited"); - - b.Navigation("AdminWatchlistsReceived"); - - b.Navigation("JobWhitelists"); - }); - - modelBuilder.Entity("Content.Server.Database.Preference", b => - { - b.Navigation("Profiles"); - }); - - modelBuilder.Entity("Content.Server.Database.Profile", b => - { - b.Navigation("Antags"); - - b.Navigation("Jobs"); - - b.Navigation("Loadouts"); - - b.Navigation("Traits"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => - { - b.Navigation("Loadouts"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => - { - b.Navigation("Groups"); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.Navigation("AdminLogs"); - }); - - modelBuilder.Entity("Content.Server.Database.Server", b => - { - b.Navigation("ConnectionLogs"); - - b.Navigation("Rounds"); - }); - - 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 - } - } -} diff --git a/Content.Server.Database/Migrations/Sqlite/20241111170107_ModernHwid.cs b/Content.Server.Database/Migrations/Sqlite/20241111170107_ModernHwid.cs deleted file mode 100644 index 97b5dafd03f..00000000000 --- a/Content.Server.Database/Migrations/Sqlite/20241111170107_ModernHwid.cs +++ /dev/null @@ -1,62 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Content.Server.Database.Migrations.Sqlite -{ - /// - public partial class ModernHwid : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "hwid_type", - table: "server_role_ban", - type: "INTEGER", - nullable: true, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "hwid_type", - table: "server_ban", - type: "INTEGER", - nullable: true, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "last_seen_hwid_type", - table: "player", - type: "INTEGER", - nullable: true, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "hwid_type", - table: "connection_log", - type: "INTEGER", - nullable: true, - defaultValue: 0); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "hwid_type", - table: "server_role_ban"); - - migrationBuilder.DropColumn( - name: "hwid_type", - table: "server_ban"); - - migrationBuilder.DropColumn( - name: "last_seen_hwid_type", - table: "player"); - - migrationBuilder.DropColumn( - name: "hwid_type", - table: "connection_log"); - } - } -} diff --git a/Content.Server.Database/Migrations/Sqlite/20241111193602_ConnectionTrust.Designer.cs b/Content.Server.Database/Migrations/Sqlite/20241111193602_ConnectionTrust.Designer.cs deleted file mode 100644 index bd4e20a464b..00000000000 --- a/Content.Server.Database/Migrations/Sqlite/20241111193602_ConnectionTrust.Designer.cs +++ /dev/null @@ -1,1999 +0,0 @@ -// -using System; -using Content.Server.Database; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Content.Server.Database.Migrations.Sqlite -{ - [DbContext(typeof(SqliteServerDbContext))] - [Migration("20241111193602_ConnectionTrust")] - partial class ConnectionTrust - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.0"); - - modelBuilder.Entity("Content.Server.Database.Admin", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.Property("AdminRankId") - .HasColumnType("INTEGER") - .HasColumnName("admin_rank_id"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_flag_id"); - - b.Property("AdminId") - .HasColumnType("TEXT") - .HasColumnName("admin_id"); - - b.Property("Flag") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("flag"); - - b.Property("Negative") - .HasColumnType("INTEGER") - .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("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Id") - .HasColumnType("INTEGER") - .HasColumnName("admin_log_id"); - - b.Property("Date") - .HasColumnType("TEXT") - .HasColumnName("date"); - - b.Property("Impact") - .HasColumnType("INTEGER") - .HasColumnName("impact"); - - b.Property("Json") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("json"); - - b.Property("Message") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("message"); - - b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("type"); - - b.HasKey("RoundId", "Id") - .HasName("PK_admin_log"); - - b.HasIndex("Date"); - - b.HasIndex("Type") - .HasDatabaseName("IX_admin_log_type"); - - b.ToTable("admin_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminLogPlayer", b => - { - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("LogId") - .HasColumnType("INTEGER") - .HasColumnName("log_id"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.HasKey("RoundId", "LogId", "PlayerUserId") - .HasName("PK_admin_log_player"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_log_player_player_user_id"); - - b.ToTable("admin_log_player", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_messages_id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("TEXT") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("INTEGER") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("TEXT") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("TEXT") - .HasColumnName("deleted_by_id"); - - b.Property("Dismissed") - .HasColumnType("INTEGER") - .HasColumnName("dismissed"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("TEXT") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Seen") - .HasColumnType("INTEGER") - .HasColumnName("seen"); - - b.HasKey("Id") - .HasName("PK_admin_messages"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_messages_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_messages_round_id"); - - b.ToTable("admin_messages", null, t => - { - t.HasCheckConstraint("NotDismissedAndSeen", "NOT dismissed OR seen"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.AdminNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_notes_id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("TEXT") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("INTEGER") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("TEXT") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("TEXT") - .HasColumnName("deleted_by_id"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("TEXT") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Secret") - .HasColumnType("INTEGER") - .HasColumnName("secret"); - - b.Property("Severity") - .HasColumnType("INTEGER") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_admin_notes"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_notes_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_notes_round_id"); - - b.ToTable("admin_notes", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminRank", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_rank_id"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_rank_flag_id"); - - b.Property("AdminRankId") - .HasColumnType("INTEGER") - .HasColumnName("admin_rank_id"); - - b.Property("Flag") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("flag"); - - b.HasKey("Id") - .HasName("PK_admin_rank_flag"); - - b.HasIndex("AdminRankId"); - - b.HasIndex("Flag", "AdminRankId") - .IsUnique(); - - b.ToTable("admin_rank_flag", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminWatchlist", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_watchlists_id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("TEXT") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("INTEGER") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("TEXT") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("TEXT") - .HasColumnName("deleted_by_id"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("TEXT") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.HasKey("Id") - .HasName("PK_admin_watchlists"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_watchlists_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_watchlists_round_id"); - - b.ToTable("admin_watchlists", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Antag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("antag_id"); - - b.Property("AntagName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("antag_name"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("assigned_user_id_id"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.Property("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.BanTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("ban_template_id"); - - b.Property("AutoDelete") - .HasColumnType("INTEGER") - .HasColumnName("auto_delete"); - - b.Property("ExemptFlags") - .HasColumnType("INTEGER") - .HasColumnName("exempt_flags"); - - b.Property("Hidden") - .HasColumnType("INTEGER") - .HasColumnName("hidden"); - - b.Property("Length") - .HasColumnType("TEXT") - .HasColumnName("length"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("reason"); - - b.Property("Severity") - .HasColumnType("INTEGER") - .HasColumnName("severity"); - - b.Property("Title") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("title"); - - b.HasKey("Id") - .HasName("PK_ban_template"); - - b.ToTable("ban_template", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Blacklist", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.HasKey("UserId") - .HasName("PK_blacklist"); - - b.ToTable("blacklist", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ConnectionLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("connection_log_id"); - - b.Property("Address") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("address"); - - b.Property("Denied") - .HasColumnType("INTEGER") - .HasColumnName("denied"); - - b.Property("ServerId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0) - .HasColumnName("server_id"); - - b.Property("Time") - .HasColumnType("TEXT") - .HasColumnName("time"); - - b.Property("Trust") - .HasColumnType("REAL") - .HasColumnName("trust"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.Property("UserName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("user_name"); - - b.HasKey("Id") - .HasName("PK_connection_log"); - - b.HasIndex("ServerId") - .HasDatabaseName("IX_connection_log_server_id"); - - b.HasIndex("Time"); - - b.HasIndex("UserId"); - - b.ToTable("connection_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Job", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("job_id"); - - b.Property("JobName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("job_name"); - - b.Property("Priority") - .HasColumnType("INTEGER") - .HasColumnName("priority"); - - b.Property("ProfileId") - .HasColumnType("INTEGER") - .HasColumnName("profile_id"); - - b.HasKey("Id") - .HasName("PK_job"); - - b.HasIndex("ProfileId"); - - 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.PlayTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("play_time_id"); - - b.Property("PlayerId") - .HasColumnType("TEXT") - .HasColumnName("player_id"); - - b.Property("TimeSpent") - .HasColumnType("TEXT") - .HasColumnName("time_spent"); - - b.Property("Tracker") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("tracker"); - - b.HasKey("Id") - .HasName("PK_play_time"); - - b.HasIndex("PlayerId", "Tracker") - .IsUnique(); - - b.ToTable("play_time", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Player", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("player_id"); - - b.Property("FirstSeenTime") - .HasColumnType("TEXT") - .HasColumnName("first_seen_time"); - - b.Property("LastReadRules") - .HasColumnType("TEXT") - .HasColumnName("last_read_rules"); - - b.Property("LastSeenAddress") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("last_seen_address"); - - b.Property("LastSeenTime") - .HasColumnType("TEXT") - .HasColumnName("last_seen_time"); - - b.Property("LastSeenUserName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("last_seen_user_name"); - - b.Property("UserId") - .HasColumnType("TEXT") - .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); - }); - - modelBuilder.Entity("Content.Server.Database.Preference", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("preference_id"); - - b.Property("AdminOOCColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("admin_ooc_color"); - - b.Property("SelectedCharacterSlot") - .HasColumnType("INTEGER") - .HasColumnName("selected_character_slot"); - - b.Property("UserId") - .HasColumnType("TEXT") - .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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("profile_id"); - - b.Property("Age") - .HasColumnType("INTEGER") - .HasColumnName("age"); - - b.Property("CharacterName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("char_name"); - - b.Property("EyeColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("eye_color"); - - b.Property("FacialHairColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("facial_hair_color"); - - b.Property("FacialHairName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("facial_hair_name"); - - b.Property("FlavorText") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("flavor_text"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("gender"); - - b.Property("HairColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("hair_color"); - - b.Property("HairName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("hair_name"); - - b.Property("Markings") - .HasColumnType("jsonb") - .HasColumnName("markings"); - - b.Property("PreferenceId") - .HasColumnType("INTEGER") - .HasColumnName("preference_id"); - - b.Property("PreferenceUnavailable") - .HasColumnType("INTEGER") - .HasColumnName("pref_unavailable"); - - b.Property("Sex") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("sex"); - - b.Property("SkinColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("skin_color"); - - b.Property("Slot") - .HasColumnType("INTEGER") - .HasColumnName("slot"); - - b.Property("SpawnPriority") - .HasColumnType("INTEGER") - .HasColumnName("spawn_priority"); - - b.Property("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.ProfileLoadout", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("profile_loadout_id"); - - b.Property("LoadoutName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("loadout_name"); - - b.Property("ProfileLoadoutGroupId") - .HasColumnType("INTEGER") - .HasColumnName("profile_loadout_group_id"); - - b.HasKey("Id") - .HasName("PK_profile_loadout"); - - b.HasIndex("ProfileLoadoutGroupId"); - - b.ToTable("profile_loadout", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("profile_loadout_group_id"); - - b.Property("GroupName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("group_name"); - - b.Property("ProfileRoleLoadoutId") - .HasColumnType("INTEGER") - .HasColumnName("profile_role_loadout_id"); - - b.HasKey("Id") - .HasName("PK_profile_loadout_group"); - - b.HasIndex("ProfileRoleLoadoutId"); - - b.ToTable("profile_loadout_group", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("profile_role_loadout_id"); - - b.Property("ProfileId") - .HasColumnType("INTEGER") - .HasColumnName("profile_id"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("role_name"); - - b.HasKey("Id") - .HasName("PK_profile_role_loadout"); - - b.HasIndex("ProfileId"); - - b.ToTable("profile_role_loadout", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.RoleWhitelist", b => - { - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("RoleId") - .HasColumnType("TEXT") - .HasColumnName("role_id"); - - b.HasKey("PlayerUserId", "RoleId") - .HasName("PK_role_whitelists"); - - b.ToTable("role_whitelists", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("ServerId") - .HasColumnType("INTEGER") - .HasColumnName("server_id"); - - b.Property("StartDate") - .HasColumnType("TEXT") - .HasColumnName("start_date"); - - b.HasKey("Id") - .HasName("PK_round"); - - b.HasIndex("ServerId") - .HasDatabaseName("IX_round_server_id"); - - b.HasIndex("StartDate"); - - b.ToTable("round", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Server", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("server_id"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("PK_server"); - - b.ToTable("server", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("server_ban_id"); - - b.Property("Address") - .HasColumnType("TEXT") - .HasColumnName("address"); - - b.Property("AutoDelete") - .HasColumnType("INTEGER") - .HasColumnName("auto_delete"); - - b.Property("BanTime") - .HasColumnType("TEXT") - .HasColumnName("ban_time"); - - b.Property("BanningAdmin") - .HasColumnType("TEXT") - .HasColumnName("banning_admin"); - - b.Property("ExemptFlags") - .HasColumnType("INTEGER") - .HasColumnName("exempt_flags"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("Hidden") - .HasColumnType("INTEGER") - .HasColumnName("hidden"); - - b.Property("LastEditedAt") - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("reason"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Severity") - .HasColumnType("INTEGER") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_server_ban"); - - b.HasIndex("Address"); - - b.HasIndex("BanningAdmin"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_server_ban_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_server_ban_round_id"); - - b.ToTable("server_ban", null, t => - { - t.HasCheckConstraint("HaveEitherAddressOrUserIdOrHWId", "address IS NOT NULL OR player_user_id IS NOT NULL OR hwid IS NOT NULL"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBanExemption", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.Property("Flags") - .HasColumnType("INTEGER") - .HasColumnName("flags"); - - b.HasKey("UserId") - .HasName("PK_server_ban_exemption"); - - b.ToTable("server_ban_exemption", null, t => - { - t.HasCheckConstraint("FlagsNotZero", "flags != 0"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBanHit", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("server_ban_hit_id"); - - b.Property("BanId") - .HasColumnType("INTEGER") - .HasColumnName("ban_id"); - - b.Property("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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("server_role_ban_id"); - - b.Property("Address") - .HasColumnType("TEXT") - .HasColumnName("address"); - - b.Property("BanTime") - .HasColumnType("TEXT") - .HasColumnName("ban_time"); - - b.Property("BanningAdmin") - .HasColumnType("TEXT") - .HasColumnName("banning_admin"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("Hidden") - .HasColumnType("INTEGER") - .HasColumnName("hidden"); - - b.Property("LastEditedAt") - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("reason"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("role_id"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Severity") - .HasColumnType("INTEGER") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_server_role_ban"); - - b.HasIndex("Address"); - - b.HasIndex("BanningAdmin"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_server_role_ban_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_server_role_ban_round_id"); - - b.ToTable("server_role_ban", null, t => - { - t.HasCheckConstraint("HaveEitherAddressOrUserIdOrHWId", "address IS NOT NULL OR player_user_id IS NOT NULL OR hwid IS NOT NULL"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerRoleUnban", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("role_unban_id"); - - b.Property("BanId") - .HasColumnType("INTEGER") - .HasColumnName("ban_id"); - - b.Property("UnbanTime") - .HasColumnType("TEXT") - .HasColumnName("unban_time"); - - b.Property("UnbanningAdmin") - .HasColumnType("TEXT") - .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("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("unban_id"); - - b.Property("BanId") - .HasColumnType("INTEGER") - .HasColumnName("ban_id"); - - b.Property("UnbanTime") - .HasColumnType("TEXT") - .HasColumnName("unban_time"); - - b.Property("UnbanningAdmin") - .HasColumnType("TEXT") - .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.Trait", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("trait_id"); - - b.Property("ProfileId") - .HasColumnType("INTEGER") - .HasColumnName("profile_id"); - - b.Property("TraitName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("trait_name"); - - b.HasKey("Id") - .HasName("PK_trait"); - - b.HasIndex("ProfileId", "TraitName") - .IsUnique(); - - b.ToTable("trait", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.UploadedResourceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("uploaded_resource_log_id"); - - b.Property("Data") - .IsRequired() - .HasColumnType("BLOB") - .HasColumnName("data"); - - b.Property("Date") - .HasColumnType("TEXT") - .HasColumnName("date"); - - b.Property("Path") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("path"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.HasKey("Id") - .HasName("PK_uploaded_resource_log"); - - b.ToTable("uploaded_resource_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Whitelist", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.HasKey("UserId") - .HasName("PK_whitelist"); - - b.ToTable("whitelist", (string)null); - }); - - modelBuilder.Entity("PlayerRound", b => - { - b.Property("PlayersId") - .HasColumnType("INTEGER") - .HasColumnName("players_id"); - - b.Property("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.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("RoundId", "LogId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_admin_log_player_admin_log_round_id_log_id"); - - b.Navigation("Log"); - - b.Navigation("Player"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminMessage", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminMessagesCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminMessagesDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminMessagesLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminMessagesReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_messages_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_messages_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminNote", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminNotesCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminNotesDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminNotesLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminNotesReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_notes_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_notes_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - 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.AdminWatchlist", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminWatchlistsCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminWatchlistsDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminWatchlistsLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminWatchlistsReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_watchlists_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_watchlists_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - 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.ConnectionLog", b => - { - b.HasOne("Content.Server.Database.Server", "Server") - .WithMany("ConnectionLogs") - .HasForeignKey("ServerId") - .OnDelete(DeleteBehavior.SetNull) - .IsRequired() - .HasConstraintName("FK_connection_log_server_server_id"); - - b.OwnsOne("Content.Server.Database.TypedHwid", "HWId", b1 => - { - b1.Property("ConnectionLogId") - .HasColumnType("INTEGER") - .HasColumnName("connection_log_id"); - - b1.Property("Hwid") - .IsRequired() - .HasColumnType("BLOB") - .HasColumnName("hwid"); - - b1.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0) - .HasColumnName("hwid_type"); - - b1.HasKey("ConnectionLogId"); - - b1.ToTable("connection_log"); - - b1.WithOwner() - .HasForeignKey("ConnectionLogId") - .HasConstraintName("FK_connection_log_connection_log_connection_log_id"); - }); - - b.Navigation("HWId"); - - b.Navigation("Server"); - }); - - 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.Player", b => - { - b.OwnsOne("Content.Server.Database.TypedHwid", "LastSeenHWId", b1 => - { - b1.Property("PlayerId") - .HasColumnType("INTEGER") - .HasColumnName("player_id"); - - b1.Property("Hwid") - .IsRequired() - .HasColumnType("BLOB") - .HasColumnName("last_seen_hwid"); - - b1.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0) - .HasColumnName("last_seen_hwid_type"); - - b1.HasKey("PlayerId"); - - b1.ToTable("player"); - - b1.WithOwner() - .HasForeignKey("PlayerId") - .HasConstraintName("FK_player_player_player_id"); - }); - - b.Navigation("LastSeenHWId"); - }); - - 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.ProfileLoadout", b => - { - b.HasOne("Content.Server.Database.ProfileLoadoutGroup", "ProfileLoadoutGroup") - .WithMany("Loadouts") - .HasForeignKey("ProfileLoadoutGroupId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_profile_loadout_profile_loadout_group_profile_loadout_group_id"); - - b.Navigation("ProfileLoadoutGroup"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => - { - b.HasOne("Content.Server.Database.ProfileRoleLoadout", "ProfileRoleLoadout") - .WithMany("Groups") - .HasForeignKey("ProfileRoleLoadoutId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_profile_loadout_group_profile_role_loadout_profile_role_loadout_id"); - - b.Navigation("ProfileRoleLoadout"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => - { - b.HasOne("Content.Server.Database.Profile", "Profile") - .WithMany("Loadouts") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_profile_role_loadout_profile_profile_id"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("Content.Server.Database.RoleWhitelist", b => - { - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("JobWhitelists") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_role_whitelists_player_player_user_id"); - - b.Navigation("Player"); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.HasOne("Content.Server.Database.Server", "Server") - .WithMany("Rounds") - .HasForeignKey("ServerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_round_server_server_id"); - - b.Navigation("Server"); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBan", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminServerBansCreated") - .HasForeignKey("BanningAdmin") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_ban_player_banning_admin"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminServerBansLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_ban_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_server_ban_round_round_id"); - - b.OwnsOne("Content.Server.Database.TypedHwid", "HWId", b1 => - { - b1.Property("ServerBanId") - .HasColumnType("INTEGER") - .HasColumnName("server_ban_id"); - - b1.Property("Hwid") - .IsRequired() - .HasColumnType("BLOB") - .HasColumnName("hwid"); - - b1.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0) - .HasColumnName("hwid_type"); - - b1.HasKey("ServerBanId"); - - b1.ToTable("server_ban"); - - b1.WithOwner() - .HasForeignKey("ServerBanId") - .HasConstraintName("FK_server_ban_server_ban_server_ban_id"); - }); - - b.Navigation("CreatedBy"); - - b.Navigation("HWId"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Round"); - }); - - 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.ServerRoleBan", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminServerRoleBansCreated") - .HasForeignKey("BanningAdmin") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_role_ban_player_banning_admin"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminServerRoleBansLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_role_ban_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_server_role_ban_round_round_id"); - - b.OwnsOne("Content.Server.Database.TypedHwid", "HWId", b1 => - { - b1.Property("ServerRoleBanId") - .HasColumnType("INTEGER") - .HasColumnName("server_role_ban_id"); - - b1.Property("Hwid") - .IsRequired() - .HasColumnType("BLOB") - .HasColumnName("hwid"); - - b1.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0) - .HasColumnName("hwid_type"); - - b1.HasKey("ServerRoleBanId"); - - b1.ToTable("server_role_ban"); - - b1.WithOwner() - .HasForeignKey("ServerRoleBanId") - .HasConstraintName("FK_server_role_ban_server_role_ban_server_role_ban_id"); - }); - - b.Navigation("CreatedBy"); - - b.Navigation("HWId"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Round"); - }); - - 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("Content.Server.Database.Trait", b => - { - b.HasOne("Content.Server.Database.Profile", "Profile") - .WithMany("Traits") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_trait_profile_profile_id"); - - b.Navigation("Profile"); - }); - - 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("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"); - - b.Navigation("AdminMessagesCreated"); - - b.Navigation("AdminMessagesDeleted"); - - b.Navigation("AdminMessagesLastEdited"); - - b.Navigation("AdminMessagesReceived"); - - b.Navigation("AdminNotesCreated"); - - b.Navigation("AdminNotesDeleted"); - - b.Navigation("AdminNotesLastEdited"); - - b.Navigation("AdminNotesReceived"); - - b.Navigation("AdminServerBansCreated"); - - b.Navigation("AdminServerBansLastEdited"); - - b.Navigation("AdminServerRoleBansCreated"); - - b.Navigation("AdminServerRoleBansLastEdited"); - - b.Navigation("AdminWatchlistsCreated"); - - b.Navigation("AdminWatchlistsDeleted"); - - b.Navigation("AdminWatchlistsLastEdited"); - - b.Navigation("AdminWatchlistsReceived"); - - b.Navigation("JobWhitelists"); - }); - - modelBuilder.Entity("Content.Server.Database.Preference", b => - { - b.Navigation("Profiles"); - }); - - modelBuilder.Entity("Content.Server.Database.Profile", b => - { - b.Navigation("Antags"); - - b.Navigation("Jobs"); - - b.Navigation("Loadouts"); - - b.Navigation("Traits"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => - { - b.Navigation("Loadouts"); - }); - - modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => - { - b.Navigation("Groups"); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.Navigation("AdminLogs"); - }); - - modelBuilder.Entity("Content.Server.Database.Server", b => - { - b.Navigation("ConnectionLogs"); - - b.Navigation("Rounds"); - }); - - 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 - } - } -} diff --git a/Content.Server.Database/Migrations/Sqlite/20241111193602_ConnectionTrust.cs b/Content.Server.Database/Migrations/Sqlite/20241111193602_ConnectionTrust.cs deleted file mode 100644 index 3a7fd784e16..00000000000 --- a/Content.Server.Database/Migrations/Sqlite/20241111193602_ConnectionTrust.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Content.Server.Database.Migrations.Sqlite -{ - /// - public partial class ConnectionTrust : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "trust", - table: "connection_log", - type: "REAL", - nullable: false, - defaultValue: 0f); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "trust", - table: "connection_log"); - } - } -} diff --git a/Content.Server.Database/Migrations/Sqlite/20241222203134_UpstreamMerge.cs b/Content.Server.Database/Migrations/Sqlite/20241222203134_UpstreamMerge.cs index 8b5d3573763..8dfce026b56 100644 --- a/Content.Server.Database/Migrations/Sqlite/20241222203134_UpstreamMerge.cs +++ b/Content.Server.Database/Migrations/Sqlite/20241222203134_UpstreamMerge.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable @@ -10,39 +11,96 @@ public partial class UpstreamMerge : Migration /// protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.Sql("DROP TABLE IF EXISTS ProileLoadouts;"); - - migrationBuilder.AddForeignKey( - name: "FK_loadout_profile_profile_id", - table: "loadout", - column: "profile_id", - principalTable: "profile", - principalColumn: "profile_id", - onDelete: ReferentialAction.Cascade); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_loadout_profile_profile_id", - table: "loadout"); + migrationBuilder.AddColumn( + name: "last_read_rules", + table: "player", + type: "TEXT", + nullable: true); migrationBuilder.CreateTable( - name: "ProfileLoadout", + name: "ban_template", columns: table => new { - ProfileId = table.Column(type: "INTEGER", nullable: true) + ban_template_id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + title = table.Column(type: "TEXT", nullable: false), + length = table.Column(type: "TEXT", nullable: false), + reason = table.Column(type: "TEXT", nullable: false), + exempt_flags = table.Column(type: "INTEGER", nullable: false), + severity = table.Column(type: "INTEGER", nullable: false), + auto_delete = table.Column(type: "INTEGER", nullable: false), + hidden = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { - table.ForeignKey( - name: "FK_loadout_profile_profile_id", - column: x => x.ProfileId, - principalTable: "profile", - principalColumn: "profile_id", - onDelete: ReferentialAction.Cascade); + table.PrimaryKey("PK_ban_template", x => x.ban_template_id); }); + + migrationBuilder.AddColumn( + name: "hwid_type", + table: "server_role_ban", + type: "INTEGER", + nullable: true, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "hwid_type", + table: "server_ban", + type: "INTEGER", + nullable: true, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "last_seen_hwid_type", + table: "player", + type: "INTEGER", + nullable: true, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "hwid_type", + table: "connection_log", + type: "INTEGER", + nullable: true, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "trust", + table: "connection_log", + type: "REAL", + nullable: false, + defaultValue: 0f); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "last_read_rules", + table: "player"); + + migrationBuilder.DropTable( + name: "ban_template"); + + migrationBuilder.DropColumn( + name: "hwid_type", + table: "server_role_ban"); + + migrationBuilder.DropColumn( + name: "hwid_type", + table: "server_ban"); + + migrationBuilder.DropColumn( + name: "last_seen_hwid_type", + table: "player"); + + migrationBuilder.DropColumn( + name: "hwid_type", + table: "connection_log"); + + migrationBuilder.DropColumn( + name: "trust", + table: "connection_log"); } } }