Skip to content

Commit

Permalink
feat: add LevelPoints to Database
Browse files Browse the repository at this point in the history
  • Loading branch information
Thundernerd committed Oct 18, 2023
1 parent 6c4e905 commit 61f5437
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions GTRContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public GTRContext(DbContextOptions<GTRContext> options)

public virtual DbSet<Favorite> Favorites { get; set; }

public virtual DbSet<LevelPoints> LevelPoints { get; set; }

public virtual DbSet<Media> Media { get; set; }

public virtual DbSet<PersonalBest> PersonalBests { get; set; }
Expand Down Expand Up @@ -61,6 +63,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.HasConstraintName("favorites_user_foreign");
});

modelBuilder.Entity<LevelPoints>(entity => { entity.HasKey(e => e.Id).HasName("level_points_pkey"); });

modelBuilder.Entity<Media>(entity =>
{
entity.HasKey(e => e.Id).HasName("media_pkey");
Expand Down
10 changes: 10 additions & 0 deletions Models/LevelPoints.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.ComponentModel.DataAnnotations.Schema;

namespace TNRD.Zeepkist.GTR.Database.Models;

[Table("level_points")]
public class LevelPoints : ModelBase
{
[Column("level")] public string Level { get; set; } = null!;
[Column("points")] public int Points { get; set; }
}
2 changes: 1 addition & 1 deletion Zeepkist.GTR.Database.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Nullable>enable</Nullable>
<AssemblyName>TNRD.Zeepkist.GTR.Database</AssemblyName>
<RootNamespace>TNRD.Zeepkist.GTR.Database</RootNamespace>
<Version>2.6.0</Version>
<Version>2.7.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 61f5437

Please sign in to comment.