From d11309b027fa5288bec75b44b2c92bcdb5df1a1f Mon Sep 17 00:00:00 2001 From: jvyden Date: Sat, 20 Nov 2021 00:27:39 -0500 Subject: [PATCH] Rename Token to GameToken --- .../Controllers/EnterLevelController.cs | 2 +- .../Controllers/FriendsController.cs | 6 +- .../Controllers/ListController.cs | 6 +- .../Controllers/LoginController.cs | 2 +- .../Controllers/MatchController.cs | 8 +- .../Controllers/PublishController.cs | 8 +- .../Controllers/ScoreController.cs | 6 +- .../Controllers/SlotsController.cs | 10 +- .../Controllers/UserController.cs | 4 +- ProjectLighthouse/Database.cs | 24 +- .../20211019021627_InitialCreate.Designer.cs | 2 +- .../20211019031221_HeartedLevels.Designer.cs | 2 +- .../20211019203627_LastMatches.Designer.cs | 2 +- .../20211020220840_ResourceList.Designer.cs | 2 +- .../20211026010814_FavouriteUsers.Designer.cs | 2 +- ...0211028015915_AddSlotTimestamp.Designer.cs | 2 +- ...lotFirstUploadedAndLastUpdated.Designer.cs | 2 +- ...29213334_RemoveUsedSlotsFromDb.Designer.cs | 2 +- ...20211030203837_AddMMPickToSlot.Designer.cs | 2 +- .../20211031234245_AddScoresTable.Designer.cs | 2 +- .../20211102215859_RenameTeamPick.Designer.cs | 2 +- ...194917_RemoveStartupMigrations.Designer.cs | 2 +- ...04031327_AddGameVersionToToken.Designer.cs | 2 +- ...04040509_AddGameVersionToSlots.Designer.cs | 2 +- ...20211104195812_AddPhotoSupport.Designer.cs | 2 +- ...PhotoSubjectToDoStuffWeirdName.Designer.cs | 2 +- ...39_DropPhotoSubjectParentPhoto.Designer.cs | 2 +- .../20211105205749_DropPhotoSlot.Designer.cs | 2 +- ...211106010424_AddCreatorToPhoto.Designer.cs | 2 +- ...452_NoPhotosByMeOrWithMeInUser.Designer.cs | 2 +- ...08013443_RemoveCommentsEnabled.Designer.cs | 2 +- .../20211108015422_AddPlaysToSlot.Designer.cs | 2 +- ...54552_RemoveCountsFromDatabase.Designer.cs | 2 +- ...8093616_GameSpecificPlayCounts.Designer.cs | 2 +- ...11108114052_VisitedLevelsTable.Designer.cs | 2 +- ...0211108212022_BooYayRateLevels.Designer.cs | 2 +- ...11109225543_AddLevelTypeToSlot.Designer.cs | 2 +- ...3091631_AddUserLocationToToken.Designer.cs | 2 +- ...3215128_VisitedLevelPlayCounts.Designer.cs | 2 +- ...06_VisitedLevelDropGameVersion.Designer.cs | 2 +- .../20211114231343_UserRefactor.Designer.cs | 2 +- ...erAddDefaultsToNullableStrings.Designer.cs | 2 +- ...1115052941_SlotAddLbpVitaPlays.Designer.cs | 2 +- ...211120045239_AddPasswordToUser.Designer.cs | 2 +- ...52549_RenameTokensToGameTokens.Designer.cs | 654 ++++++++++++++++++ ...20211120052549_RenameTokensToGameTokens.cs | 41 ++ .../Migrations/DatabaseModelSnapshot.cs | 46 +- .../Types/{Token.cs => GameToken.cs} | 2 +- 48 files changed, 791 insertions(+), 96 deletions(-) create mode 100644 ProjectLighthouse/Migrations/20211120052549_RenameTokensToGameTokens.Designer.cs create mode 100644 ProjectLighthouse/Migrations/20211120052549_RenameTokensToGameTokens.cs rename ProjectLighthouse/Types/{Token.cs => GameToken.cs} (93%) diff --git a/ProjectLighthouse/Controllers/EnterLevelController.cs b/ProjectLighthouse/Controllers/EnterLevelController.cs index fc46d90b..de4d4e0a 100644 --- a/ProjectLighthouse/Controllers/EnterLevelController.cs +++ b/ProjectLighthouse/Controllers/EnterLevelController.cs @@ -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; diff --git a/ProjectLighthouse/Controllers/FriendsController.cs b/ProjectLighthouse/Controllers/FriendsController.cs index e4b2ef6a..34648a1b 100644 --- a/ProjectLighthouse/Controllers/FriendsController.cs +++ b/ProjectLighthouse/Controllers/FriendsController.cs @@ -69,13 +69,13 @@ namespace LBPUnion.ProjectLighthouse.Controllers [HttpGet("myFriends")] public async Task 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)); diff --git a/ProjectLighthouse/Controllers/ListController.cs b/ProjectLighthouse/Controllers/ListController.cs index f4139dc1..8c01c333 100644 --- a/ProjectLighthouse/Controllers/ListController.cs +++ b/ProjectLighthouse/Controllers/ListController.cs @@ -29,7 +29,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers [HttpGet("slots/lolcatftw/{username}")] public async Task 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 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 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 heartedProfiles = this.database.HeartedProfiles.Include diff --git a/ProjectLighthouse/Controllers/LoginController.cs b/ProjectLighthouse/Controllers/LoginController.cs index 6bce4863..a3384241 100644 --- a/ProjectLighthouse/Controllers/LoginController.cs +++ b/ProjectLighthouse/Controllers/LoginController.cs @@ -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); diff --git a/ProjectLighthouse/Controllers/MatchController.cs b/ProjectLighthouse/Controllers/MatchController.cs index 94f4fff5..ea448bba 100644 --- a/ProjectLighthouse/Controllers/MatchController.cs +++ b/ProjectLighthouse/Controllers/MatchController.cs @@ -32,13 +32,13 @@ namespace LBPUnion.ProjectLighthouse.Controllers [Produces("text/plain")] public async Task 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(); diff --git a/ProjectLighthouse/Controllers/PublishController.cs b/ProjectLighthouse/Controllers/PublishController.cs index d7094138..7ce1365c 100644 --- a/ProjectLighthouse/Controllers/PublishController.cs +++ b/ProjectLighthouse/Controllers/PublishController.cs @@ -66,13 +66,13 @@ namespace LBPUnion.ProjectLighthouse.Controllers public async Task 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) { diff --git a/ProjectLighthouse/Controllers/ScoreController.cs b/ProjectLighthouse/Controllers/ScoreController.cs index 6f75e4d1..dc0762a8 100644 --- a/ProjectLighthouse/Controllers/ScoreController.cs +++ b/ProjectLighthouse/Controllers/ScoreController.cs @@ -28,13 +28,13 @@ namespace LBPUnion.ProjectLighthouse.Controllers [HttpPost("scoreboard/user/{id:int}")] public async Task 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++; diff --git a/ProjectLighthouse/Controllers/SlotsController.cs b/ProjectLighthouse/Controllers/SlotsController.cs index 38a2f5c3..c0ee8d96 100644 --- a/ProjectLighthouse/Controllers/SlotsController.cs +++ b/ProjectLighthouse/Controllers/SlotsController.cs @@ -26,7 +26,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers [HttpGet("slots/by")] public async Task 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 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 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 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; diff --git a/ProjectLighthouse/Controllers/UserController.cs b/ProjectLighthouse/Controllers/UserController.cs index 0c787e74..e5badad5 100644 --- a/ProjectLighthouse/Controllers/UserController.cs +++ b/ProjectLighthouse/Controllers/UserController.cs @@ -35,7 +35,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers [HttpGet("user/{username}")] public async Task 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 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 serializedUsers = new(); diff --git a/ProjectLighthouse/Database.cs b/ProjectLighthouse/Database.cs index 5b1c7253..e71ca13b 100644 --- a/ProjectLighthouse/Database.cs +++ b/ProjectLighthouse/Database.cs @@ -22,7 +22,7 @@ namespace LBPUnion.ProjectLighthouse public DbSet HeartedLevels { get; set; } public DbSet HeartedProfiles { get; set; } public DbSet Comments { get; set; } - public DbSet Tokens { get; set; } + public DbSet GameTokens { get; set; } public DbSet Scores { get; set; } public DbSet PhotoSubjects { get; set; } public DbSet Photos { get; set; } @@ -59,13 +59,13 @@ namespace LBPUnion.ProjectLighthouse } #nullable enable - public async Task AuthenticateUser(LoginData loginData, string userLocation, string titleId = "") + public async Task 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 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 UserFromToken(Token token) => await this.UserFromAuthToken(token.UserToken); + public async Task UserFromToken(GameToken gameToken) => await this.UserFromAuthToken(gameToken.UserToken); public async Task UserFromRequest(HttpRequest request) { @@ -102,18 +102,18 @@ namespace LBPUnion.ProjectLighthouse return await this.UserFromAuthToken(mmAuth); } - public async Task TokenFromRequest(HttpRequest request) + public async Task 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); diff --git a/ProjectLighthouse/Migrations/20211019021627_InitialCreate.Designer.cs b/ProjectLighthouse/Migrations/20211019021627_InitialCreate.Designer.cs index 7fcae3a9..053a8eee 100644 --- a/ProjectLighthouse/Migrations/20211019021627_InitialCreate.Designer.cs +++ b/ProjectLighthouse/Migrations/20211019021627_InitialCreate.Designer.cs @@ -154,7 +154,7 @@ namespace ProjectLighthouse.Migrations b.ToTable("Slots"); }); - modelBuilder.Entity("ProjectLighthouse.Types.Token", b => + modelBuilder.Entity("ProjectLighthouse.Types.GameToken", b => { b.Property("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211019031221_HeartedLevels.Designer.cs b/ProjectLighthouse/Migrations/20211019031221_HeartedLevels.Designer.cs index d531cf75..43af2c8a 100644 --- a/ProjectLighthouse/Migrations/20211019031221_HeartedLevels.Designer.cs +++ b/ProjectLighthouse/Migrations/20211019031221_HeartedLevels.Designer.cs @@ -175,7 +175,7 @@ namespace ProjectLighthouse.Migrations b.ToTable("Slots"); }); - modelBuilder.Entity("ProjectLighthouse.Types.Token", b => + modelBuilder.Entity("ProjectLighthouse.Types.GameToken", b => { b.Property("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211019203627_LastMatches.Designer.cs b/ProjectLighthouse/Migrations/20211019203627_LastMatches.Designer.cs index aebb0f62..03647fc8 100644 --- a/ProjectLighthouse/Migrations/20211019203627_LastMatches.Designer.cs +++ b/ProjectLighthouse/Migrations/20211019203627_LastMatches.Designer.cs @@ -189,7 +189,7 @@ namespace ProjectLighthouse.Migrations b.ToTable("Slots"); }); - modelBuilder.Entity("ProjectLighthouse.Types.Token", b => + modelBuilder.Entity("ProjectLighthouse.Types.GameToken", b => { b.Property("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211020220840_ResourceList.Designer.cs b/ProjectLighthouse/Migrations/20211020220840_ResourceList.Designer.cs index 36a02088..11880c79 100644 --- a/ProjectLighthouse/Migrations/20211020220840_ResourceList.Designer.cs +++ b/ProjectLighthouse/Migrations/20211020220840_ResourceList.Designer.cs @@ -189,7 +189,7 @@ namespace ProjectLighthouse.Migrations b.ToTable("Slots"); }); - modelBuilder.Entity("ProjectLighthouse.Types.Token", b => + modelBuilder.Entity("ProjectLighthouse.Types.GameToken", b => { b.Property("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211026010814_FavouriteUsers.Designer.cs b/ProjectLighthouse/Migrations/20211026010814_FavouriteUsers.Designer.cs index 5c292a1e..5f0ff875 100644 --- a/ProjectLighthouse/Migrations/20211026010814_FavouriteUsers.Designer.cs +++ b/ProjectLighthouse/Migrations/20211026010814_FavouriteUsers.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211028015915_AddSlotTimestamp.Designer.cs b/ProjectLighthouse/Migrations/20211028015915_AddSlotTimestamp.Designer.cs index 48beed7d..09a0a521 100644 --- a/ProjectLighthouse/Migrations/20211028015915_AddSlotTimestamp.Designer.cs +++ b/ProjectLighthouse/Migrations/20211028015915_AddSlotTimestamp.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211028021513_AddSlotFirstUploadedAndLastUpdated.Designer.cs b/ProjectLighthouse/Migrations/20211028021513_AddSlotFirstUploadedAndLastUpdated.Designer.cs index d1ba6622..3cf2e85b 100644 --- a/ProjectLighthouse/Migrations/20211028021513_AddSlotFirstUploadedAndLastUpdated.Designer.cs +++ b/ProjectLighthouse/Migrations/20211028021513_AddSlotFirstUploadedAndLastUpdated.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211029213334_RemoveUsedSlotsFromDb.Designer.cs b/ProjectLighthouse/Migrations/20211029213334_RemoveUsedSlotsFromDb.Designer.cs index 59a0dcc7..ef52f9e7 100644 --- a/ProjectLighthouse/Migrations/20211029213334_RemoveUsedSlotsFromDb.Designer.cs +++ b/ProjectLighthouse/Migrations/20211029213334_RemoveUsedSlotsFromDb.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211030203837_AddMMPickToSlot.Designer.cs b/ProjectLighthouse/Migrations/20211030203837_AddMMPickToSlot.Designer.cs index f9f84485..eeca745a 100644 --- a/ProjectLighthouse/Migrations/20211030203837_AddMMPickToSlot.Designer.cs +++ b/ProjectLighthouse/Migrations/20211030203837_AddMMPickToSlot.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211031234245_AddScoresTable.Designer.cs b/ProjectLighthouse/Migrations/20211031234245_AddScoresTable.Designer.cs index ce6e6792..14211110 100644 --- a/ProjectLighthouse/Migrations/20211031234245_AddScoresTable.Designer.cs +++ b/ProjectLighthouse/Migrations/20211031234245_AddScoresTable.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211102215859_RenameTeamPick.Designer.cs b/ProjectLighthouse/Migrations/20211102215859_RenameTeamPick.Designer.cs index 34087d12..131c53ad 100644 --- a/ProjectLighthouse/Migrations/20211102215859_RenameTeamPick.Designer.cs +++ b/ProjectLighthouse/Migrations/20211102215859_RenameTeamPick.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211103194917_RemoveStartupMigrations.Designer.cs b/ProjectLighthouse/Migrations/20211103194917_RemoveStartupMigrations.Designer.cs index f26e5451..ce336fce 100644 --- a/ProjectLighthouse/Migrations/20211103194917_RemoveStartupMigrations.Designer.cs +++ b/ProjectLighthouse/Migrations/20211103194917_RemoveStartupMigrations.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211104031327_AddGameVersionToToken.Designer.cs b/ProjectLighthouse/Migrations/20211104031327_AddGameVersionToToken.Designer.cs index 9814b171..215e0608 100644 --- a/ProjectLighthouse/Migrations/20211104031327_AddGameVersionToToken.Designer.cs +++ b/ProjectLighthouse/Migrations/20211104031327_AddGameVersionToToken.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211104040509_AddGameVersionToSlots.Designer.cs b/ProjectLighthouse/Migrations/20211104040509_AddGameVersionToSlots.Designer.cs index 0727a0e5..94070a76 100644 --- a/ProjectLighthouse/Migrations/20211104040509_AddGameVersionToSlots.Designer.cs +++ b/ProjectLighthouse/Migrations/20211104040509_AddGameVersionToSlots.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211104195812_AddPhotoSupport.Designer.cs b/ProjectLighthouse/Migrations/20211104195812_AddPhotoSupport.Designer.cs index b848597f..8e738f6a 100644 --- a/ProjectLighthouse/Migrations/20211104195812_AddPhotoSupport.Designer.cs +++ b/ProjectLighthouse/Migrations/20211104195812_AddPhotoSupport.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211105205010_UpdatePhotoAndPhotoSubjectToDoStuffWeirdName.Designer.cs b/ProjectLighthouse/Migrations/20211105205010_UpdatePhotoAndPhotoSubjectToDoStuffWeirdName.Designer.cs index 9dee3007..31f84ecc 100644 --- a/ProjectLighthouse/Migrations/20211105205010_UpdatePhotoAndPhotoSubjectToDoStuffWeirdName.Designer.cs +++ b/ProjectLighthouse/Migrations/20211105205010_UpdatePhotoAndPhotoSubjectToDoStuffWeirdName.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211105205239_DropPhotoSubjectParentPhoto.Designer.cs b/ProjectLighthouse/Migrations/20211105205239_DropPhotoSubjectParentPhoto.Designer.cs index 5f463653..7ee30fe0 100644 --- a/ProjectLighthouse/Migrations/20211105205239_DropPhotoSubjectParentPhoto.Designer.cs +++ b/ProjectLighthouse/Migrations/20211105205239_DropPhotoSubjectParentPhoto.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211105205749_DropPhotoSlot.Designer.cs b/ProjectLighthouse/Migrations/20211105205749_DropPhotoSlot.Designer.cs index 9cb364e3..9d153964 100644 --- a/ProjectLighthouse/Migrations/20211105205749_DropPhotoSlot.Designer.cs +++ b/ProjectLighthouse/Migrations/20211105205749_DropPhotoSlot.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211106010424_AddCreatorToPhoto.Designer.cs b/ProjectLighthouse/Migrations/20211106010424_AddCreatorToPhoto.Designer.cs index dfaa00d8..a1804945 100644 --- a/ProjectLighthouse/Migrations/20211106010424_AddCreatorToPhoto.Designer.cs +++ b/ProjectLighthouse/Migrations/20211106010424_AddCreatorToPhoto.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211107023452_NoPhotosByMeOrWithMeInUser.Designer.cs b/ProjectLighthouse/Migrations/20211107023452_NoPhotosByMeOrWithMeInUser.Designer.cs index 46f8d20f..22841820 100644 --- a/ProjectLighthouse/Migrations/20211107023452_NoPhotosByMeOrWithMeInUser.Designer.cs +++ b/ProjectLighthouse/Migrations/20211107023452_NoPhotosByMeOrWithMeInUser.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211108013443_RemoveCommentsEnabled.Designer.cs b/ProjectLighthouse/Migrations/20211108013443_RemoveCommentsEnabled.Designer.cs index 67842c32..89324073 100644 --- a/ProjectLighthouse/Migrations/20211108013443_RemoveCommentsEnabled.Designer.cs +++ b/ProjectLighthouse/Migrations/20211108013443_RemoveCommentsEnabled.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211108015422_AddPlaysToSlot.Designer.cs b/ProjectLighthouse/Migrations/20211108015422_AddPlaysToSlot.Designer.cs index 40001bd0..59bcc054 100644 --- a/ProjectLighthouse/Migrations/20211108015422_AddPlaysToSlot.Designer.cs +++ b/ProjectLighthouse/Migrations/20211108015422_AddPlaysToSlot.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211108054552_RemoveCountsFromDatabase.Designer.cs b/ProjectLighthouse/Migrations/20211108054552_RemoveCountsFromDatabase.Designer.cs index 4d2d382f..30993275 100644 --- a/ProjectLighthouse/Migrations/20211108054552_RemoveCountsFromDatabase.Designer.cs +++ b/ProjectLighthouse/Migrations/20211108054552_RemoveCountsFromDatabase.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211108093616_GameSpecificPlayCounts.Designer.cs b/ProjectLighthouse/Migrations/20211108093616_GameSpecificPlayCounts.Designer.cs index abf45882..c649e759 100644 --- a/ProjectLighthouse/Migrations/20211108093616_GameSpecificPlayCounts.Designer.cs +++ b/ProjectLighthouse/Migrations/20211108093616_GameSpecificPlayCounts.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211108114052_VisitedLevelsTable.Designer.cs b/ProjectLighthouse/Migrations/20211108114052_VisitedLevelsTable.Designer.cs index f78f1d58..9ea4167f 100644 --- a/ProjectLighthouse/Migrations/20211108114052_VisitedLevelsTable.Designer.cs +++ b/ProjectLighthouse/Migrations/20211108114052_VisitedLevelsTable.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211108212022_BooYayRateLevels.Designer.cs b/ProjectLighthouse/Migrations/20211108212022_BooYayRateLevels.Designer.cs index 4d1d9dbf..fc982fdc 100644 --- a/ProjectLighthouse/Migrations/20211108212022_BooYayRateLevels.Designer.cs +++ b/ProjectLighthouse/Migrations/20211108212022_BooYayRateLevels.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211109225543_AddLevelTypeToSlot.Designer.cs b/ProjectLighthouse/Migrations/20211109225543_AddLevelTypeToSlot.Designer.cs index cc243392..f14eb761 100644 --- a/ProjectLighthouse/Migrations/20211109225543_AddLevelTypeToSlot.Designer.cs +++ b/ProjectLighthouse/Migrations/20211109225543_AddLevelTypeToSlot.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211113091631_AddUserLocationToToken.Designer.cs b/ProjectLighthouse/Migrations/20211113091631_AddUserLocationToToken.Designer.cs index 76be44ce..02bde039 100644 --- a/ProjectLighthouse/Migrations/20211113091631_AddUserLocationToToken.Designer.cs +++ b/ProjectLighthouse/Migrations/20211113091631_AddUserLocationToToken.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211113215128_VisitedLevelPlayCounts.Designer.cs b/ProjectLighthouse/Migrations/20211113215128_VisitedLevelPlayCounts.Designer.cs index 5d93e5a2..8385d1da 100644 --- a/ProjectLighthouse/Migrations/20211113215128_VisitedLevelPlayCounts.Designer.cs +++ b/ProjectLighthouse/Migrations/20211113215128_VisitedLevelPlayCounts.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211113220306_VisitedLevelDropGameVersion.Designer.cs b/ProjectLighthouse/Migrations/20211113220306_VisitedLevelDropGameVersion.Designer.cs index b48129af..38304f22 100644 --- a/ProjectLighthouse/Migrations/20211113220306_VisitedLevelDropGameVersion.Designer.cs +++ b/ProjectLighthouse/Migrations/20211113220306_VisitedLevelDropGameVersion.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211114231343_UserRefactor.Designer.cs b/ProjectLighthouse/Migrations/20211114231343_UserRefactor.Designer.cs index cf70b3b0..49a61ffa 100644 --- a/ProjectLighthouse/Migrations/20211114231343_UserRefactor.Designer.cs +++ b/ProjectLighthouse/Migrations/20211114231343_UserRefactor.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211115050553_UserAddDefaultsToNullableStrings.Designer.cs b/ProjectLighthouse/Migrations/20211115050553_UserAddDefaultsToNullableStrings.Designer.cs index 556eb96f..3aad3cc8 100644 --- a/ProjectLighthouse/Migrations/20211115050553_UserAddDefaultsToNullableStrings.Designer.cs +++ b/ProjectLighthouse/Migrations/20211115050553_UserAddDefaultsToNullableStrings.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211115052941_SlotAddLbpVitaPlays.Designer.cs b/ProjectLighthouse/Migrations/20211115052941_SlotAddLbpVitaPlays.Designer.cs index efb62ea6..d3531618 100644 --- a/ProjectLighthouse/Migrations/20211115052941_SlotAddLbpVitaPlays.Designer.cs +++ b/ProjectLighthouse/Migrations/20211115052941_SlotAddLbpVitaPlays.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211120045239_AddPasswordToUser.Designer.cs b/ProjectLighthouse/Migrations/20211120045239_AddPasswordToUser.Designer.cs index 2f2f2a57..1afd4976 100644 --- a/ProjectLighthouse/Migrations/20211120045239_AddPasswordToUser.Designer.cs +++ b/ProjectLighthouse/Migrations/20211120045239_AddPasswordToUser.Designer.cs @@ -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("TokenId") .ValueGeneratedOnAdd() diff --git a/ProjectLighthouse/Migrations/20211120052549_RenameTokensToGameTokens.Designer.cs b/ProjectLighthouse/Migrations/20211120052549_RenameTokensToGameTokens.Designer.cs new file mode 100644 index 00000000..f0e1ea83 --- /dev/null +++ b/ProjectLighthouse/Migrations/20211120052549_RenameTokensToGameTokens.Designer.cs @@ -0,0 +1,654 @@ +// +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("TokenId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("GameVersion") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.Property("UserLocation") + .HasColumnType("longtext"); + + b.Property("UserToken") + .HasColumnType("longtext"); + + b.HasKey("TokenId"); + + b.ToTable("GameTokens"); + }); + + modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.HeartedProfile", b => + { + b.Property("HeartedProfileId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("HeartedUserId") + .HasColumnType("int"); + + b.Property("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("HeartedLevelId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("SlotId") + .HasColumnType("int"); + + b.Property("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("QueuedLevelId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("SlotId") + .HasColumnType("int"); + + b.Property("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("RatedLevelId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Rating") + .HasColumnType("int"); + + b.Property("RatingLBP1") + .HasColumnType("double"); + + b.Property("SlotId") + .HasColumnType("int"); + + b.Property("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("SlotId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("AuthorLabels") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("BackgroundHash") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("CreatorId") + .HasColumnType("int"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("FirstUploaded") + .HasColumnType("bigint"); + + b.Property("GameVersion") + .HasColumnType("int"); + + b.Property("IconHash") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("InitiallyLocked") + .HasColumnType("tinyint(1)"); + + b.Property("LastUpdated") + .HasColumnType("bigint"); + + b.Property("Lbp1Only") + .HasColumnType("tinyint(1)"); + + b.Property("LevelType") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("LocationId") + .HasColumnType("int"); + + b.Property("MaximumPlayers") + .HasColumnType("int"); + + b.Property("MinimumPlayers") + .HasColumnType("int"); + + b.Property("MoveRequired") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("PlaysLBP1") + .HasColumnType("int"); + + b.Property("PlaysLBP1Complete") + .HasColumnType("int"); + + b.Property("PlaysLBP1Unique") + .HasColumnType("int"); + + b.Property("PlaysLBP2") + .HasColumnType("int"); + + b.Property("PlaysLBP2Complete") + .HasColumnType("int"); + + b.Property("PlaysLBP2Unique") + .HasColumnType("int"); + + b.Property("PlaysLBP3") + .HasColumnType("int"); + + b.Property("PlaysLBP3Complete") + .HasColumnType("int"); + + b.Property("PlaysLBP3Unique") + .HasColumnType("int"); + + b.Property("PlaysLBPVita") + .HasColumnType("int"); + + b.Property("PlaysLBPVitaComplete") + .HasColumnType("int"); + + b.Property("PlaysLBPVitaUnique") + .HasColumnType("int"); + + b.Property("ResourceCollection") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("RootLevel") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Shareable") + .HasColumnType("int"); + + b.Property("SubLevel") + .HasColumnType("tinyint(1)"); + + b.Property("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("VisitedLevelId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("PlaysLBP1") + .HasColumnType("int"); + + b.Property("PlaysLBP2") + .HasColumnType("int"); + + b.Property("PlaysLBP3") + .HasColumnType("int"); + + b.Property("PlaysLBPVita") + .HasColumnType("int"); + + b.Property("SlotId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("VisitedLevelId"); + + b.HasIndex("SlotId"); + + b.HasIndex("UserId"); + + b.ToTable("VisitedLevels"); + }); + + modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Photo", b => + { + b.Property("PhotoId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("CreatorId") + .HasColumnType("int"); + + b.Property("LargeHash") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("MediumHash") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("PhotoSubjectCollection") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("PlanHash") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("SmallHash") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Timestamp") + .HasColumnType("bigint"); + + b.HasKey("PhotoId"); + + b.HasIndex("CreatorId"); + + b.ToTable("Photos"); + }); + + modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.PhotoSubject", b => + { + b.Property("PhotoSubjectId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Bounds") + .HasColumnType("longtext"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("PhotoSubjectId"); + + b.HasIndex("UserId"); + + b.ToTable("PhotoSubjects"); + }); + + modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Profiles.Comment", b => + { + b.Property("CommentId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Message") + .HasColumnType("longtext"); + + b.Property("PosterUserId") + .HasColumnType("int"); + + b.Property("TargetUserId") + .HasColumnType("int"); + + b.Property("ThumbsDown") + .HasColumnType("int"); + + b.Property("ThumbsUp") + .HasColumnType("int"); + + b.Property("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("UserId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("bigint"); + + b.HasKey("UserId"); + + b.ToTable("LastMatches"); + }); + + modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Profiles.Location", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("X") + .HasColumnType("int"); + + b.Property("Y") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Locations"); + }); + + modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Score", b => + { + b.Property("ScoreId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("PlayerIdCollection") + .HasColumnType("longtext"); + + b.Property("Points") + .HasColumnType("int"); + + b.Property("SlotId") + .HasColumnType("int"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("ScoreId"); + + b.HasIndex("SlotId"); + + b.ToTable("Scores"); + }); + + modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.User", b => + { + b.Property("UserId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Biography") + .HasColumnType("longtext"); + + b.Property("Game") + .HasColumnType("int"); + + b.Property("IconHash") + .HasColumnType("longtext"); + + b.Property("LocationId") + .HasColumnType("int"); + + b.Property("Password") + .HasColumnType("longtext"); + + b.Property("Pins") + .HasColumnType("longtext"); + + b.Property("PlanetHash") + .HasColumnType("longtext"); + + b.Property("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 + } + } +} diff --git a/ProjectLighthouse/Migrations/20211120052549_RenameTokensToGameTokens.cs b/ProjectLighthouse/Migrations/20211120052549_RenameTokensToGameTokens.cs new file mode 100644 index 00000000..59150955 --- /dev/null +++ b/ProjectLighthouse/Migrations/20211120052549_RenameTokensToGameTokens.cs @@ -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"); + } + } +} diff --git a/ProjectLighthouse/Migrations/DatabaseModelSnapshot.cs b/ProjectLighthouse/Migrations/DatabaseModelSnapshot.cs index c7ae61ec..c0613f2b 100644 --- a/ProjectLighthouse/Migrations/DatabaseModelSnapshot.cs +++ b/ProjectLighthouse/Migrations/DatabaseModelSnapshot.cs @@ -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("TokenId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("GameVersion") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.Property("UserLocation") + .HasColumnType("longtext"); + + b.Property("UserToken") + .HasColumnType("longtext"); + + b.HasKey("TokenId"); + + b.ToTable("GameTokens"); + }); + modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.HeartedProfile", b => { b.Property("HeartedProfileId") @@ -410,29 +433,6 @@ namespace ProjectLighthouse.Migrations b.ToTable("Scores"); }); - modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Token", b => - { - b.Property("TokenId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("GameVersion") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("int"); - - b.Property("UserLocation") - .HasColumnType("longtext"); - - b.Property("UserToken") - .HasColumnType("longtext"); - - b.HasKey("TokenId"); - - b.ToTable("Tokens"); - }); - modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.User", b => { b.Property("UserId") diff --git a/ProjectLighthouse/Types/Token.cs b/ProjectLighthouse/Types/GameToken.cs similarity index 93% rename from ProjectLighthouse/Types/Token.cs rename to ProjectLighthouse/Types/GameToken.cs index fc448c8c..64b19217 100644 --- a/ProjectLighthouse/Types/Token.cs +++ b/ProjectLighthouse/Types/GameToken.cs @@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations; namespace LBPUnion.ProjectLighthouse.Types { - public class Token + public class GameToken { // ReSharper disable once UnusedMember.Global [Key]