Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom ping role per project #117

Merged
merged 3 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions Asterion/Database/Models/ModrinthEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class ModrinthEntry
public virtual Array Array { get; set; } = null!;

public ulong? CustomUpdateChannel { get; set; }
public ulong? CustomPingRole { get; set; }

[Required] public string ProjectId { get; set; } = null!;

Expand Down
4 changes: 2 additions & 2 deletions Asterion/Interfaces/IDataService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,6 @@ public interface IDataService
/// <returns></returns>
public Task<bool> ChangeModrinthEntryChannel(ulong guildId, string projectId, ulong newChannelId);

public Task<bool> SetPingRoleAsync(ulong guildId, ulong? roleId);
public Task<ulong?> GetPingRoleIdAsync(ulong guildId);
public Task<bool> SetPingRoleAsync(ulong guildId, ulong? roleId, string? projectId = null);
public Task<ulong?> GetPingRoleIdAsync(ulong guildId, string? projectId = null);
}
312 changes: 312 additions & 0 deletions Asterion/Migrations/20240418182429_add custom ping role.Designer.cs

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

28 changes: 28 additions & 0 deletions Asterion/Migrations/20240418182429_add custom ping role.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Asterion.Migrations
{
/// <inheritdoc />
public partial class addcustompingrole : Migration

Check warning on line 8 in Asterion/Migrations/20240418182429_add custom ping role.cs

View workflow job for this annotation

GitHub Actions / build

The type name 'addcustompingrole' only contains lower-cased ascii characters. Such names may become reserved for the language.

Check warning on line 8 in Asterion/Migrations/20240418182429_add custom ping role.cs

View workflow job for this annotation

GitHub Actions / build

The type name 'addcustompingrole' only contains lower-cased ascii characters. Such names may become reserved for the language.
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<ulong>(
name: "CustomPingRole",
table: "ModrinthEntries",
type: "INTEGER",
nullable: true);
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CustomPingRole",
table: "ModrinthEntries");
}
}
}
5 changes: 4 additions & 1 deletion Asterion/Migrations/DataContextModelSnapshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ partial class DataContextModelSnapshot : ModelSnapshot
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "7.0.5");
modelBuilder.HasAnnotation("ProductVersion", "8.0.4");

modelBuilder.Entity("Asterion.Database.Models.Array", b =>
{
Expand Down Expand Up @@ -131,6 +131,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property<DateTime>("Created")
.HasColumnType("TEXT");

b.Property<ulong?>("CustomPingRole")
.HasColumnType("INTEGER");

b.Property<ulong?>("CustomUpdateChannel")
.HasColumnType("INTEGER");

Expand Down
Loading
Loading