-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
223 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
37 changes: 29 additions & 8 deletions
37
...0231122013527_AddScoreAliases.Designer.cs → ...0231231232112_AddScoreAliases.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace huisbot.Migrations | ||
{ | ||
/// <inheritdoc /> | ||
public partial class AddScoreAliases : Migration | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.RenameColumn( | ||
name: "id", | ||
table: "beatmap_aliases", | ||
newName: "beatmap_id"); | ||
|
||
migrationBuilder.CreateTable( | ||
name: "score_aliases", | ||
columns: table => new | ||
{ | ||
alias = table.Column<string>(type: "TEXT", nullable: false), | ||
score_id = table.Column<long>(type: "INTEGER", nullable: false), | ||
display_name = table.Column<string>(type: "TEXT", nullable: false) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("pk_score_aliases", x => x.alias); | ||
}); | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "score_aliases"); | ||
|
||
migrationBuilder.RenameColumn( | ||
name: "beatmap_id", | ||
table: "beatmap_aliases", | ||
newName: "id"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace huisbot.Models.Utility; | ||
|
||
/// <summary> | ||
/// Represents an alias to be used instead of a beatmap ID in order to provide easier access. | ||
/// </summary> | ||
public class BeatmapAlias | ||
{ | ||
/// <summary> | ||
/// The unique alias. | ||
/// </summary> | ||
[Key] | ||
public string Alias { get; set; } | ||
|
||
/// <summary> | ||
/// The beatmap ID the alias represents. | ||
/// </summary> | ||
public long BeatmapId { get; set; } | ||
|
||
/// <summary> | ||
/// The display name of the object associated with the beatmap ID, used for display purposes. | ||
/// </summary> | ||
public string DisplayName { get; set; } | ||
|
||
/// <summary> | ||
/// Creates a new <see cref="BeatmapAlias"/> object with the specified beatmap ID, alias for it and display name. | ||
/// </summary> | ||
/// <param name="alias">The alias.</param> | ||
/// <param name="beatmapId">The beatmap ID the alias represents.</param> | ||
/// <param name="displayName">The display name of the beatmap.</param> | ||
public BeatmapAlias(string alias, long beatmapId, string displayName) | ||
{ | ||
Alias = alias; | ||
BeatmapId = beatmapId; | ||
DisplayName = displayName; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace huisbot.Models.Utility; | ||
|
||
/// <summary> | ||
/// Represents an alias to be used instead of a score ID in order to provide easier access. | ||
/// </summary> | ||
public class ScoreAlias | ||
{ | ||
/// <summary> | ||
/// The unique alias. | ||
/// </summary> | ||
[Key] | ||
public string Alias { get; set; } | ||
|
||
/// <summary> | ||
/// The score ID the alias represents. | ||
/// </summary> | ||
public long ScoreId { get; set; } | ||
|
||
/// <summary> | ||
/// The display name of the object associated with the score ID, used for display purposes. | ||
/// </summary> | ||
public string DisplayName { get; set; } | ||
|
||
/// <summary> | ||
/// Creates a new <see cref="ScoreAlias"/> object with the specified score ID, alias for it and display name. | ||
/// </summary> | ||
/// <param name="alias">The alias.</param> | ||
/// <param name="scoreId">The score ID the alias represents.</param> | ||
/// <param name="displayName">The display name of the score.</param> | ||
public ScoreAlias(string alias, long scoreId, string displayName) | ||
{ | ||
Alias = alias; | ||
ScoreId = scoreId; | ||
DisplayName = displayName; | ||
} | ||
} |
Oops, something went wrong.