Games have icon and logo

This commit is contained in:
2025-05-26 17:02:13 +02:00
parent 89a0dc1bc2
commit e11390f632
6 changed files with 229 additions and 5 deletions

View File

@ -0,0 +1,154 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using SQLiteEF;
#nullable disable
namespace API.Migrations
{
[DbContext(typeof(Context))]
[Migration("20250526144942_Game-Logo-and-Icon")]
partial class GameLogoandIcon
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "9.0.5");
modelBuilder.Entity("GamePlayer", b =>
{
b.Property<ulong>("GamesAppId")
.HasColumnType("INTEGER");
b.Property<ulong>("PlayedBySteamId")
.HasColumnType("INTEGER");
b.HasKey("GamesAppId", "PlayedBySteamId");
b.HasIndex("PlayedBySteamId");
b.ToTable("GamePlayer");
});
modelBuilder.Entity("SQLiteEF.Game", b =>
{
b.Property<ulong>("AppId")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("IconUrl")
.HasColumnType("TEXT");
b.Property<string>("LogoUrl")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("AppId");
b.ToTable("Games");
});
modelBuilder.Entity("SQLiteEF.Player", b =>
{
b.Property<ulong>("SteamId")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("AvatarUrl")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("ProfileUrl")
.IsRequired()
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("TEXT");
b.HasKey("SteamId");
b.ToTable("Players");
});
modelBuilder.Entity("SQLiteEF.TrackedTime", b =>
{
b.Property<DateTime>("TimeStamp")
.HasColumnType("TEXT");
b.Property<ulong>("GameAppId")
.HasColumnType("INTEGER");
b.Property<ulong>("PlayerSteamId")
.HasColumnType("INTEGER");
b.Property<ulong>("TimePlayed")
.HasColumnType("INTEGER");
b.HasKey("TimeStamp");
b.HasIndex("GameAppId");
b.HasIndex("PlayerSteamId");
b.ToTable("TrackedTime");
});
modelBuilder.Entity("GamePlayer", b =>
{
b.HasOne("SQLiteEF.Game", null)
.WithMany()
.HasForeignKey("GamesAppId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("SQLiteEF.Player", null)
.WithMany()
.HasForeignKey("PlayedBySteamId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("SQLiteEF.TrackedTime", b =>
{
b.HasOne("SQLiteEF.Game", "Game")
.WithMany("TrackedTimes")
.HasForeignKey("GameAppId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("SQLiteEF.Player", "Player")
.WithMany("TrackedTimes")
.HasForeignKey("PlayerSteamId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Game");
b.Navigation("Player");
});
modelBuilder.Entity("SQLiteEF.Game", b =>
{
b.Navigation("TrackedTimes");
});
modelBuilder.Entity("SQLiteEF.Player", b =>
{
b.Navigation("TrackedTimes");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,38 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace API.Migrations
{
/// <inheritdoc />
public partial class GameLogoandIcon : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "IconUrl",
table: "Games",
type: "TEXT",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "LogoUrl",
table: "Games",
type: "TEXT",
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IconUrl",
table: "Games");
migrationBuilder.DropColumn(
name: "LogoUrl",
table: "Games");
}
}
}

View File

@ -38,6 +38,12 @@ namespace API.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("IconUrl")
.HasColumnType("TEXT");
b.Property<string>("LogoUrl")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");