mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-05 12:51:27 +00:00
Rename Token to GameToken
This commit is contained in:
parent
bb4cecee2e
commit
d11309b027
48 changed files with 791 additions and 96 deletions
|
@ -30,7 +30,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
Slot? slot = await this.database.Slots.FirstOrDefaultAsync(s => s.SlotId == slotId);
|
||||
if (slot == null) return this.StatusCode(403, "");
|
||||
|
||||
Token? token = await this.database.TokenFromRequest(this.Request);
|
||||
GameToken? token = await this.database.TokenFromRequest(this.Request);
|
||||
if (token == null) return this.StatusCode(403, "");
|
||||
|
||||
GameVersion gameVersion = token.GameVersion;
|
||||
|
|
|
@ -69,13 +69,13 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
[HttpGet("myFriends")]
|
||||
public async Task<IActionResult> MyFriends()
|
||||
{
|
||||
(User, Token)? userAndToken = await this.database.UserAndTokenFromRequest(this.Request);
|
||||
(User, GameToken)? userAndToken = await this.database.UserAndTokenFromRequest(this.Request);
|
||||
|
||||
if (userAndToken == null) return this.StatusCode(403, "");
|
||||
|
||||
// ReSharper disable once PossibleInvalidOperationException
|
||||
User user = userAndToken.Value.Item1;
|
||||
Token token = userAndToken.Value.Item2;
|
||||
GameToken gameToken = userAndToken.Value.Item2;
|
||||
|
||||
if (!FriendHelper.FriendIdsByUserId.TryGetValue(user.UserId, out int[]? friendIds) || friendIds == null)
|
||||
{
|
||||
|
@ -88,7 +88,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
User? friend = await this.database.Users.Include(u => u.Location).FirstOrDefaultAsync(u => u.UserId == friendId);
|
||||
if (friend == null) continue;
|
||||
|
||||
friends += friend.Serialize(token.GameVersion);
|
||||
friends += friend.Serialize(gameToken.GameVersion);
|
||||
}
|
||||
|
||||
return this.Ok(LbpSerializer.StringElement("myFriends", friends));
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
[HttpGet("slots/lolcatftw/{username}")]
|
||||
public async Task<IActionResult> GetLevelQueue(string username, [FromQuery] int pageSize, [FromQuery] int pageStart)
|
||||
{
|
||||
Token? token = await this.database.TokenFromRequest(this.Request);
|
||||
GameToken? token = await this.database.TokenFromRequest(this.Request);
|
||||
if (token == null) return this.StatusCode(403, "");
|
||||
|
||||
GameVersion gameVersion = token.GameVersion;
|
||||
|
@ -110,7 +110,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
[HttpGet("favouriteSlots/{username}")]
|
||||
public async Task<IActionResult> GetFavouriteSlots(string username, [FromQuery] int pageSize, [FromQuery] int pageStart)
|
||||
{
|
||||
Token? token = await this.database.TokenFromRequest(this.Request);
|
||||
GameToken? token = await this.database.TokenFromRequest(this.Request);
|
||||
if (token == null) return this.StatusCode(403, "");
|
||||
|
||||
GameVersion gameVersion = token.GameVersion;
|
||||
|
@ -180,7 +180,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
[HttpGet("favouriteUsers/{username}")]
|
||||
public async Task<IActionResult> GetFavouriteUsers(string username, [FromQuery] int pageSize, [FromQuery] int pageStart)
|
||||
{
|
||||
Token? token = await this.database.TokenFromRequest(this.Request);
|
||||
GameToken? token = await this.database.TokenFromRequest(this.Request);
|
||||
if (token == null) return this.StatusCode(403, "");
|
||||
|
||||
IEnumerable<HeartedProfile> heartedProfiles = this.database.HeartedProfiles.Include
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
|
||||
string userLocation = ipAddress.ToString();
|
||||
|
||||
Token? token = await this.database.AuthenticateUser(loginData, userLocation, titleId);
|
||||
GameToken? token = await this.database.AuthenticateUser(loginData, userLocation, titleId);
|
||||
if (token == null) return this.StatusCode(403, "");
|
||||
|
||||
User? user = await this.database.UserFromToken(token);
|
||||
|
|
|
@ -32,13 +32,13 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
[Produces("text/plain")]
|
||||
public async Task<IActionResult> Match()
|
||||
{
|
||||
(User, Token)? userAndToken = await this.database.UserAndTokenFromRequest(this.Request);
|
||||
(User, GameToken)? userAndToken = await this.database.UserAndTokenFromRequest(this.Request);
|
||||
|
||||
if (userAndToken == null) return this.StatusCode(403, "");
|
||||
|
||||
// ReSharper disable once PossibleInvalidOperationException
|
||||
User user = userAndToken.Value.Item1;
|
||||
Token token = userAndToken.Value.Item2;
|
||||
GameToken gameToken = userAndToken.Value.Item2;
|
||||
|
||||
#region Parse match data
|
||||
|
||||
|
@ -97,7 +97,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
|
||||
if (matchData is UpdateMyPlayerData playerData)
|
||||
{
|
||||
MatchHelper.SetUserLocation(user.UserId, token.UserLocation);
|
||||
MatchHelper.SetUserLocation(user.UserId, gameToken.UserLocation);
|
||||
Room? room = RoomHelper.FindRoomByUser(user, true);
|
||||
|
||||
if (playerData.RoomState != null)
|
||||
|
@ -108,7 +108,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
|
||||
if (matchData is FindBestRoom && MatchHelper.UserLocations.Count > 1)
|
||||
{
|
||||
FindBestRoomResponse? response = RoomHelper.FindBestRoom(user, token.UserLocation);
|
||||
FindBestRoomResponse? response = RoomHelper.FindBestRoom(user, gameToken.UserLocation);
|
||||
|
||||
if (response == null) return this.NotFound();
|
||||
|
||||
|
|
|
@ -66,13 +66,13 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
public async Task<IActionResult> Publish()
|
||||
{
|
||||
// User user = await this.database.UserFromRequest(this.Request);
|
||||
(User, Token)? userAndToken = await this.database.UserAndTokenFromRequest(this.Request);
|
||||
(User, GameToken)? userAndToken = await this.database.UserAndTokenFromRequest(this.Request);
|
||||
|
||||
if (userAndToken == null) return this.StatusCode(403, "");
|
||||
|
||||
// ReSharper disable once PossibleInvalidOperationException
|
||||
User user = userAndToken.Value.Item1;
|
||||
Token token = userAndToken.Value.Item2;
|
||||
GameToken gameToken = userAndToken.Value.Item2;
|
||||
|
||||
Slot? slot = await this.GetSlotFromBody();
|
||||
if (slot == null || slot.Location == null) return this.BadRequest();
|
||||
|
@ -95,7 +95,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
slot.SlotId = oldSlot.SlotId;
|
||||
slot.FirstUploaded = oldSlot.FirstUploaded;
|
||||
slot.LastUpdated = TimeHelper.UnixTimeMilliseconds();
|
||||
slot.GameVersion = token.GameVersion;
|
||||
slot.GameVersion = gameToken.GameVersion;
|
||||
|
||||
this.database.Entry(oldSlot).CurrentValues.SetValues(slot);
|
||||
await this.database.SaveChangesAsync();
|
||||
|
@ -114,7 +114,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
slot.CreatorId = user.UserId;
|
||||
slot.FirstUploaded = TimeHelper.UnixTimeMilliseconds();
|
||||
slot.LastUpdated = TimeHelper.UnixTimeMilliseconds();
|
||||
slot.GameVersion = token.GameVersion;
|
||||
slot.GameVersion = gameToken.GameVersion;
|
||||
|
||||
if (slot.MinimumPlayers == 0 || slot.MaximumPlayers == 0)
|
||||
{
|
||||
|
|
|
@ -28,13 +28,13 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
[HttpPost("scoreboard/user/{id:int}")]
|
||||
public async Task<IActionResult> SubmitScore(int id, [FromQuery] bool lbp1 = false, [FromQuery] bool lbp2 = false, [FromQuery] bool lbp3 = false)
|
||||
{
|
||||
(User, Token)? userAndToken = await this.database.UserAndTokenFromRequest(this.Request);
|
||||
(User, GameToken)? userAndToken = await this.database.UserAndTokenFromRequest(this.Request);
|
||||
|
||||
if (userAndToken == null) return this.StatusCode(403, "");
|
||||
|
||||
// ReSharper disable once PossibleInvalidOperationException
|
||||
User user = userAndToken.Value.Item1;
|
||||
Token token = userAndToken.Value.Item2;
|
||||
GameToken gameToken = userAndToken.Value.Item2;
|
||||
|
||||
this.Request.Body.Position = 0;
|
||||
string bodyString = await new StreamReader(this.Request.Body).ReadToEndAsync();
|
||||
|
@ -48,7 +48,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
Slot? slot = this.database.Slots.FirstOrDefault(s => s.SlotId == score.SlotId);
|
||||
if (slot == null) return this.BadRequest();
|
||||
|
||||
switch (token.GameVersion)
|
||||
switch (gameToken.GameVersion)
|
||||
{
|
||||
case GameVersion.LittleBigPlanet1:
|
||||
slot.PlaysLBP1Complete++;
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
[HttpGet("slots/by")]
|
||||
public async Task<IActionResult> SlotsBy([FromQuery] string u, [FromQuery] int pageStart, [FromQuery] int pageSize)
|
||||
{
|
||||
Token? token = await this.database.TokenFromRequest(this.Request);
|
||||
GameToken? token = await this.database.TokenFromRequest(this.Request);
|
||||
if (token == null) return this.StatusCode(403, "");
|
||||
|
||||
GameVersion gameVersion = token.GameVersion;
|
||||
|
@ -71,7 +71,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
User? user = await this.database.UserFromRequest(this.Request);
|
||||
if (user == null) return this.StatusCode(403, "");
|
||||
|
||||
Token? token = await this.database.TokenFromRequest(this.Request);
|
||||
GameToken? token = await this.database.TokenFromRequest(this.Request);
|
||||
if (token == null) return this.StatusCode(403, "");
|
||||
|
||||
GameVersion gameVersion = token.GameVersion;
|
||||
|
@ -95,7 +95,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
[HttpGet("slots")]
|
||||
public async Task<IActionResult> NewestSlots([FromQuery] int pageStart, [FromQuery] int pageSize)
|
||||
{
|
||||
Token? token = await this.database.TokenFromRequest(this.Request);
|
||||
GameToken? token = await this.database.TokenFromRequest(this.Request);
|
||||
if (token == null) return this.StatusCode(403, "");
|
||||
|
||||
GameVersion gameVersion = token.GameVersion;
|
||||
|
@ -114,7 +114,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
[HttpGet("slots/mmpicks")]
|
||||
public async Task<IActionResult> TeamPickedSlots([FromQuery] int pageStart, [FromQuery] int pageSize)
|
||||
{
|
||||
Token? token = await this.database.TokenFromRequest(this.Request);
|
||||
GameToken? token = await this.database.TokenFromRequest(this.Request);
|
||||
if (token == null) return this.StatusCode(403, "");
|
||||
|
||||
GameVersion gameVersion = token.GameVersion;
|
||||
|
@ -134,7 +134,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
[HttpGet("slots/lbp2luckydip")]
|
||||
public async Task<IActionResult> LuckyDipSlots([FromQuery] int pageStart, [FromQuery] int pageSize, [FromQuery] int seed)
|
||||
{
|
||||
Token? token = await this.database.TokenFromRequest(this.Request);
|
||||
GameToken? token = await this.database.TokenFromRequest(this.Request);
|
||||
if (token == null) return this.StatusCode(403, "");
|
||||
|
||||
GameVersion gameVersion = token.GameVersion;
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
[HttpGet("user/{username}")]
|
||||
public async Task<IActionResult> GetUser(string username)
|
||||
{
|
||||
Token? token = await this.database.TokenFromRequest(this.Request);
|
||||
GameToken? token = await this.database.TokenFromRequest(this.Request);
|
||||
if (token == null) return this.StatusCode(403, "");
|
||||
|
||||
string? user = await this.GetSerializedUser(username, token.GameVersion);
|
||||
|
@ -47,7 +47,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
[HttpGet("users")]
|
||||
public async Task<IActionResult> GetUserAlt([FromQuery] string[] u)
|
||||
{
|
||||
Token? token = await this.database.TokenFromRequest(this.Request);
|
||||
GameToken? token = await this.database.TokenFromRequest(this.Request);
|
||||
if (token == null) return this.StatusCode(403, "");
|
||||
|
||||
List<string?> serializedUsers = new();
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace LBPUnion.ProjectLighthouse
|
|||
public DbSet<HeartedLevel> HeartedLevels { get; set; }
|
||||
public DbSet<HeartedProfile> HeartedProfiles { get; set; }
|
||||
public DbSet<Comment> Comments { get; set; }
|
||||
public DbSet<Token> Tokens { get; set; }
|
||||
public DbSet<GameToken> GameTokens { get; set; }
|
||||
public DbSet<Score> Scores { get; set; }
|
||||
public DbSet<PhotoSubject> PhotoSubjects { get; set; }
|
||||
public DbSet<Photo> Photos { get; set; }
|
||||
|
@ -59,13 +59,13 @@ namespace LBPUnion.ProjectLighthouse
|
|||
}
|
||||
|
||||
#nullable enable
|
||||
public async Task<Token?> AuthenticateUser(LoginData loginData, string userLocation, string titleId = "")
|
||||
public async Task<GameToken?> AuthenticateUser(LoginData loginData, string userLocation, string titleId = "")
|
||||
{
|
||||
// TODO: don't use psn name to authenticate
|
||||
User? user = await this.Users.FirstOrDefaultAsync(u => u.Username == loginData.Username);
|
||||
if (user == null) return null;
|
||||
|
||||
Token token = new()
|
||||
GameToken gameToken = new()
|
||||
{
|
||||
UserToken = HashHelper.GenerateAuthToken(),
|
||||
UserId = user.UserId,
|
||||
|
@ -73,27 +73,27 @@ namespace LBPUnion.ProjectLighthouse
|
|||
GameVersion = GameVersionHelper.FromTitleId(titleId),
|
||||
};
|
||||
|
||||
if (token.GameVersion == GameVersion.Unknown)
|
||||
if (gameToken.GameVersion == GameVersion.Unknown)
|
||||
{
|
||||
Logger.Log($"Unknown GameVersion for TitleId {titleId}", LoggerLevelLogin.Instance);
|
||||
return null;
|
||||
}
|
||||
|
||||
this.Tokens.Add(token);
|
||||
this.GameTokens.Add(gameToken);
|
||||
await this.SaveChangesAsync();
|
||||
|
||||
return token;
|
||||
return gameToken;
|
||||
}
|
||||
|
||||
public async Task<User?> UserFromAuthToken(string authToken)
|
||||
{
|
||||
Token? token = await this.Tokens.FirstOrDefaultAsync(t => t.UserToken == authToken);
|
||||
GameToken? token = await this.GameTokens.FirstOrDefaultAsync(t => t.UserToken == authToken);
|
||||
if (token == null) return null;
|
||||
|
||||
return await this.Users.Include(u => u.Location).FirstOrDefaultAsync(u => u.UserId == token.UserId);
|
||||
}
|
||||
|
||||
public async Task<User?> UserFromToken(Token token) => await this.UserFromAuthToken(token.UserToken);
|
||||
public async Task<User?> UserFromToken(GameToken gameToken) => await this.UserFromAuthToken(gameToken.UserToken);
|
||||
|
||||
public async Task<User?> UserFromRequest(HttpRequest request)
|
||||
{
|
||||
|
@ -102,18 +102,18 @@ namespace LBPUnion.ProjectLighthouse
|
|||
return await this.UserFromAuthToken(mmAuth);
|
||||
}
|
||||
|
||||
public async Task<Token?> TokenFromRequest(HttpRequest request)
|
||||
public async Task<GameToken?> TokenFromRequest(HttpRequest request)
|
||||
{
|
||||
if (!request.Cookies.TryGetValue("MM_AUTH", out string? mmAuth) || mmAuth == null) return null;
|
||||
|
||||
return await this.Tokens.FirstOrDefaultAsync(t => t.UserToken == mmAuth);
|
||||
return await this.GameTokens.FirstOrDefaultAsync(t => t.UserToken == mmAuth);
|
||||
}
|
||||
|
||||
public async Task<(User, Token)?> UserAndTokenFromRequest(HttpRequest request)
|
||||
public async Task<(User, GameToken)?> UserAndTokenFromRequest(HttpRequest request)
|
||||
{
|
||||
if (!request.Cookies.TryGetValue("MM_AUTH", out string? mmAuth) || mmAuth == null) return null;
|
||||
|
||||
Token? token = await this.Tokens.FirstOrDefaultAsync(t => t.UserToken == mmAuth);
|
||||
GameToken? token = await this.GameTokens.FirstOrDefaultAsync(t => t.UserToken == mmAuth);
|
||||
if (token == null) return null;
|
||||
|
||||
User? user = await this.UserFromToken(token);
|
||||
|
|
|
@ -154,7 +154,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Slots");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -175,7 +175,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Slots");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -189,7 +189,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Slots");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -189,7 +189,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Slots");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -208,7 +208,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Locations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -211,7 +211,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Locations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -214,7 +214,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Locations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -214,7 +214,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Locations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -217,7 +217,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Locations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -242,7 +242,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Scores");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -242,7 +242,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Scores");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -242,7 +242,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Scores");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -242,7 +242,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Scores");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -245,7 +245,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Scores");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -293,7 +293,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Scores");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -303,7 +303,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Scores");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -298,7 +298,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Scores");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -293,7 +293,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Scores");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -298,7 +298,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Scores");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -303,7 +303,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Scores");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -303,7 +303,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Scores");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -306,7 +306,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Scores");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -306,7 +306,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Scores");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -330,7 +330,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Scores");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -354,7 +354,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Scores");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -381,7 +381,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Scores");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -384,7 +384,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Scores");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -384,7 +384,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Scores");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -401,7 +401,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Scores");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -398,7 +398,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Scores");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -384,7 +384,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Scores");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -400,7 +400,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Scores");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -412,7 +412,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Scores");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
|
@ -412,7 +412,7 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Scores");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
|
654
ProjectLighthouse/Migrations/20211120052549_RenameTokensToGameTokens.Designer.cs
generated
Normal file
654
ProjectLighthouse/Migrations/20211120052549_RenameTokensToGameTokens.Designer.cs
generated
Normal file
|
@ -0,0 +1,654 @@
|
|||
// <auto-generated />
|
||||
using LBPUnion.ProjectLighthouse;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ProjectLighthouse.Migrations
|
||||
{
|
||||
[DbContext(typeof(Database))]
|
||||
[Migration("20211120052549_RenameTokensToGameTokens")]
|
||||
partial class RenameTokensToGameTokens
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "6.0.0")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("GameVersion")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("UserId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("UserLocation")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("UserToken")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.HasKey("TokenId");
|
||||
|
||||
b.ToTable("GameTokens");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.HeartedProfile", b =>
|
||||
{
|
||||
b.Property<int>("HeartedProfileId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("HeartedUserId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("UserId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("HeartedProfileId");
|
||||
|
||||
b.HasIndex("HeartedUserId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("HeartedProfiles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Levels.HeartedLevel", b =>
|
||||
{
|
||||
b.Property<int>("HeartedLevelId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SlotId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("UserId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("HeartedLevelId");
|
||||
|
||||
b.HasIndex("SlotId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("HeartedLevels");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Levels.QueuedLevel", b =>
|
||||
{
|
||||
b.Property<int>("QueuedLevelId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SlotId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("UserId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("QueuedLevelId");
|
||||
|
||||
b.HasIndex("SlotId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("QueuedLevels");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Levels.RatedLevel", b =>
|
||||
{
|
||||
b.Property<int>("RatedLevelId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Rating")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<double>("RatingLBP1")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<int>("SlotId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("UserId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("RatedLevelId");
|
||||
|
||||
b.HasIndex("SlotId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("RatedLevels");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Levels.Slot", b =>
|
||||
{
|
||||
b.Property<int>("SlotId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("AuthorLabels")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("BackgroundHash")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<int>("CreatorId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<long>("FirstUploaded")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<int>("GameVersion")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("IconHash")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<bool>("InitiallyLocked")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<long>("LastUpdated")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<bool>("Lbp1Only")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<string>("LevelType")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<int>("LocationId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("MaximumPlayers")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("MinimumPlayers")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("MoveRequired")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<int>("PlaysLBP1")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("PlaysLBP1Complete")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("PlaysLBP1Unique")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("PlaysLBP2")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("PlaysLBP2Complete")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("PlaysLBP2Unique")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("PlaysLBP3")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("PlaysLBP3Complete")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("PlaysLBP3Unique")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("PlaysLBPVita")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("PlaysLBPVitaComplete")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("PlaysLBPVitaUnique")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ResourceCollection")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("RootLevel")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<int>("Shareable")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("SubLevel")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<bool>("TeamPick")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.HasKey("SlotId");
|
||||
|
||||
b.HasIndex("CreatorId");
|
||||
|
||||
b.HasIndex("LocationId");
|
||||
|
||||
b.ToTable("Slots");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Levels.VisitedLevel", b =>
|
||||
{
|
||||
b.Property<int>("VisitedLevelId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("PlaysLBP1")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("PlaysLBP2")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("PlaysLBP3")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("PlaysLBPVita")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SlotId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("UserId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("VisitedLevelId");
|
||||
|
||||
b.HasIndex("SlotId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("VisitedLevels");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Photo", b =>
|
||||
{
|
||||
b.Property<int>("PhotoId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("CreatorId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("LargeHash")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("MediumHash")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("PhotoSubjectCollection")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("PlanHash")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("SmallHash")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<long>("Timestamp")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.HasKey("PhotoId");
|
||||
|
||||
b.HasIndex("CreatorId");
|
||||
|
||||
b.ToTable("Photos");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.PhotoSubject", b =>
|
||||
{
|
||||
b.Property<int>("PhotoSubjectId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Bounds")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<int>("UserId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("PhotoSubjectId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("PhotoSubjects");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Profiles.Comment", b =>
|
||||
{
|
||||
b.Property<int>("CommentId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Message")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<int>("PosterUserId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("TargetUserId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ThumbsDown")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ThumbsUp")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<long>("Timestamp")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.HasKey("CommentId");
|
||||
|
||||
b.HasIndex("PosterUserId");
|
||||
|
||||
b.HasIndex("TargetUserId");
|
||||
|
||||
b.ToTable("Comments");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Profiles.LastMatch", b =>
|
||||
{
|
||||
b.Property<int>("UserId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<long>("Timestamp")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.HasKey("UserId");
|
||||
|
||||
b.ToTable("LastMatches");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Profiles.Location", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("X")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Y")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Locations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Score", b =>
|
||||
{
|
||||
b.Property<int>("ScoreId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("PlayerIdCollection")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<int>("Points")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SlotId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ScoreId");
|
||||
|
||||
b.HasIndex("SlotId");
|
||||
|
||||
b.ToTable("Scores");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.User", b =>
|
||||
{
|
||||
b.Property<int>("UserId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Biography")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<int>("Game")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("IconHash")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<int>("LocationId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("Pins")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("PlanetHash")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("Username")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.HasKey("UserId");
|
||||
|
||||
b.HasIndex("LocationId");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.HeartedProfile", b =>
|
||||
{
|
||||
b.HasOne("LBPUnion.ProjectLighthouse.Types.User", "HeartedUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("HeartedUserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("LBPUnion.ProjectLighthouse.Types.User", "User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("HeartedUser");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Levels.HeartedLevel", b =>
|
||||
{
|
||||
b.HasOne("LBPUnion.ProjectLighthouse.Types.Levels.Slot", "Slot")
|
||||
.WithMany()
|
||||
.HasForeignKey("SlotId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("LBPUnion.ProjectLighthouse.Types.User", "User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Slot");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Levels.QueuedLevel", b =>
|
||||
{
|
||||
b.HasOne("LBPUnion.ProjectLighthouse.Types.Levels.Slot", "Slot")
|
||||
.WithMany()
|
||||
.HasForeignKey("SlotId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("LBPUnion.ProjectLighthouse.Types.User", "User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Slot");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Levels.RatedLevel", b =>
|
||||
{
|
||||
b.HasOne("LBPUnion.ProjectLighthouse.Types.Levels.Slot", "Slot")
|
||||
.WithMany()
|
||||
.HasForeignKey("SlotId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("LBPUnion.ProjectLighthouse.Types.User", "User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Slot");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Levels.Slot", b =>
|
||||
{
|
||||
b.HasOne("LBPUnion.ProjectLighthouse.Types.User", "Creator")
|
||||
.WithMany()
|
||||
.HasForeignKey("CreatorId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("LBPUnion.ProjectLighthouse.Types.Profiles.Location", "Location")
|
||||
.WithMany()
|
||||
.HasForeignKey("LocationId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Creator");
|
||||
|
||||
b.Navigation("Location");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Levels.VisitedLevel", b =>
|
||||
{
|
||||
b.HasOne("LBPUnion.ProjectLighthouse.Types.Levels.Slot", "Slot")
|
||||
.WithMany()
|
||||
.HasForeignKey("SlotId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("LBPUnion.ProjectLighthouse.Types.User", "User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Slot");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Photo", b =>
|
||||
{
|
||||
b.HasOne("LBPUnion.ProjectLighthouse.Types.User", "Creator")
|
||||
.WithMany()
|
||||
.HasForeignKey("CreatorId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Creator");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.PhotoSubject", b =>
|
||||
{
|
||||
b.HasOne("LBPUnion.ProjectLighthouse.Types.User", "User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Profiles.Comment", b =>
|
||||
{
|
||||
b.HasOne("LBPUnion.ProjectLighthouse.Types.User", "Poster")
|
||||
.WithMany()
|
||||
.HasForeignKey("PosterUserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("LBPUnion.ProjectLighthouse.Types.User", "Target")
|
||||
.WithMany()
|
||||
.HasForeignKey("TargetUserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Poster");
|
||||
|
||||
b.Navigation("Target");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Score", b =>
|
||||
{
|
||||
b.HasOne("LBPUnion.ProjectLighthouse.Types.Levels.Slot", "Slot")
|
||||
.WithMany()
|
||||
.HasForeignKey("SlotId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Slot");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.User", b =>
|
||||
{
|
||||
b.HasOne("LBPUnion.ProjectLighthouse.Types.Profiles.Location", "Location")
|
||||
.WithMany()
|
||||
.HasForeignKey("LocationId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Location");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ProjectLighthouse.Migrations
|
||||
{
|
||||
public partial class RenameTokensToGameTokens : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_Tokens",
|
||||
table: "Tokens");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "Tokens",
|
||||
newName: "GameTokens");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_GameTokens",
|
||||
table: "GameTokens",
|
||||
column: "TokenId");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_GameTokens",
|
||||
table: "GameTokens");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "GameTokens",
|
||||
newName: "Tokens");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_Tokens",
|
||||
table: "Tokens",
|
||||
column: "TokenId");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -18,6 +18,29 @@ namespace ProjectLighthouse.Migrations
|
|||
.HasAnnotation("ProductVersion", "6.0.0")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.GameToken", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("GameVersion")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("UserId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("UserLocation")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("UserToken")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.HasKey("TokenId");
|
||||
|
||||
b.ToTable("GameTokens");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.HeartedProfile", b =>
|
||||
{
|
||||
b.Property<int>("HeartedProfileId")
|
||||
|
@ -410,29 +433,6 @@ namespace ProjectLighthouse.Migrations
|
|||
b.ToTable("Scores");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b =>
|
||||
{
|
||||
b.Property<int>("TokenId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("GameVersion")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("UserId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("UserLocation")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("UserToken")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.HasKey("TokenId");
|
||||
|
||||
b.ToTable("Tokens");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.User", b =>
|
||||
{
|
||||
b.Property<int>("UserId")
|
||||
|
|
|
@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations;
|
|||
|
||||
namespace LBPUnion.ProjectLighthouse.Types
|
||||
{
|
||||
public class Token
|
||||
public class GameToken
|
||||
{
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
[Key]
|
Loading…
Add table
Add a link
Reference in a new issue