Skip to content

Commit

Permalink
Add per-giveaway exclusion columns
Browse files Browse the repository at this point in the history
This change fundamentally breaks older versions, and therefore requires an EF migration or reset.
  • Loading branch information
oliverbooth committed Feb 19, 2023
1 parent c7ea91e commit 23002e9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Present/Data/EntityConfigurations/GiveawayConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public void Configure(EntityTypeBuilder<Giveaway> builder)
builder.Property(e => e.Description);
builder.Property(e => e.ImageUri).HasConversion<UriToStringConverter>();
builder.Property(e => e.Entrants).HasConversion<UInt64ListToBytesConverter>();
builder.Property(e => e.ExcludedRoles).HasConversion<UInt64ListToBytesConverter>();
builder.Property(e => e.ExcludedUsers).HasConversion<UInt64ListToBytesConverter>();
builder.Property(e => e.WinnerCount);
builder.Property(e => e.WinnerIds).HasConversion<UInt64ListToBytesConverter>();
builder.Property(e => e.MessageId);
Expand Down
12 changes: 12 additions & 0 deletions Present/Data/Giveaway.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ internal sealed class Giveaway : IEquatable<Giveaway>
/// <value>The end date and time.</value>
public DateTimeOffset EndTime { get; set; }

/// <summary>
/// Gets or sets the list of excluded role IDs for this giveaway.
/// </summary>
/// <value>A <see cref="List{T}" /> of <see cref="ulong" /> representing the excluded role IDs.</value>
public List<ulong> ExcludedRoles { get; set; } = new();

/// <summary>
/// Gets or sets the list of excluded user IDs for this giveaway.
/// </summary>
/// <value>A <see cref="List{T}" /> of <see cref="ulong" /> representing the excluded user IDs.</value>
public List<ulong> ExcludedUsers { get; set; } = new();

/// <summary>
/// Gets or sets the guild ID of the giveaway.
/// </summary>
Expand Down

0 comments on commit 23002e9

Please sign in to comment.