Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions SS14.ServerHub.Shared/Data/TrackedCommunity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,39 @@ public sealed class TrackedCommunity
/// ID of this entity in the database.
/// </summary>
public int Id { get; set; }

/// <summary>
/// The name of this community, as displayed throughout the UI to admins.
/// </summary>
public string Name { get; set; } = default!;

/// <summary>
/// Any useful notes admins may want to store about this community.
/// </summary>
public string Notes { get; set; } = default!;

/// <summary>
/// The time this community was created by an admin.
/// </summary>
public DateTime Created { get; set; }

/// <summary>
/// The last time any information for this community was updated by an admin.
/// </summary>
public DateTime LastUpdated { get; set; }

/// <summary>
/// This community is banned, and server advertisements should be disallowed.
/// </summary>
public bool IsBanned { get; set; }

/// <summary>
/// This community is except from only advertising a limited amount of servers from one IP address
/// </summary>
public bool IsExemptFromMaxAdvertisements { get; set; }

// Navigation properties
public List<TrackedCommunityAddress> Addresses { get; set; } = default!;
public List<TrackedCommunityDomain> Domains { get; set; } = default!;
public List<TrackedCommunityInfoMatch> InfoMatches { get; set; } = default!;
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions SS14.ServerHub.Shared/Migrations/20250929215222_MaxAdvertIP.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace SS14.ServerHub.Shared.Migrations
{
public partial class MaxAdvertIP : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsExemptFromMaxAdvertisements",
table: "TrackedCommunity",
type: "boolean",
nullable: false,
defaultValue: false);
}

protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsExemptFromMaxAdvertisements",
table: "TrackedCommunity");
}
}
}
3 changes: 3 additions & 0 deletions SS14.ServerHub.Shared/Migrations/HubDbContextModelSnapshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property<bool>("IsBanned")
.HasColumnType("boolean");

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

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

Expand Down
Loading