From 7d0bb2dd2f510a354ad99e1d80ddd7790aa5fdd7 Mon Sep 17 00:00:00 2001 From: hyeon Date: Tue, 6 Aug 2024 11:54:11 +0900 Subject: [PATCH 01/62] Bump headless --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index 22bb2979..2ee19e37 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit 22bb2979b07181201575c8f9592d1fdfaa3e9685 +Subproject commit 2ee19e37a42c1a17265afc4c93f1662d2d6dbec0 From 813e075f807c5f6b75d0248f601984f45cc85e81 Mon Sep 17 00:00:00 2001 From: hyeon Date: Wed, 7 Aug 2024 15:35:52 +0900 Subject: [PATCH 02/62] Fix compile error --- .../Commands/BattleArenaRankingMigration.cs | 2 +- .../Commands/MySqlMigration.cs | 2 +- .../Commands/UserDataMigration.cs | 2 +- .../Commands/UserStakingMigration.cs | 2 +- NineChronicles.DataProvider/GraphQLStartup.cs | 3 ++- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/NineChronicles.DataProvider.Executable/Commands/BattleArenaRankingMigration.cs b/NineChronicles.DataProvider.Executable/Commands/BattleArenaRankingMigration.cs index 6eba9d73..84780e65 100644 --- a/NineChronicles.DataProvider.Executable/Commands/BattleArenaRankingMigration.cs +++ b/NineChronicles.DataProvider.Executable/Commands/BattleArenaRankingMigration.cs @@ -114,7 +114,7 @@ public void Migration( Block genesis = _baseStore.GetBlock(gHash); var blockChainStates = new BlockChainStates(_baseStore, baseStateStore); var actionEvaluator = new ActionEvaluator( - _ => blockPolicy.BlockAction, + blockPolicy.PolicyActionsRegistry, baseStateStore, new NCActionLoader()); _baseChain = new BlockChain(blockPolicy, stagePolicy, _baseStore, baseStateStore, genesis, blockChainStates, actionEvaluator); diff --git a/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs b/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs index 4f971879..4033f96a 100644 --- a/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs +++ b/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs @@ -197,7 +197,7 @@ public async Task Migration( Block genesis = _baseStore.GetBlock(gHash); var blockChainStates = new BlockChainStates(_baseStore, baseStateStore); var actionEvaluator = new ActionEvaluator( - _ => blockPolicy.BlockAction, + blockPolicy.PolicyActionsRegistry, baseStateStore, new NCActionLoader()); _baseChain = new BlockChain( diff --git a/NineChronicles.DataProvider.Executable/Commands/UserDataMigration.cs b/NineChronicles.DataProvider.Executable/Commands/UserDataMigration.cs index 654e1205..fd0f250a 100644 --- a/NineChronicles.DataProvider.Executable/Commands/UserDataMigration.cs +++ b/NineChronicles.DataProvider.Executable/Commands/UserDataMigration.cs @@ -196,7 +196,7 @@ string mysqlDatabase Block genesis = _baseStore.GetBlock(gHash); var blockChainStates = new BlockChainStates(_baseStore, baseStateStore); var actionEvaluator = new ActionEvaluator( - _ => blockPolicy.BlockAction, + blockPolicy.PolicyActionsRegistry, baseStateStore, new NCActionLoader()); _baseChain = new BlockChain(blockPolicy, stagePolicy, _baseStore, baseStateStore, genesis, blockChainStates, actionEvaluator); diff --git a/NineChronicles.DataProvider.Executable/Commands/UserStakingMigration.cs b/NineChronicles.DataProvider.Executable/Commands/UserStakingMigration.cs index 9fbe6cbf..664d8f23 100644 --- a/NineChronicles.DataProvider.Executable/Commands/UserStakingMigration.cs +++ b/NineChronicles.DataProvider.Executable/Commands/UserStakingMigration.cs @@ -128,7 +128,7 @@ public void Migration( Block genesis = _baseStore.GetBlock(gHash); var blockChainStates = new BlockChainStates(_baseStore, baseStateStore); var actionEvaluator = new ActionEvaluator( - _ => blockPolicy.BlockAction, + blockPolicy.PolicyActionsRegistry, baseStateStore, new NCActionLoader()); _baseChain = new BlockChain(blockPolicy, stagePolicy, _baseStore, baseStateStore, genesis, blockChainStates, actionEvaluator); diff --git a/NineChronicles.DataProvider/GraphQLStartup.cs b/NineChronicles.DataProvider/GraphQLStartup.cs index fae9376e..3591caae 100644 --- a/NineChronicles.DataProvider/GraphQLStartup.cs +++ b/NineChronicles.DataProvider/GraphQLStartup.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Concurrent; using GraphQL.Server; + using GraphQL.Server.Transports.AspNetCore; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; @@ -43,7 +44,7 @@ public void ConfigureServices(IServiceCollection services) .AddGraphTypes(typeof(NineChroniclesSummarySchema)) .AddGraphTypes(typeof(StandaloneSchema)) .AddLibplanetExplorer() - .AddUserContextBuilder(); + .AddUserContextBuilder(); services.AddSingleton(); services.AddGraphTypes(); services.AddSingleton(); From 58ec1e1f1942eebb837a2639cb321dedaa95de42 Mon Sep 17 00:00:00 2001 From: hyeon Date: Wed, 7 Aug 2024 22:21:01 +0900 Subject: [PATCH 03/62] Save CustomEquipmentCraft action data --- .../CustomCraft/CustomEquipmentCraftData.cs | 132 ++++++++++++++++++ .../RenderSubscriber.cs | 11 ++ .../CustomEquipmentCraftCountModel.cs | 14 ++ .../CustomCraft/CustomEquipmentCraftModel.cs | 41 ++++++ .../Store/MySql/CustomCraftStore.cs | 68 +++++++++ .../Store/MySqlStore.cs | 5 + .../Store/NineChroniclesContext.cs | 7 + .../Subscriber/CustomCraftRenderSubscriber.cs | 81 +++++++++++ 8 files changed, 359 insertions(+) create mode 100644 NineChronicles.DataProvider/DataRendering/CustomCraft/CustomEquipmentCraftData.cs create mode 100644 NineChronicles.DataProvider/Store/Models/CustomCraft/CustomEquipmentCraftCountModel.cs create mode 100644 NineChronicles.DataProvider/Store/Models/CustomCraft/CustomEquipmentCraftModel.cs create mode 100644 NineChronicles.DataProvider/Store/MySql/CustomCraftStore.cs create mode 100644 NineChronicles.DataProvider/Subscriber/CustomCraftRenderSubscriber.cs diff --git a/NineChronicles.DataProvider/DataRendering/CustomCraft/CustomEquipmentCraftData.cs b/NineChronicles.DataProvider/DataRendering/CustomCraft/CustomEquipmentCraftData.cs new file mode 100644 index 00000000..67fad1f3 --- /dev/null +++ b/NineChronicles.DataProvider/DataRendering/CustomCraft/CustomEquipmentCraftData.cs @@ -0,0 +1,132 @@ +namespace NineChronicles.DataProvider.DataRendering.CustomCraft +{ + using System; + using System.Collections.Generic; + using System.Linq; + using Libplanet.Action; + using Libplanet.Action.State; + using Libplanet.Crypto; + using Nekoyume.Action.CustomEquipmentCraft; + using Nekoyume.Extensions; + using Nekoyume.Helper; + using Nekoyume.Model.Elemental; + using Nekoyume.Model.Item; + using Nekoyume.Module; + using Nekoyume.TableData; + using Nekoyume.TableData.CustomEquipmentCraft; + using NineChronicles.DataProvider.Store.Models.CustomCraft; + using Serilog; + + public static class CustomEquipmentCraftData + { + public static List GetCraftInfo( + IWorld prevStates, + long blockIndex, + DateTimeOffset blockTime, + IRandom random, + CustomEquipmentCraft craftData + ) + { + Log.Verbose($"[CustomEquipmentCraft] GetCraftData"); + var craftList = new List(); + + var i = 0; + foreach (var craft in craftData.CraftList) + { + var guid = Guid.NewGuid().ToString(); + + Dictionary sheets = prevStates.GetSheets(sheetTypes: new[] + { + typeof(CustomEquipmentCraftRecipeSheet), + typeof(CustomEquipmentCraftRelationshipSheet), + typeof(CustomEquipmentCraftIconSheet), + typeof(CustomEquipmentCraftCostSheet), + typeof(EquipmentItemSheet), + typeof(MaterialItemSheet), + }); + + var relationship = prevStates.GetRelationship(craftData.AvatarAddress); + var recipeSheet = sheets.GetSheet(); + var recipeRow = recipeSheet[craft.RecipeId]; + var relationshipRow = sheets.GetSheet() + .OrderedList!.First(row => row.Relationship >= relationship); + var (ncgCost, materialCosts) = CustomCraftHelper.CalculateCraftCost( + craft.IconId, + sheets.GetSheet(), + recipeRow, + relationshipRow, + sheets.GetSheet().Values + .FirstOrDefault(r => r.Relationship == relationship), + prevStates.GetGameConfigState().CustomEquipmentCraftIconCostMultiplier + ); + + var drawingAmount = 0; + var drawingToolAmount = 0; + var sb = new List(); + var materialItemSheet = sheets.GetSheet(); + var drawingItemId = materialItemSheet.OrderedList! + .First(row => row.ItemSubType == ItemSubType.Drawing).Id; + var drawingToolItemId = materialItemSheet.OrderedList! + .First(row => row.ItemSubType == ItemSubType.DrawingTool).Id; + + foreach (var (itemId, amount) in materialCosts) + { + if (itemId == drawingItemId) + { + drawingAmount = amount; + } + else if (itemId == drawingToolItemId) + { + drawingToolAmount = amount; + } + else + { + sb.Add($"{itemId}:{amount}"); + } + } + + // Create equipment with ItemFactory + var uid = random.GenerateRandomGuid(); + var equipmentItemId = relationshipRow.GetItemId(recipeRow.ItemSubType); + var equipmentRow = sheets.GetSheet()[equipmentItemId]; + var equipment = + (Equipment)ItemFactory.CreateItemUsable(equipmentRow, uid, 0L); + + // Set Icon + equipment.IconId = ItemFactory.SelectIconId( + craft.IconId, + craft.IconId == CustomEquipmentCraft.RandomIconId, + equipmentRow, + relationship, + sheets.GetSheet(), + random + ); + + // Set Elemental Type + var elementalList = (ElementalType[])Enum.GetValues(typeof(ElementalType)); + equipment.ElementalType = elementalList[random.Next(elementalList.Length)]; + + craftList.Add(new CustomEquipmentCraftModel + { + Id = $"{guid}_{i++}", + BlockIndex = blockIndex, + AvatarAddress = craftData.AvatarAddress.ToString(), + EquipmentItemId = 1, + RecipeId = craft.RecipeId, + SlotIndex = craft.SlotIndex, + ItemSubType = equipment.ItemSubType.ToString(), + IconId = equipment.IconId, + ElementalType = equipment.ElementalType.ToString(), + DrawingAmount = drawingAmount, + DrawingToolAmount = drawingToolAmount, + NcgCost = (decimal)ncgCost, + AdditionalCost = string.Join(",", sb), + Date = DateOnly.FromDateTime(blockTime.DateTime), + TimeStamp = blockTime, + }); + } + + return craftList; + } + } +} diff --git a/NineChronicles.DataProvider/RenderSubscriber.cs b/NineChronicles.DataProvider/RenderSubscriber.cs index 768e7a5c..58e8c315 100644 --- a/NineChronicles.DataProvider/RenderSubscriber.cs +++ b/NineChronicles.DataProvider/RenderSubscriber.cs @@ -18,6 +18,7 @@ namespace NineChronicles.DataProvider using Nekoyume; using Nekoyume.Action; using Nekoyume.Action.AdventureBoss; + using Nekoyume.Action.CustomEquipmentCraft; using Nekoyume.Extensions; using Nekoyume.Helper; using Nekoyume.Model.EnumType; @@ -1726,6 +1727,10 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) _actionRenderer.EveryRender().Subscribe(SubscribeAdventureBossClaim); /* Adventure Boss */ + // CustomCraft + _actionRenderer.EveryRender().Subscribe(SubscribeCustomEquipmentCraft); + /* CustomCraft */ + return Task.CompletedTask; } @@ -1740,7 +1745,11 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) partial void SubscribeAdventureBossUnlockFloor(ActionEvaluation evt); partial void SubscribeAdventureBossClaim(ActionEvaluation evt); + /** Adventure Boss **/ + //// Custom Craft + partial void SubscribeCustomEquipmentCraft(ActionEvaluation evt); + /** Custom Craft **/ /* Partial Methods */ private void AddShopHistoryItem(ITradableItem orderItem, Address buyerAvatarAddress, PurchaseInfo purchaseInfo, int itemCount, long blockIndex) @@ -1877,6 +1886,7 @@ private void StoreRenderedData((Block OldTip, Block NewTip) b) MySqlStore.StoreRuneSummonList(_runeSummonList); MySqlStore.StoreRuneSummonFailList(_runeSummonFailList); StoreAdventureBossList(); + StoreCustomEquipmentCraftList(); }), }; @@ -1927,6 +1937,7 @@ private void StoreRenderedData((Block OldTip, Block NewTip) b) _auraSummonList.Clear(); _auraSummonFailList.Clear(); ClearAdventureBossList(); + ClearCustomCraftList(); var end = DateTimeOffset.Now; long blockIndex = b.OldTip.Index; diff --git a/NineChronicles.DataProvider/Store/Models/CustomCraft/CustomEquipmentCraftCountModel.cs b/NineChronicles.DataProvider/Store/Models/CustomCraft/CustomEquipmentCraftCountModel.cs new file mode 100644 index 00000000..933c2e47 --- /dev/null +++ b/NineChronicles.DataProvider/Store/Models/CustomCraft/CustomEquipmentCraftCountModel.cs @@ -0,0 +1,14 @@ +namespace NineChronicles.DataProvider.Store.Models.CustomCraft +{ + using System.ComponentModel.DataAnnotations; + + public class CustomEquipmentCraftCountModel + { + [Key] + public int IconId { get; set; } + + public string? ItemSubType { get; set; } + + public long Count { get; set; } + } +} diff --git a/NineChronicles.DataProvider/Store/Models/CustomCraft/CustomEquipmentCraftModel.cs b/NineChronicles.DataProvider/Store/Models/CustomCraft/CustomEquipmentCraftModel.cs new file mode 100644 index 00000000..4893eebb --- /dev/null +++ b/NineChronicles.DataProvider/Store/Models/CustomCraft/CustomEquipmentCraftModel.cs @@ -0,0 +1,41 @@ +namespace NineChronicles.DataProvider.Store.Models.CustomCraft +{ + using System; + using System.ComponentModel.DataAnnotations; + + public class CustomEquipmentCraftModel + { + [Key] + public string? Id { get; set; } + + public long BlockIndex { get; set; } + + public string? AvatarAddress { get; set; } + + public AvatarModel? Avatar { get; set; } + + public int EquipmentItemId { get; set; } + + public int RecipeId { get; set; } + + public int SlotIndex { get; set; } + + public string? ItemSubType { get; set; } + + public int IconId { get; set; } + + public string? ElementalType { get; set; } + + public int DrawingAmount { get; set; } + + public int DrawingToolAmount { get; set; } + + public decimal NcgCost { get; set; } + + public string? AdditionalCost { get; set; } + + public DateOnly Date { get; set; } + + public DateTimeOffset TimeStamp { get; set; } + } +} diff --git a/NineChronicles.DataProvider/Store/MySql/CustomCraftStore.cs b/NineChronicles.DataProvider/Store/MySql/CustomCraftStore.cs new file mode 100644 index 00000000..9617952f --- /dev/null +++ b/NineChronicles.DataProvider/Store/MySql/CustomCraftStore.cs @@ -0,0 +1,68 @@ +namespace NineChronicles.DataProvider.Store +{ + using System; + using System.Collections.Generic; + using System.Threading.Tasks; + using Microsoft.EntityFrameworkCore; + using NineChronicles.DataProvider.Store.Models.CustomCraft; + using Serilog; + + public partial class MySqlStore + { + public async partial Task StoreCustomEquipmentCraftList(List customEquipmentCraftList) + { + NineChroniclesContext? ctx = null; + try + { + ctx = await _dbContextFactory.CreateDbContextAsync(); + + // This is for count update + var iconCraftCountDict = new Dictionary<(string, int), int>(); + + // Add new CustomCraft data + foreach (var craftData in customEquipmentCraftList) + { + if (await ctx.CustomEquipmentCraft.FirstOrDefaultAsync(c => c.Id == craftData.Id) is null) + { + iconCraftCountDict[(craftData.ItemSubType!, craftData.IconId)]++; + await ctx.CustomEquipmentCraft.AddAsync(craftData); + } + } + + // Upsert CustomCraft count + foreach (var ((itemSubType, iconId), count) in iconCraftCountDict) + { + var countData = await ctx.CustomEquipmentCraftCount.FirstOrDefaultAsync(c => c.IconId == iconId); + if (countData is null) + { + await ctx.CustomEquipmentCraftCount.AddAsync(new CustomEquipmentCraftCountModel + { + IconId = iconId, + ItemSubType = itemSubType, + Count = count, + }); + } + else + { + countData.Count += count; + ctx.Update(countData); + } + } + + await ctx.SaveChangesAsync(); + } + catch (Exception e) + { + Log.Debug(e.Message); + Log.Debug(e.StackTrace); + } + finally + { + if (ctx is not null) + { + await ctx.DisposeAsync(); + } + } + } + } +} diff --git a/NineChronicles.DataProvider/Store/MySqlStore.cs b/NineChronicles.DataProvider/Store/MySqlStore.cs index b3f92dc4..8753a445 100644 --- a/NineChronicles.DataProvider/Store/MySqlStore.cs +++ b/NineChronicles.DataProvider/Store/MySqlStore.cs @@ -9,6 +9,7 @@ namespace NineChronicles.DataProvider.Store using Nekoyume.Model.Item; using NineChronicles.DataProvider.Store.Models; using NineChronicles.DataProvider.Store.Models.AdventureBoss; + using NineChronicles.DataProvider.Store.Models.CustomCraft; using Serilog; public partial class MySqlStore @@ -1956,6 +1957,10 @@ public void StoreRuneSummonFailList(List runeSummonFailList public partial Task StoreAdventureBossClaimRewardList(List claimList); /* Adventure Boss */ + // CustomCraft + public partial Task StoreCustomEquipmentCraftList(List customEquipmentCraftList); + /* CustomCraft */ + public List GetRaiderList() { using NineChroniclesContext ctx = _dbContextFactory.CreateDbContext(); diff --git a/NineChronicles.DataProvider/Store/NineChroniclesContext.cs b/NineChronicles.DataProvider/Store/NineChroniclesContext.cs index 20b4b6bc..320d5849 100644 --- a/NineChronicles.DataProvider/Store/NineChroniclesContext.cs +++ b/NineChronicles.DataProvider/Store/NineChroniclesContext.cs @@ -3,6 +3,7 @@ namespace NineChronicles.DataProvider.Store using Microsoft.EntityFrameworkCore; using NineChronicles.DataProvider.Store.Models; using NineChronicles.DataProvider.Store.Models.AdventureBoss; + using NineChronicles.DataProvider.Store.Models.CustomCraft; public sealed class NineChroniclesContext : DbContext { @@ -219,6 +220,12 @@ public NineChroniclesContext(DbContextOptions options) public DbSet AdventureBossClaimReward => Set(); /* Adventure Boss */ + // CustomCraft + public DbSet CustomEquipmentCraft => Set(); + + public DbSet CustomEquipmentCraftCount => Set(); + /* CustomCraft */ + // Table for daily metrics data public DbSet DailyMetrics => Set(); diff --git a/NineChronicles.DataProvider/Subscriber/CustomCraftRenderSubscriber.cs b/NineChronicles.DataProvider/Subscriber/CustomCraftRenderSubscriber.cs new file mode 100644 index 00000000..1c0b0b90 --- /dev/null +++ b/NineChronicles.DataProvider/Subscriber/CustomCraftRenderSubscriber.cs @@ -0,0 +1,81 @@ +namespace NineChronicles.DataProvider +{ + using System; + using System.Collections.Generic; + using System.Threading.Tasks; + using Lib9c.Renderers; + using Libplanet.Action.State; + using Nekoyume.Action.CustomEquipmentCraft; + using NineChronicles.DataProvider.DataRendering.CustomCraft; + using NineChronicles.DataProvider.Store.Models.CustomCraft; + using Serilog; + + public partial class RenderSubscriber + { + private readonly List _customEquipmentCraftList = new (); + + public void StoreCustomEquipmentCraftList() + { + try + { + var tasks = new List(); + Log.Debug("[DataProvider] Store CustomEquipmentCraft list"); + tasks.Add(Task.Run(async () => + { + Log.Debug($"[CustomCraft] {_customEquipmentCraftList.Count} craft data"); + await MySqlStore.StoreCustomEquipmentCraftList(_customEquipmentCraftList); + })); + } + catch (Exception e) + { + Log.Error(e.Message); + } + } + + private void ClearCustomCraftList() + { + Log.Debug("[DataProvider] Clear CustomCraft list"); + _customEquipmentCraftList.Clear(); + } + + partial void SubscribeCustomEquipmentCraft(ActionEvaluation evt) + { + try + { + if (evt.Exception is null && evt.Action is { } customEquipmentCraft) + { + var start = DateTimeOffset.UtcNow; + var prevState = new World(_blockChainStates.GetWorldState(evt.PreviousState)); + var craftList = CustomEquipmentCraftData.GetCraftInfo( + prevState, + evt.BlockIndex, + _blockTimeOffset, + new ReplayRandom(evt.RandomSeed), + customEquipmentCraft + ); + foreach (var craft in craftList) + { + _customEquipmentCraftList.Add(craft); + } + + var end = DateTimeOffset.UtcNow; + Log.Debug( + "[DataProvider] Stored {count} AdventureBossSeason action in block #{BlockIndex}. Time taken: {Time} ms", + _adventureBossSeasonDict.Count, + evt.BlockIndex, + end - start + ); + } + } + catch (Exception e) + { + Log.Error( + e, + "[DataProvider] RenderSubscriber Error: {ErrorMessage}, StackTrace: {StackTrace}", + e.Message, + e.StackTrace + ); + } + } + } +} From d652b46a6cb232212a09ea8c4720435d1b4731b5 Mon Sep 17 00:00:00 2001 From: hyeon Date: Wed, 7 Aug 2024 23:08:48 +0900 Subject: [PATCH 04/62] Add craft count upsert test --- .../Store/CustomEquipmentCraftStoreTest.cs | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 NineChronicles.DataProvider.Tests/Store/CustomEquipmentCraftStoreTest.cs diff --git a/NineChronicles.DataProvider.Tests/Store/CustomEquipmentCraftStoreTest.cs b/NineChronicles.DataProvider.Tests/Store/CustomEquipmentCraftStoreTest.cs new file mode 100644 index 00000000..7f3dba57 --- /dev/null +++ b/NineChronicles.DataProvider.Tests/Store/CustomEquipmentCraftStoreTest.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Libplanet.Action.State; +using Libplanet.Crypto; +using Libplanet.Mocks; +using Microsoft.Extensions.DependencyInjection; +using NineChronicles.DataProvider.Store; +using NineChronicles.DataProvider.Store.Models.CustomCraft; +using Xunit; + +namespace NineChronicles.DataProvider.Tests.Store; + +public class CustomEquipmentCraftStoreTest : TestBase +{ + [Theory] + [InlineData(true)] + [InlineData(false)] + public async Task UpsertCraftCount(bool hasPrevData) + { + const string itemSubType = "Weapon"; + const int iconId = 90000001; + + var provider = Services.BuildServiceProvider(); + var store = provider.GetRequiredService(); + + var now = DateTimeOffset.UtcNow; + var avatarAddress = new PrivateKey().Address; + store.StoreAgent(avatarAddress); + store.StoreAvatar(avatarAddress, avatarAddress, "name", now, 1, null, null, 0); + var prevDataCount = 0; + var targetData = new CustomEquipmentCraftModel + { + Id = Guid.NewGuid().ToString(), + BlockIndex = 1L, + AvatarAddress = avatarAddress.ToString(), + EquipmentItemId = 10010001, + RecipeId = 1, + SlotIndex = 1, + ItemSubType = itemSubType, + IconId = 10010001, + ElementalType = "Normal", + DrawingAmount = 1, + DrawingToolAmount = 1, + NcgCost = 0, + AdditionalCost = "", + Date = DateOnly.FromDateTime(now.DateTime), + TimeStamp = now + }; + + if (hasPrevData) + { + prevDataCount = new Random().Next(1, 11); + var cecList = new List(); + for (var i = 0; i < prevDataCount; i++) + { + cecList.Add(targetData); + } + + await store.StoreCustomEquipmentCraftList(cecList); + } + + var countList = Context.CustomEquipmentCraftCount.Where(c => c.ItemSubType == itemSubType).ToList(); + if (hasPrevData) + { + Assert.Single(countList); + var prevData = countList.First(); + Assert.Equal(itemSubType, prevData.ItemSubType); + Assert.Equal(iconId, prevData.IconId); + Assert.Equal(prevDataCount, prevData.Count); + } + else + { + Assert.Empty(countList); + } + + await store.StoreCustomEquipmentCraftList(new List { targetData }); + await Context.Entry(countList).ReloadAsync(); + + Assert.Single(countList); + var data = countList.First(); + Assert.Equal(itemSubType, data.ItemSubType); + Assert.Equal(iconId, data.IconId); + Assert.Equal(prevDataCount + 1, data.Count); + } + + protected override IWorldState GetMockState() + { + return MockWorldState.CreateModern(); + } +} From 6c8a1c97591788cd84127dd990751eaa7aa1ebc7 Mon Sep 17 00:00:00 2001 From: hyeon Date: Wed, 7 Aug 2024 22:25:01 +0900 Subject: [PATCH 05/62] Add ef migration --- ...132232_AddCustomEquipmentCraft.Designer.cs | 4327 +++++++++++++++++ .../20240807132232_AddCustomEquipmentCraft.cs | 80 + .../NineChroniclesContextModelSnapshot.cs | 80 + 3 files changed, 4487 insertions(+) create mode 100644 NineChronicles.DataProvider.Executable/Migrations/20240807132232_AddCustomEquipmentCraft.Designer.cs create mode 100644 NineChronicles.DataProvider.Executable/Migrations/20240807132232_AddCustomEquipmentCraft.cs diff --git a/NineChronicles.DataProvider.Executable/Migrations/20240807132232_AddCustomEquipmentCraft.Designer.cs b/NineChronicles.DataProvider.Executable/Migrations/20240807132232_AddCustomEquipmentCraft.Designer.cs new file mode 100644 index 00000000..bd02eeab --- /dev/null +++ b/NineChronicles.DataProvider.Executable/Migrations/20240807132232_AddCustomEquipmentCraft.Designer.cs @@ -0,0 +1,4327 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using NineChronicles.DataProvider.Store; + +#nullable disable + +namespace NineChronicles.DataProvider.Executable.Migrations +{ + [DbContext(typeof(NineChroniclesContext))] + [Migration("20240807132232_AddCustomEquipmentCraft")] + partial class AddCustomEquipmentCraft + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.1") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AbilityRankingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("AbilityRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ActivateCollectionModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ActionId") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("AvatarAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CollectionId") + .HasColumnType("int"); + + b.Property("CreatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AvatarAddress", "CollectionId") + .IsUnique(); + + b.ToTable("ActivateCollections"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossChallengeModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EndFloor") + .HasColumnType("int"); + + b.Property("Point") + .HasColumnType("int"); + + b.Property("Season") + .HasColumnType("bigint"); + + b.Property("StartFloor") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalPoint") + .HasColumnType("bigint"); + + b.Property("UsedApPotion") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("AdventureBossChallenge"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossClaimRewardModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ClaimedSeason") + .HasColumnType("longtext"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("NcgReward") + .HasColumnType("decimal(65,30)"); + + b.Property("RewardData") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("AdventureBossClaimReward"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossRushModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EndFloor") + .HasColumnType("int"); + + b.Property("Point") + .HasColumnType("int"); + + b.Property("Season") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalPoint") + .HasColumnType("bigint"); + + b.Property("UsedApPotion") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("AdventureBossRush"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossSeasonModel", b => + { + b.Property("Season") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("BossId") + .HasColumnType("int"); + + b.Property("ClaimableBlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EndBlockIndex") + .HasColumnType("bigint"); + + b.Property("FixedRewardData") + .HasColumnType("longtext"); + + b.Property("NextSeasonBlockIndex") + .HasColumnType("bigint"); + + b.Property("RaffleReward") + .HasColumnType("decimal(65,30)"); + + b.Property("RaffleWinnerAddress") + .HasColumnType("varchar(255)"); + + b.Property("RandomRewardData") + .HasColumnType("longtext"); + + b.Property("StartBlockIndex") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Season"); + + b.HasIndex("RaffleWinnerAddress"); + + b.ToTable("AdventureBossSeason"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossUnlockFloorModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Season") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalUsedGoldenDust") + .HasColumnType("bigint"); + + b.Property("TotalUsedNcg") + .HasColumnType("decimal(65,30)"); + + b.Property("UnlockFloor") + .HasColumnType("int"); + + b.Property("UsedGoldenDust") + .HasColumnType("bigint"); + + b.Property("UsedNcg") + .HasColumnType("decimal(65,30)"); + + b.HasKey("Id"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("AdventureBossUnlockFloor"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossWantedModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Bounty") + .HasColumnType("decimal(65,30)"); + + b.Property("Count") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Season") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalBounty") + .HasColumnType("decimal(65,30)"); + + b.HasKey("Id"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("AdventureBossWanted"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AgentModel", b => + { + b.Property("Address") + .HasColumnType("varchar(255)"); + + b.HasKey("Address"); + + b.ToTable("Agents"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ApprovePledgeModel", b => + { + b.Property("TxId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("PatronAddress") + .HasColumnType("longtext"); + + b.Property("Signer") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("TxId"); + + b.HasIndex("Date"); + + b.ToTable("ApprovePledges"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonFailModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Exception") + .HasColumnType("longtext"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.Property("SummonCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("AuraSummonFails"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.Property("SummonCount") + .HasColumnType("int"); + + b.Property("SummonResult") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("AuraSummons"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AvatarModel", b => + { + b.Property("Address") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.HasKey("Address"); + + b.HasIndex("AgentAddress"); + + b.ToTable("Avatars"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleArenaModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("ChampionshipId") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EnemyAvatarAddress") + .HasColumnType("longtext"); + + b.Property("MedalCount") + .HasColumnType("int"); + + b.Property("Round") + .HasColumnType("int"); + + b.Property("TicketCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("Victory") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("BattleArenas"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleArenaRankingModel", b => + { + b.Property("AdditionalTicketPrice") + .HasColumnType("bigint"); + + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArenaType") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ChampionshipId") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EndBlockIndex") + .HasColumnType("bigint"); + + b.Property("EntranceFee") + .HasColumnType("bigint"); + + b.Property("LossCount") + .HasColumnType("int"); + + b.Property("MedalCount") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("PurchasedTicketCount") + .HasColumnType("int"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("RequiredMedalCount") + .HasColumnType("int"); + + b.Property("Round") + .HasColumnType("int"); + + b.Property("Score") + .HasColumnType("int"); + + b.Property("StartBlockIndex") + .HasColumnType("bigint"); + + b.Property("Ticket") + .HasColumnType("int"); + + b.Property("TicketPrice") + .HasColumnType("bigint"); + + b.Property("TicketResetCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.Property("WinCount") + .HasColumnType("int"); + + b.ToTable("BattleArenaRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleGrandFinaleModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("EnemyAvatarAddress") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("GrandFinaleId") + .HasColumnType("int"); + + b.Property("GrandFinaleScore") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("Victory") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("BattleGrandFinales"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BlockModel", b => + { + b.Property("Hash") + .HasColumnType("varchar(255)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Difficulty") + .HasColumnType("bigint"); + + b.Property("Index") + .HasColumnType("bigint"); + + b.Property("Miner") + .HasColumnType("longtext"); + + b.Property("Nonce") + .HasColumnType("longtext"); + + b.Property("PreviousHash") + .HasColumnType("longtext"); + + b.Property("ProtocolVersion") + .HasColumnType("int"); + + b.Property("PublicKey") + .HasColumnType("longtext"); + + b.Property("StateRootHash") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalDifficulty") + .HasColumnType("bigint"); + + b.Property("TxCount") + .HasColumnType("int"); + + b.Property("TxHash") + .HasColumnType("longtext"); + + b.HasKey("Hash"); + + b.HasIndex("Date"); + + b.HasIndex("Index"); + + b.ToTable("Blocks"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ClaimStakeRewardModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ApPotionCount") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ClaimRewardAvatarAddress") + .HasColumnType("longtext"); + + b.Property("ClaimStakeEndBlockIndex") + .HasColumnType("bigint"); + + b.Property("ClaimStakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("HourGlassCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("Date"); + + b.ToTable("ClaimStakeRewards"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationConsumableModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("RecipeId") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("CombinationConsumables"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationEquipmentModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("OptionCount") + .HasColumnType("int"); + + b.Property("RecipeId") + .HasColumnType("int"); + + b.Property("SkillContains") + .HasColumnType("tinyint(1)"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("SubRecipeId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("CombinationEquipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CraftRankingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("CraftCount") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("CraftRankings"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CustomCraft.CustomEquipmentCraftCountModel", b => + { + b.Property("IconId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Count") + .HasColumnType("bigint"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.HasKey("IconId"); + + b.ToTable("CustomEquipmentCraftCount"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CustomCraft.CustomEquipmentCraftModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AdditionalCost") + .HasColumnType("longtext"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("DrawingAmount") + .HasColumnType("int"); + + b.Property("DrawingToolAmount") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("EquipmentItemId") + .HasColumnType("int"); + + b.Property("IconId") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("NcgCost") + .HasColumnType("decimal(65,30)"); + + b.Property("RecipeId") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("CustomEquipmentCraft"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.DailyMetricModel", b => + { + b.Property("Date") + .HasColumnType("date"); + + b.Property("ApUsage") + .HasColumnType("int"); + + b.Property("ArenaNcg") + .HasColumnType("decimal(65,30)"); + + b.Property("AuraSummonCount") + .HasColumnType("int"); + + b.Property("CraftingConsumableCount") + .HasColumnType("int"); + + b.Property("CraftingConsumableUsers") + .HasColumnType("int"); + + b.Property("CraftingEquipmentCount") + .HasColumnType("int"); + + b.Property("CraftingEquipmentUsers") + .HasColumnType("int"); + + b.Property("DailyNew") + .HasColumnType("int"); + + b.Property("Dau") + .HasColumnType("int"); + + b.Property("EnhanceCount") + .HasColumnType("int"); + + b.Property("EnhanceNcg") + .HasColumnType("decimal(65,30)"); + + b.Property("EnhanceUsers") + .HasColumnType("int"); + + b.Property("EventTicketNcg") + .HasColumnType("decimal(65,30)"); + + b.Property("HackAndSlashCount") + .HasColumnType("int"); + + b.Property("HackAndSlashUsers") + .HasColumnType("int"); + + b.Property("HourglassUsage") + .HasColumnType("int"); + + b.Property("NcgTrade") + .HasColumnType("decimal(65,30)"); + + b.Property("RuneNcg") + .HasColumnType("decimal(65,30)"); + + b.Property("RuneSlotNcg") + .HasColumnType("decimal(65,30)"); + + b.Property("RuneSummonCount") + .HasColumnType("int"); + + b.Property("SweepCount") + .HasColumnType("int"); + + b.Property("SweepUsers") + .HasColumnType("int"); + + b.Property("TxCount") + .HasColumnType("int"); + + b.HasKey("Date"); + + b.HasIndex("Date"); + + b.ToTable("DailyMetrics"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("ItemId"); + + b.ToTable("Equipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingArmorModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingArmor"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingBeltModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingBelt"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingNecklaceModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingNecklace"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingRingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingRing"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingWeaponModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingWeapon"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventConsumableItemCraftsModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EventConsumableItemRecipeId") + .HasColumnType("int"); + + b.Property("EventScheduleId") + .HasColumnType("int"); + + b.Property("RequiredItem1Count") + .HasColumnType("int"); + + b.Property("RequiredItem1Id") + .HasColumnType("int"); + + b.Property("RequiredItem2Count") + .HasColumnType("int"); + + b.Property("RequiredItem2Id") + .HasColumnType("int"); + + b.Property("RequiredItem3Count") + .HasColumnType("int"); + + b.Property("RequiredItem3Id") + .HasColumnType("int"); + + b.Property("RequiredItem4Count") + .HasColumnType("int"); + + b.Property("RequiredItem4Id") + .HasColumnType("int"); + + b.Property("RequiredItem5Count") + .HasColumnType("int"); + + b.Property("RequiredItem5Id") + .HasColumnType("int"); + + b.Property("RequiredItem6Count") + .HasColumnType("int"); + + b.Property("RequiredItem6Id") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("EventConsumableItemCrafts"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventDungeonBattleModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("CostumesCount") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EquipmentsCount") + .HasColumnType("int"); + + b.Property("EventDungeonId") + .HasColumnType("int"); + + b.Property("EventDungeonStageId") + .HasColumnType("int"); + + b.Property("EventScheduleId") + .HasColumnType("int"); + + b.Property("FoodsCount") + .HasColumnType("int"); + + b.Property("RemainingTickets") + .HasColumnType("int"); + + b.Property("RewardItem10Count") + .HasColumnType("int"); + + b.Property("RewardItem10Id") + .HasColumnType("int"); + + b.Property("RewardItem1Count") + .HasColumnType("int"); + + b.Property("RewardItem1Id") + .HasColumnType("int"); + + b.Property("RewardItem2Count") + .HasColumnType("int"); + + b.Property("RewardItem2Id") + .HasColumnType("int"); + + b.Property("RewardItem3Count") + .HasColumnType("int"); + + b.Property("RewardItem3Id") + .HasColumnType("int"); + + b.Property("RewardItem4Count") + .HasColumnType("int"); + + b.Property("RewardItem4Id") + .HasColumnType("int"); + + b.Property("RewardItem5Count") + .HasColumnType("int"); + + b.Property("RewardItem5Id") + .HasColumnType("int"); + + b.Property("RewardItem6Count") + .HasColumnType("int"); + + b.Property("RewardItem6Id") + .HasColumnType("int"); + + b.Property("RewardItem7Count") + .HasColumnType("int"); + + b.Property("RewardItem7Id") + .HasColumnType("int"); + + b.Property("RewardItem8Count") + .HasColumnType("int"); + + b.Property("RewardItem8Id") + .HasColumnType("int"); + + b.Property("RewardItem9Count") + .HasColumnType("int"); + + b.Property("RewardItem9Id") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("EventDungeonBattles"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventMaterialItemCraftsModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("EventMaterialItemRecipeId") + .HasColumnType("int"); + + b.Property("EventScheduleId") + .HasColumnType("int"); + + b.Property("Material10Count") + .HasColumnType("int"); + + b.Property("Material10Id") + .HasColumnType("int"); + + b.Property("Material11Count") + .HasColumnType("int"); + + b.Property("Material11Id") + .HasColumnType("int"); + + b.Property("Material12Count") + .HasColumnType("int"); + + b.Property("Material12Id") + .HasColumnType("int"); + + b.Property("Material1Count") + .HasColumnType("int"); + + b.Property("Material1Id") + .HasColumnType("int"); + + b.Property("Material2Count") + .HasColumnType("int"); + + b.Property("Material2Id") + .HasColumnType("int"); + + b.Property("Material3Count") + .HasColumnType("int"); + + b.Property("Material3Id") + .HasColumnType("int"); + + b.Property("Material4Count") + .HasColumnType("int"); + + b.Property("Material4Id") + .HasColumnType("int"); + + b.Property("Material5Count") + .HasColumnType("int"); + + b.Property("Material5Id") + .HasColumnType("int"); + + b.Property("Material6Count") + .HasColumnType("int"); + + b.Property("Material6Id") + .HasColumnType("int"); + + b.Property("Material7Count") + .HasColumnType("int"); + + b.Property("Material7Id") + .HasColumnType("int"); + + b.Property("Material8Count") + .HasColumnType("int"); + + b.Property("Material8Id") + .HasColumnType("int"); + + b.Property("Material9Count") + .HasColumnType("int"); + + b.Property("Material9Id") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("EventMaterialItemCrafts"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.GrindingModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Crystal") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("EquipmentItemId") + .HasColumnType("longtext"); + + b.Property("EquipmentLevel") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("Grindings"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Mimisbrunnr") + .HasColumnType("tinyint(1)"); + + b.Property("StageId") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("HackAndSlashes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashSweepModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("ActionPoint") + .HasColumnType("int"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ApStoneCount") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("CostumesCount") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EquipmentsCount") + .HasColumnType("int"); + + b.Property("Mimisbrunnr") + .HasColumnType("tinyint(1)"); + + b.Property("StageId") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.Property("WorldId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("HackAndSlashSweeps"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasRandomBuffModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("GachaCount") + .HasColumnType("int"); + + b.Property("HasStageId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("HasRandomBuffs"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasWithRandomBuffModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffId") + .HasColumnType("int"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("StageId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("HasWithRandomBuffs"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementFailModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EquipmentItemId") + .HasColumnType("longtext"); + + b.Property("EquipmentLevel") + .HasColumnType("int"); + + b.Property("GainedCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("MaterialIdsCount") + .HasColumnType("int"); + + b.Property("MaterialItemId") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("ItemEnhancementFails"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Exp") + .HasColumnType("bigint"); + + b.Property("HammerCount") + .HasColumnType("int"); + + b.Property("HammerExp") + .HasColumnType("bigint"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("MaterialId") + .HasColumnType("longtext"); + + b.Property("MaterialIdsCount") + .HasColumnType("int"); + + b.Property("SheetId") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("ItemEnhancements"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.JoinArenaModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ArenaRound") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("ChampionshipId") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("JoinArenas"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.MigrateMonsterCollectionModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("MigrationAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("MigrationStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("StakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("Date"); + + b.ToTable("MigrateMonsterCollections"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.PetEnhancementModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("BurntSoulStone") + .HasColumnType("decimal(65,30)"); + + b.Property("ChangedLevel") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("OutputPetLevel") + .HasColumnType("int"); + + b.Property("PetId") + .HasColumnType("int"); + + b.Property("PreviousPetLevel") + .HasColumnType("int"); + + b.Property("TargetLevel") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("PetEnhancements"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RaiderModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Address") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarName") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("CreatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("HighScore") + .HasColumnType("bigint"); + + b.Property("IconId") + .HasColumnType("int"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("PurchaseCount") + .HasColumnType("int"); + + b.Property("RaidId") + .HasColumnType("int"); + + b.Property("TotalScore") + .HasColumnType("bigint"); + + b.Property("UpdatedAt") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("RaidId", "Address") + .IsUnique(); + + b.ToTable("Raiders"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RapidCombinationModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("HourglassCount") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("RapidCombinations"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ReplaceCombinationEquipmentMaterialModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("ReplacedMaterialCount") + .HasColumnType("int"); + + b.Property("ReplacedMaterialId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("ReplaceCombinationEquipmentMaterials"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RequestPledgeModel", b => + { + b.Property("TxId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("PledgeAgentAddress") + .HasColumnType("longtext"); + + b.Property("RefillMead") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxSigner") + .HasColumnType("longtext"); + + b.HasKey("TxId"); + + b.HasIndex("Date"); + + b.ToTable("RequestPledges"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneEnhancementModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("BurntRune") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("OutputRuneLevel") + .HasColumnType("int"); + + b.Property("OutputRuneLevelBonus") + .HasColumnType("int"); + + b.Property("PreviousRuneLevel") + .HasColumnType("int"); + + b.Property("PreviousRuneLevelBonus") + .HasColumnType("int"); + + b.Property("RuneId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TryCount") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("RuneEnhancements"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RunesAcquiredModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("ActionType") + .HasColumnType("varchar(255)"); + + b.Property("TickerType") + .HasColumnType("varchar(255)"); + + b.Property("AcquiredRune") + .HasColumnType("decimal(65,30)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id", "ActionType", "TickerType"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.HasIndex("Id", "ActionType", "TickerType") + .IsUnique(); + + b.ToTable("RunesAcquired"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneSummonFailModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Exception") + .HasColumnType("longtext"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.Property("SummonCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("RuneSummonFails"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneSummonModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.Property("SummonCount") + .HasColumnType("int"); + + b.Property("SummonResult") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("RuneSummons"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopConsumableModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("MainStat") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.HasKey("ItemId"); + + b.ToTable("ShopConsumables"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopCostumeModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Equipped") + .HasColumnType("tinyint(1)"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.HasKey("ItemId"); + + b.ToTable("ShopCostumes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopEquipmentModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SetId") + .HasColumnType("int"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("UniqueStatType") + .HasColumnType("longtext"); + + b.HasKey("ItemId"); + + b.ToTable("ShopEquipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryConsumableModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("MainStat") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.HasIndex("Date"); + + b.ToTable("ShopHistoryConsumables"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryCostumeModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Equipped") + .HasColumnType("tinyint(1)"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.HasIndex("Date"); + + b.ToTable("ShopHistoryCostumes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryEquipmentModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SetId") + .HasColumnType("int"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.Property("UniqueStatType") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.HasIndex("Date"); + + b.ToTable("ShopHistoryEquipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryFungibleAssetValueModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("Quantity") + .HasColumnType("decimal(65,30)"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Ticker") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.HasIndex("Date"); + + b.ToTable("ShopHistoryFungibleAssetValues"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryMaterialModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.HasIndex("Date"); + + b.ToTable("ShopHistoryMaterials"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopMaterialModel", b => + { + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.ToTable("ShopMaterials"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.StageRankingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ClearedStageId") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("StageRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.StakeModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("NewAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("NewStakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("PrevStakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("PreviousAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("RemainingNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("Date"); + + b.ToTable("Stakings"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.TransactionModel", b => + { + b.Property("TxId") + .HasColumnType("varchar(255)"); + + b.Property("ActionType") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("Nonce") + .HasColumnType("bigint"); + + b.Property("PublicKey") + .HasColumnType("longtext"); + + b.Property("Signer") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("UpdatedAddressesCount") + .HasColumnType("int"); + + b.HasKey("TxId"); + + b.HasIndex("Date"); + + b.HasIndex(new[] { "Date", "ActionType" }, "IDX_Date_ActionType"); + + b.ToTable("Transactions"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.TransferAssetModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("Amount") + .HasColumnType("decimal(65,30)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Recipient") + .HasColumnType("longtext"); + + b.Property("Sender") + .HasColumnType("longtext"); + + b.Property("TickerType") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Date"); + + b.ToTable("TransferAssets"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockEquipmentRecipeModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("UnlockEquipmentRecipeId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("UnlockEquipmentRecipes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockRuneSlotModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCRYSTAL") + .HasColumnType("decimal(65,30)"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("UnlockRuneSlots"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockWorldModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("UnlockWorldId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("UnlockWorlds"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserConsumablesModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("MainStat") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UserConsumables"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserCostumesModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Equipped") + .HasColumnType("tinyint(1)"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UserCostumes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserCrystalsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CrystalBalance") + .HasColumnType("decimal(65,30)"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("UserCrystals"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserEquipmentsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SetId") + .HasColumnType("int"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("UniqueStatType") + .HasColumnType("longtext"); + + b.ToTable("UserEquipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserMaterialsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Count") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UserMaterials"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserMonsterCollectionsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("MonsterCollectionAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("ReceivedBlockIndex") + .HasColumnType("bigint"); + + b.Property("RewardLevel") + .HasColumnType("bigint"); + + b.Property("StartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("UserMonsterCollections"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserNCGsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("NCGBalance") + .HasColumnType("decimal(65,30)"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("UserNCGs"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserRunesModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("RuneBalance") + .HasColumnType("decimal(65,30)"); + + b.Property("Ticker") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UserRunes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserStakingsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CancellableBlockIndex") + .HasColumnType("bigint"); + + b.Property("ReceivedBlockIndex") + .HasColumnType("bigint"); + + b.Property("StakeAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("StartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("UserStakings"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.WorldBossRankingModel", b => + { + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("AvatarName") + .HasColumnType("longtext"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("HighScore") + .HasColumnType("int"); + + b.Property("IconId") + .HasColumnType("int"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TotalScore") + .HasColumnType("int"); + + b.ToTable("WorldBossRankings", null, t => t.ExcludeFromMigrations()); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.WorldBossSeasonMigrationModel", b => + { + b.Property("RaidId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("MigratedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.HasKey("RaidId"); + + b.HasIndex("RaidId") + .IsUnique(); + + b.ToTable("WorldBossSeasonMigrationModels"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ActivateCollectionModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany("ActivateCollections") + .HasForeignKey("AvatarAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsMany("NineChronicles.DataProvider.Store.Models.CollectionOptionModel", "Options", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b1.Property("ActivateCollectionId") + .HasColumnType("int"); + + b1.Property("OperationType") + .IsRequired() + .HasColumnType("longtext"); + + b1.Property("StatType") + .IsRequired() + .HasColumnType("longtext"); + + b1.Property("Value") + .HasColumnType("bigint"); + + b1.HasKey("Id"); + + b1.HasIndex("ActivateCollectionId"); + + b1.ToTable("CollectionOptionModel"); + + b1.WithOwner() + .HasForeignKey("ActivateCollectionId"); + }); + + b.Navigation("Avatar"); + + b.Navigation("Options"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossChallengeModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossClaimRewardModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossRushModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossSeasonModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "RaffleWinner") + .WithMany() + .HasForeignKey("RaffleWinnerAddress"); + + b.Navigation("RaffleWinner"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossUnlockFloorModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossWantedModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonFailModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AvatarModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleArenaModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleGrandFinaleModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ClaimStakeRewardModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationConsumableModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationEquipmentModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CustomCraft.CustomEquipmentCraftModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventConsumableItemCraftsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventDungeonBattleModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventMaterialItemCraftsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.GrindingModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashSweepModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasRandomBuffModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasWithRandomBuffModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementFailModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.JoinArenaModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.MigrateMonsterCollectionModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.PetEnhancementModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RapidCombinationModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ReplaceCombinationEquipmentMaterialModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneEnhancementModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RunesAcquiredModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneSummonFailModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneSummonModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.StakeModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockEquipmentRecipeModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockRuneSlotModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockWorldModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserConsumablesModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserCostumesModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserCrystalsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserMaterialsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserMonsterCollectionsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserNCGsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserRunesModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserStakingsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AvatarModel", b => + { + b.Navigation("ActivateCollections"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/NineChronicles.DataProvider.Executable/Migrations/20240807132232_AddCustomEquipmentCraft.cs b/NineChronicles.DataProvider.Executable/Migrations/20240807132232_AddCustomEquipmentCraft.cs new file mode 100644 index 00000000..93886e90 --- /dev/null +++ b/NineChronicles.DataProvider.Executable/Migrations/20240807132232_AddCustomEquipmentCraft.cs @@ -0,0 +1,80 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace NineChronicles.DataProvider.Executable.Migrations +{ + public partial class AddCustomEquipmentCraft : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "CustomEquipmentCraft", + columns: table => new + { + Id = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + BlockIndex = table.Column(type: "bigint", nullable: false), + AvatarAddress = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + EquipmentItemId = table.Column(type: "int", nullable: false), + RecipeId = table.Column(type: "int", nullable: false), + SlotIndex = table.Column(type: "int", nullable: false), + ItemSubType = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IconId = table.Column(type: "int", nullable: false), + ElementalType = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + DrawingAmount = table.Column(type: "int", nullable: false), + DrawingToolAmount = table.Column(type: "int", nullable: false), + NcgCost = table.Column(type: "decimal(65,30)", nullable: false), + AdditionalCost = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Date = table.Column(type: "date", nullable: false), + TimeStamp = table.Column(type: "datetime(6)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_CustomEquipmentCraft", x => x.Id); + table.ForeignKey( + name: "FK_CustomEquipmentCraft_Avatars_AvatarAddress", + column: x => x.AvatarAddress, + principalTable: "Avatars", + principalColumn: "Address"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "CustomEquipmentCraftCount", + columns: table => new + { + IconId = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + ItemSubType = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Count = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_CustomEquipmentCraftCount", x => x.IconId); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_CustomEquipmentCraft_AvatarAddress", + table: "CustomEquipmentCraft", + column: "AvatarAddress"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "CustomEquipmentCraft"); + + migrationBuilder.DropTable( + name: "CustomEquipmentCraftCount"); + } + } +} diff --git a/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs b/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs index c5efded0..3b423873 100644 --- a/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs +++ b/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs @@ -870,6 +870,77 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("CraftRankings"); }); + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CustomCraft.CustomEquipmentCraftCountModel", b => + { + b.Property("IconId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Count") + .HasColumnType("bigint"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.HasKey("IconId"); + + b.ToTable("CustomEquipmentCraftCount"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CustomCraft.CustomEquipmentCraftModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AdditionalCost") + .HasColumnType("longtext"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("DrawingAmount") + .HasColumnType("int"); + + b.Property("DrawingToolAmount") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("EquipmentItemId") + .HasColumnType("int"); + + b.Property("IconId") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("NcgCost") + .HasColumnType("decimal(65,30)"); + + b.Property("RecipeId") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("CustomEquipmentCraft"); + }); + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.DailyMetricModel", b => { b.Property("Date") @@ -3802,6 +3873,15 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("Avatar"); }); + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CustomCraft.CustomEquipmentCraftModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Avatar"); + }); + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventConsumableItemCraftsModel", b => { b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") From 8c6fb899f462747518906fafed2d42c6b0f49f70 Mon Sep 17 00:00:00 2001 From: hyeon Date: Wed, 7 Aug 2024 22:40:52 +0900 Subject: [PATCH 06/62] Add GQL endpoint to get custom craft count per icon: test needed --- .../CustomEquipmentCraftIconCountType.cs | 16 ++++++++++++++++ .../Queries/NineChroniclesSummaryQuery.cs | 16 ++++++++++++++++ .../Store/MySql/CustomCraftStore.cs | 10 +++++++++- NineChronicles.DataProvider/Store/MySqlStore.cs | 2 ++ 4 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 NineChronicles.DataProvider/GraphTypes/CustomEquipmentCraftIconCountType.cs diff --git a/NineChronicles.DataProvider/GraphTypes/CustomEquipmentCraftIconCountType.cs b/NineChronicles.DataProvider/GraphTypes/CustomEquipmentCraftIconCountType.cs new file mode 100644 index 00000000..a8b82e89 --- /dev/null +++ b/NineChronicles.DataProvider/GraphTypes/CustomEquipmentCraftIconCountType.cs @@ -0,0 +1,16 @@ +namespace NineChronicles.DataProvider.GraphTypes +{ + using GraphQL.Types; + using NineChronicles.DataProvider.Store.Models.CustomCraft; + + public class CustomEquipmentCraftIconCountType : ObjectGraphType + { + public CustomEquipmentCraftIconCountType() + { + Name = "CustomEquipmentCraftIconCount"; + Field(x => x.ItemSubType); + Field(x => x.IconId); + Field(x => x.Count); + } + } +} diff --git a/NineChronicles.DataProvider/Queries/NineChroniclesSummaryQuery.cs b/NineChronicles.DataProvider/Queries/NineChroniclesSummaryQuery.cs index bb7bcb04..30a240eb 100644 --- a/NineChronicles.DataProvider/Queries/NineChroniclesSummaryQuery.cs +++ b/NineChronicles.DataProvider/Queries/NineChroniclesSummaryQuery.cs @@ -353,6 +353,22 @@ public NineChroniclesSummaryQuery(MySqlStore store, StandaloneContext standalone throw new ExecutionError("can't receive"); } ); + + Field>( + "customEquipmentCraftIconCount", + arguments: new QueryArguments( + new QueryArgument> + { + Name = "itemSubType", + Description = "ItemSubType to get craft count for icons", + } + ), + resolve: context => + { + var itemSubType = context.GetArgument("itemSubType"); + return Store.GetCustomEquipmentCraftCount(itemSubType); + } + ); } private MySqlStore Store { get; } diff --git a/NineChronicles.DataProvider/Store/MySql/CustomCraftStore.cs b/NineChronicles.DataProvider/Store/MySql/CustomCraftStore.cs index 9617952f..3647b319 100644 --- a/NineChronicles.DataProvider/Store/MySql/CustomCraftStore.cs +++ b/NineChronicles.DataProvider/Store/MySql/CustomCraftStore.cs @@ -2,6 +2,7 @@ namespace NineChronicles.DataProvider.Store { using System; using System.Collections.Generic; + using System.Linq; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; using NineChronicles.DataProvider.Store.Models.CustomCraft; @@ -9,7 +10,8 @@ namespace NineChronicles.DataProvider.Store public partial class MySqlStore { - public async partial Task StoreCustomEquipmentCraftList(List customEquipmentCraftList) + public async partial Task StoreCustomEquipmentCraftList( + List customEquipmentCraftList) { NineChroniclesContext? ctx = null; try @@ -64,5 +66,11 @@ await ctx.CustomEquipmentCraftCount.AddAsync(new CustomEquipmentCraftCountModel } } } + + public partial List GetCustomEquipmentCraftCount(string itemSubType) + { + using var ctx = _dbContextFactory.CreateDbContext(); + return ctx.CustomEquipmentCraftCount.Where(c => c.ItemSubType == itemSubType).ToList(); + } } } diff --git a/NineChronicles.DataProvider/Store/MySqlStore.cs b/NineChronicles.DataProvider/Store/MySqlStore.cs index 8753a445..747b04c5 100644 --- a/NineChronicles.DataProvider/Store/MySqlStore.cs +++ b/NineChronicles.DataProvider/Store/MySqlStore.cs @@ -1959,6 +1959,8 @@ public void StoreRuneSummonFailList(List runeSummonFailList // CustomCraft public partial Task StoreCustomEquipmentCraftList(List customEquipmentCraftList); + + public partial List GetCustomEquipmentCraftCount(string itemSubType); /* CustomCraft */ public List GetRaiderList() From 46c79bb6205435b4f5bc98dd604aaed9968adb53 Mon Sep 17 00:00:00 2001 From: hyeon Date: Thu, 8 Aug 2024 10:11:49 +0900 Subject: [PATCH 07/62] Fix broken test --- .../Store/CustomEquipmentCraftStoreTest.cs | 66 ++++++++++++------- .../Store/MySql/CustomCraftStore.cs | 13 +++- 2 files changed, 55 insertions(+), 24 deletions(-) diff --git a/NineChronicles.DataProvider.Tests/Store/CustomEquipmentCraftStoreTest.cs b/NineChronicles.DataProvider.Tests/Store/CustomEquipmentCraftStoreTest.cs index 7f3dba57..407d6466 100644 --- a/NineChronicles.DataProvider.Tests/Store/CustomEquipmentCraftStoreTest.cs +++ b/NineChronicles.DataProvider.Tests/Store/CustomEquipmentCraftStoreTest.cs @@ -30,38 +30,38 @@ public async Task UpsertCraftCount(bool hasPrevData) store.StoreAgent(avatarAddress); store.StoreAvatar(avatarAddress, avatarAddress, "name", now, 1, null, null, 0); var prevDataCount = 0; - var targetData = new CustomEquipmentCraftModel - { - Id = Guid.NewGuid().ToString(), - BlockIndex = 1L, - AvatarAddress = avatarAddress.ToString(), - EquipmentItemId = 10010001, - RecipeId = 1, - SlotIndex = 1, - ItemSubType = itemSubType, - IconId = 10010001, - ElementalType = "Normal", - DrawingAmount = 1, - DrawingToolAmount = 1, - NcgCost = 0, - AdditionalCost = "", - Date = DateOnly.FromDateTime(now.DateTime), - TimeStamp = now - }; if (hasPrevData) { prevDataCount = new Random().Next(1, 11); var cecList = new List(); + var guid = Guid.NewGuid().ToString(); for (var i = 0; i < prevDataCount; i++) { - cecList.Add(targetData); + cecList.Add(new CustomEquipmentCraftModel + { + Id = $"{guid}_{i}", + BlockIndex = 1L, + AvatarAddress = avatarAddress.ToString(), + EquipmentItemId = 10010001, + RecipeId = 1, + SlotIndex = 1, + ItemSubType = itemSubType, + IconId = iconId, + ElementalType = "Normal", + DrawingAmount = 1, + DrawingToolAmount = 1, + NcgCost = 0, + AdditionalCost = "", + Date = DateOnly.FromDateTime(now.DateTime), + TimeStamp = now + }); } await store.StoreCustomEquipmentCraftList(cecList); } - var countList = Context.CustomEquipmentCraftCount.Where(c => c.ItemSubType == itemSubType).ToList(); + var countList = store.GetCustomEquipmentCraftCount(itemSubType); if (hasPrevData) { Assert.Single(countList); @@ -75,9 +75,31 @@ public async Task UpsertCraftCount(bool hasPrevData) Assert.Empty(countList); } - await store.StoreCustomEquipmentCraftList(new List { targetData }); - await Context.Entry(countList).ReloadAsync(); + // Add new data + await store.StoreCustomEquipmentCraftList(new List + { + new() + { + Id = Guid.NewGuid().ToString(), + BlockIndex = 1L, + AvatarAddress = avatarAddress.ToString(), + EquipmentItemId = 10010001, + RecipeId = 1, + SlotIndex = 1, + ItemSubType = itemSubType, + IconId = iconId, + ElementalType = "Normal", + DrawingAmount = 1, + DrawingToolAmount = 1, + NcgCost = 0, + AdditionalCost = "", + Date = DateOnly.FromDateTime(now.DateTime), + TimeStamp = now + } + }); + countList = store.GetCustomEquipmentCraftCount(itemSubType); + // Test Assert.Single(countList); var data = countList.First(); Assert.Equal(itemSubType, data.ItemSubType); diff --git a/NineChronicles.DataProvider/Store/MySql/CustomCraftStore.cs b/NineChronicles.DataProvider/Store/MySql/CustomCraftStore.cs index 3647b319..34ed1990 100644 --- a/NineChronicles.DataProvider/Store/MySql/CustomCraftStore.cs +++ b/NineChronicles.DataProvider/Store/MySql/CustomCraftStore.cs @@ -11,7 +11,8 @@ namespace NineChronicles.DataProvider.Store public partial class MySqlStore { public async partial Task StoreCustomEquipmentCraftList( - List customEquipmentCraftList) + List customEquipmentCraftList + ) { NineChroniclesContext? ctx = null; try @@ -26,7 +27,15 @@ public async partial Task StoreCustomEquipmentCraftList( { if (await ctx.CustomEquipmentCraft.FirstOrDefaultAsync(c => c.Id == craftData.Id) is null) { - iconCraftCountDict[(craftData.ItemSubType!, craftData.IconId)]++; + if (iconCraftCountDict.ContainsKey((craftData.ItemSubType!, craftData.IconId))) + { + iconCraftCountDict[(craftData.ItemSubType!, craftData.IconId)]++; + } + else + { + iconCraftCountDict[(craftData.ItemSubType!, craftData.IconId)] = 1; + } + await ctx.CustomEquipmentCraft.AddAsync(craftData); } } From ae6a1ede02a239bec751af223ab672e45e23427b Mon Sep 17 00:00:00 2001 From: hyeon Date: Thu, 8 Aug 2024 17:19:31 +0900 Subject: [PATCH 08/62] Bump headless --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index 2ee19e37..532b7e16 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit 2ee19e37a42c1a17265afc4c93f1662d2d6dbec0 +Subproject commit 532b7e16129390de3066b411c44d27a8cbbd0133 From 3bb82f1545842a1a853b0908f560306cd30ed923 Mon Sep 17 00:00:00 2001 From: hyeon Date: Fri, 9 Aug 2024 14:12:25 +0900 Subject: [PATCH 09/62] Bump headless: Merge grind reward --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index 532b7e16..242357e0 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit 532b7e16129390de3066b411c44d27a8cbbd0133 +Subproject commit 242357e03de2c6b722899cfd59451c3ed01e47de From cc5f22ad54cfc6e353ad8786033d7760c844d5e5 Mon Sep 17 00:00:00 2001 From: hyeon Date: Mon, 12 Aug 2024 17:55:26 +0900 Subject: [PATCH 10/62] Test : Remove code according to headless --- NineChronicles.DataProvider/GraphQLStartup.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/NineChronicles.DataProvider/GraphQLStartup.cs b/NineChronicles.DataProvider/GraphQLStartup.cs index 3591caae..f3fecba5 100644 --- a/NineChronicles.DataProvider/GraphQLStartup.cs +++ b/NineChronicles.DataProvider/GraphQLStartup.cs @@ -43,8 +43,7 @@ public void ConfigureServices(IServiceCollection services) .AddDataLoader() .AddGraphTypes(typeof(NineChroniclesSummarySchema)) .AddGraphTypes(typeof(StandaloneSchema)) - .AddLibplanetExplorer() - .AddUserContextBuilder(); + .AddLibplanetExplorer(); services.AddSingleton(); services.AddGraphTypes(); services.AddSingleton(); From 7a0691d45724f1e1b14fa23af4b2b798315d54db Mon Sep 17 00:00:00 2001 From: hyeon Date: Tue, 13 Aug 2024 11:06:06 +0900 Subject: [PATCH 11/62] Bump headless --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index 242357e0..b07555cf 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit 242357e03de2c6b722899cfd59451c3ed01e47de +Subproject commit b07555cfc5fdbbf5419b3d8a4465f3b9da4fd23f From 2287382ff9eff93b9cb56580349b8f542700e8e3 Mon Sep 17 00:00:00 2001 From: hyeon Date: Tue, 13 Aug 2024 17:43:23 +0900 Subject: [PATCH 12/62] Update save logic - Get equipment data from combination slot, not creating it - Fix wrong item ID field (why set it to 1?) --- .../CustomCraft/CustomEquipmentCraftData.cs | 51 ++++++------------- .../Subscriber/CustomCraftRenderSubscriber.cs | 3 +- 2 files changed, 17 insertions(+), 37 deletions(-) diff --git a/NineChronicles.DataProvider/DataRendering/CustomCraft/CustomEquipmentCraftData.cs b/NineChronicles.DataProvider/DataRendering/CustomCraft/CustomEquipmentCraftData.cs index 67fad1f3..f6ea4e76 100644 --- a/NineChronicles.DataProvider/DataRendering/CustomCraft/CustomEquipmentCraftData.cs +++ b/NineChronicles.DataProvider/DataRendering/CustomCraft/CustomEquipmentCraftData.cs @@ -9,7 +9,6 @@ namespace NineChronicles.DataProvider.DataRendering.CustomCraft using Nekoyume.Action.CustomEquipmentCraft; using Nekoyume.Extensions; using Nekoyume.Helper; - using Nekoyume.Model.Elemental; using Nekoyume.Model.Item; using Nekoyume.Module; using Nekoyume.TableData; @@ -21,29 +20,30 @@ public static class CustomEquipmentCraftData { public static List GetCraftInfo( IWorld prevStates, + IWorld outputStates, long blockIndex, DateTimeOffset blockTime, - IRandom random, CustomEquipmentCraft craftData ) { Log.Verbose($"[CustomEquipmentCraft] GetCraftData"); - var craftList = new List(); + Dictionary sheets = prevStates.GetSheets(sheetTypes: new[] + { + typeof(CustomEquipmentCraftRecipeSheet), + typeof(CustomEquipmentCraftRelationshipSheet), + typeof(CustomEquipmentCraftIconSheet), + typeof(CustomEquipmentCraftCostSheet), + typeof(EquipmentItemSheet), + typeof(MaterialItemSheet), + }); + + var craftList = new List(); var i = 0; foreach (var craft in craftData.CraftList) { var guid = Guid.NewGuid().ToString(); - - Dictionary sheets = prevStates.GetSheets(sheetTypes: new[] - { - typeof(CustomEquipmentCraftRecipeSheet), - typeof(CustomEquipmentCraftRelationshipSheet), - typeof(CustomEquipmentCraftIconSheet), - typeof(CustomEquipmentCraftCostSheet), - typeof(EquipmentItemSheet), - typeof(MaterialItemSheet), - }); + var equipment = outputStates.GetCombinationSlotState(craftData.AvatarAddress, craft.SlotIndex).Result!.itemUsable!; var relationship = prevStates.GetRelationship(craftData.AvatarAddress); var recipeSheet = sheets.GetSheet(); @@ -85,37 +85,16 @@ CustomEquipmentCraft craftData } } - // Create equipment with ItemFactory - var uid = random.GenerateRandomGuid(); - var equipmentItemId = relationshipRow.GetItemId(recipeRow.ItemSubType); - var equipmentRow = sheets.GetSheet()[equipmentItemId]; - var equipment = - (Equipment)ItemFactory.CreateItemUsable(equipmentRow, uid, 0L); - - // Set Icon - equipment.IconId = ItemFactory.SelectIconId( - craft.IconId, - craft.IconId == CustomEquipmentCraft.RandomIconId, - equipmentRow, - relationship, - sheets.GetSheet(), - random - ); - - // Set Elemental Type - var elementalList = (ElementalType[])Enum.GetValues(typeof(ElementalType)); - equipment.ElementalType = elementalList[random.Next(elementalList.Length)]; - craftList.Add(new CustomEquipmentCraftModel { Id = $"{guid}_{i++}", BlockIndex = blockIndex, AvatarAddress = craftData.AvatarAddress.ToString(), - EquipmentItemId = 1, + EquipmentItemId = equipment.Id, RecipeId = craft.RecipeId, SlotIndex = craft.SlotIndex, ItemSubType = equipment.ItemSubType.ToString(), - IconId = equipment.IconId, + IconId = equipment.Id, ElementalType = equipment.ElementalType.ToString(), DrawingAmount = drawingAmount, DrawingToolAmount = drawingToolAmount, diff --git a/NineChronicles.DataProvider/Subscriber/CustomCraftRenderSubscriber.cs b/NineChronicles.DataProvider/Subscriber/CustomCraftRenderSubscriber.cs index 1c0b0b90..9a2094d9 100644 --- a/NineChronicles.DataProvider/Subscriber/CustomCraftRenderSubscriber.cs +++ b/NineChronicles.DataProvider/Subscriber/CustomCraftRenderSubscriber.cs @@ -46,11 +46,12 @@ partial void SubscribeCustomEquipmentCraft(ActionEvaluation Date: Wed, 14 Aug 2024 21:27:18 +0900 Subject: [PATCH 13/62] Use same guid for same action --- .../DataRendering/CustomCraft/CustomEquipmentCraftData.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/NineChronicles.DataProvider/DataRendering/CustomCraft/CustomEquipmentCraftData.cs b/NineChronicles.DataProvider/DataRendering/CustomCraft/CustomEquipmentCraftData.cs index f6ea4e76..886dfd60 100644 --- a/NineChronicles.DataProvider/DataRendering/CustomCraft/CustomEquipmentCraftData.cs +++ b/NineChronicles.DataProvider/DataRendering/CustomCraft/CustomEquipmentCraftData.cs @@ -40,10 +40,12 @@ CustomEquipmentCraft craftData var craftList = new List(); var i = 0; + var guid = Guid.NewGuid().ToString(); + foreach (var craft in craftData.CraftList) { - var guid = Guid.NewGuid().ToString(); - var equipment = outputStates.GetCombinationSlotState(craftData.AvatarAddress, craft.SlotIndex).Result!.itemUsable!; + var equipment = outputStates.GetCombinationSlotState(craftData.AvatarAddress, craft.SlotIndex) + .Result!.itemUsable!; var relationship = prevStates.GetRelationship(craftData.AvatarAddress); var recipeSheet = sheets.GetSheet(); From 8425d503eadc7d02ae74b39caa27b6a94b24676b Mon Sep 17 00:00:00 2001 From: hyeon Date: Wed, 14 Aug 2024 21:27:28 +0900 Subject: [PATCH 14/62] Waint until all saves done --- .../Subscriber/CustomCraftRenderSubscriber.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NineChronicles.DataProvider/Subscriber/CustomCraftRenderSubscriber.cs b/NineChronicles.DataProvider/Subscriber/CustomCraftRenderSubscriber.cs index 9a2094d9..6466c63e 100644 --- a/NineChronicles.DataProvider/Subscriber/CustomCraftRenderSubscriber.cs +++ b/NineChronicles.DataProvider/Subscriber/CustomCraftRenderSubscriber.cs @@ -25,6 +25,8 @@ public void StoreCustomEquipmentCraftList() Log.Debug($"[CustomCraft] {_customEquipmentCraftList.Count} craft data"); await MySqlStore.StoreCustomEquipmentCraftList(_customEquipmentCraftList); })); + + Task.WaitAll(tasks.ToArray()); } catch (Exception e) { From 263016eb87641de1dcfd8bc3798f863936332659 Mon Sep 17 00:00:00 2001 From: hyeon Date: Wed, 14 Aug 2024 21:30:25 +0900 Subject: [PATCH 15/62] Save IconId, not Equipment Id --- .../DataRendering/CustomCraft/CustomEquipmentCraftData.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/NineChronicles.DataProvider/DataRendering/CustomCraft/CustomEquipmentCraftData.cs b/NineChronicles.DataProvider/DataRendering/CustomCraft/CustomEquipmentCraftData.cs index 886dfd60..8aa499e6 100644 --- a/NineChronicles.DataProvider/DataRendering/CustomCraft/CustomEquipmentCraftData.cs +++ b/NineChronicles.DataProvider/DataRendering/CustomCraft/CustomEquipmentCraftData.cs @@ -44,8 +44,8 @@ CustomEquipmentCraft craftData foreach (var craft in craftData.CraftList) { - var equipment = outputStates.GetCombinationSlotState(craftData.AvatarAddress, craft.SlotIndex) - .Result!.itemUsable!; + var equipment = (Equipment)outputStates + .GetCombinationSlotState(craftData.AvatarAddress, craft.SlotIndex).Result!.itemUsable!; var relationship = prevStates.GetRelationship(craftData.AvatarAddress); var recipeSheet = sheets.GetSheet(); @@ -96,7 +96,7 @@ CustomEquipmentCraft craftData RecipeId = craft.RecipeId, SlotIndex = craft.SlotIndex, ItemSubType = equipment.ItemSubType.ToString(), - IconId = equipment.Id, + IconId = equipment.IconId, ElementalType = equipment.ElementalType.ToString(), DrawingAmount = drawingAmount, DrawingToolAmount = drawingToolAmount, From 7e957c8d47bed99efde3d5f72e0331b0ba995205 Mon Sep 17 00:00:00 2001 From: hyeon Date: Wed, 14 Aug 2024 21:54:18 +0900 Subject: [PATCH 16/62] Update custom craft count GQL - Now the `itemSubType` parameter is nullable - If no `itemSubType` parameter provided, return all data --- .../Queries/NineChroniclesSummaryQuery.cs | 4 ++-- NineChronicles.DataProvider/Store/MySql/CustomCraftStore.cs | 6 ++++-- NineChronicles.DataProvider/Store/MySqlStore.cs | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/NineChronicles.DataProvider/Queries/NineChroniclesSummaryQuery.cs b/NineChronicles.DataProvider/Queries/NineChroniclesSummaryQuery.cs index 30a240eb..b83b61df 100644 --- a/NineChronicles.DataProvider/Queries/NineChroniclesSummaryQuery.cs +++ b/NineChronicles.DataProvider/Queries/NineChroniclesSummaryQuery.cs @@ -357,7 +357,7 @@ public NineChroniclesSummaryQuery(MySqlStore store, StandaloneContext standalone Field>( "customEquipmentCraftIconCount", arguments: new QueryArguments( - new QueryArgument> + new QueryArgument { Name = "itemSubType", Description = "ItemSubType to get craft count for icons", @@ -365,7 +365,7 @@ public NineChroniclesSummaryQuery(MySqlStore store, StandaloneContext standalone ), resolve: context => { - var itemSubType = context.GetArgument("itemSubType"); + var itemSubType = context.GetArgument("itemSubType"); return Store.GetCustomEquipmentCraftCount(itemSubType); } ); diff --git a/NineChronicles.DataProvider/Store/MySql/CustomCraftStore.cs b/NineChronicles.DataProvider/Store/MySql/CustomCraftStore.cs index 34ed1990..bbc7a186 100644 --- a/NineChronicles.DataProvider/Store/MySql/CustomCraftStore.cs +++ b/NineChronicles.DataProvider/Store/MySql/CustomCraftStore.cs @@ -76,10 +76,12 @@ await ctx.CustomEquipmentCraftCount.AddAsync(new CustomEquipmentCraftCountModel } } - public partial List GetCustomEquipmentCraftCount(string itemSubType) + public partial List GetCustomEquipmentCraftCount(string? itemSubType) { using var ctx = _dbContextFactory.CreateDbContext(); - return ctx.CustomEquipmentCraftCount.Where(c => c.ItemSubType == itemSubType).ToList(); + return itemSubType is null + ? ctx.CustomEquipmentCraftCount.ToList() + : ctx.CustomEquipmentCraftCount.Where(c => c.ItemSubType == itemSubType).ToList(); } } } diff --git a/NineChronicles.DataProvider/Store/MySqlStore.cs b/NineChronicles.DataProvider/Store/MySqlStore.cs index 747b04c5..d77d355d 100644 --- a/NineChronicles.DataProvider/Store/MySqlStore.cs +++ b/NineChronicles.DataProvider/Store/MySqlStore.cs @@ -1960,7 +1960,7 @@ public void StoreRuneSummonFailList(List runeSummonFailList // CustomCraft public partial Task StoreCustomEquipmentCraftList(List customEquipmentCraftList); - public partial List GetCustomEquipmentCraftCount(string itemSubType); + public partial List GetCustomEquipmentCraftCount(string? itemSubType); /* CustomCraft */ public List GetRaiderList() From ac7f6e43a0a67516741cf65263bcd6081476f190 Mon Sep 17 00:00:00 2001 From: hyeon Date: Mon, 19 Aug 2024 11:31:28 +0900 Subject: [PATCH 17/62] Bump headless --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index b07555cf..bd00af42 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit b07555cfc5fdbbf5419b3d8a4465f3b9da4fd23f +Subproject commit bd00af423533cb55d1e82a4e954f8b30e398502a From da2833874f492d9a403d8346f6c8268fa60d2826 Mon Sep 17 00:00:00 2001 From: hyeon Date: Mon, 19 Aug 2024 17:38:53 +0900 Subject: [PATCH 18/62] Bump headless --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index bd00af42..fe6d94f0 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit bd00af423533cb55d1e82a4e954f8b30e398502a +Subproject commit fe6d94f0ede4ffb3ef8940081d873dce14e2064f From d443512b7a13aa07cafef5d0d2f346d2b68a6e32 Mon Sep 17 00:00:00 2001 From: hyeon Date: Wed, 21 Aug 2024 22:06:39 +0900 Subject: [PATCH 19/62] Bump headless --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index fe6d94f0..51bc3945 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit fe6d94f0ede4ffb3ef8940081d873dce14e2064f +Subproject commit 51bc3945c5853a30b8098ab23ff744004d82bf5c From 3c14c4b066d52eab8435e9da5be4f40d6fad67aa Mon Sep 17 00:00:00 2001 From: hyeon Date: Thu, 22 Aug 2024 17:28:20 +0900 Subject: [PATCH 20/62] Bump headless --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index 51bc3945..76c39620 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit 51bc3945c5853a30b8098ab23ff744004d82bf5c +Subproject commit 76c3962065d1a3d6d0085dfb220e05342965ae1a From 8c062605f8f0246f3f6d8f6c2cecdf6dfd2e1bdd Mon Sep 17 00:00:00 2001 From: hyeon Date: Fri, 23 Aug 2024 13:31:30 +0900 Subject: [PATCH 21/62] Get AllCombinationSlotState to get combination slot --- .../Commands/MySqlMigration.cs | 12 ++++++------ .../CustomCraft/CustomEquipmentCraftData.cs | 4 ++-- .../DataRendering/RapidCombinationData.cs | 2 +- NineChronicles.DataProvider/RenderSubscriber.cs | 14 ++++++-------- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs b/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs index 4033f96a..22bf60ec 100644 --- a/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs +++ b/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs @@ -598,9 +598,9 @@ private void ProcessTasks(Task>[] taskArray, IB (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = outputState.GetCombinationSlotState( - combinationEquipment.avatarAddress, - combinationEquipment.slotIndex); + var slotState = outputState + .GetAllCombinationSlotState(combinationEquipment.avatarAddress) + .GetSlot(combinationEquipment.slotIndex); int optionCount = 0; bool skillContains = false; @@ -672,9 +672,9 @@ private void ProcessTasks(Task>[] taskArray, IB Console.WriteLine("Writing ItemEnhancement action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = outputState.GetCombinationSlotState( - itemEnhancement.avatarAddress, - itemEnhancement.slotIndex); + var slotState = outputState + .GetAllCombinationSlotState(itemEnhancement.avatarAddress) + .GetSlot(itemEnhancement.slotIndex); if (slotState?.Result.itemUsable.ItemType is ItemType.Equipment) { diff --git a/NineChronicles.DataProvider/DataRendering/CustomCraft/CustomEquipmentCraftData.cs b/NineChronicles.DataProvider/DataRendering/CustomCraft/CustomEquipmentCraftData.cs index 8aa499e6..a4d28676 100644 --- a/NineChronicles.DataProvider/DataRendering/CustomCraft/CustomEquipmentCraftData.cs +++ b/NineChronicles.DataProvider/DataRendering/CustomCraft/CustomEquipmentCraftData.cs @@ -44,8 +44,8 @@ CustomEquipmentCraft craftData foreach (var craft in craftData.CraftList) { - var equipment = (Equipment)outputStates - .GetCombinationSlotState(craftData.AvatarAddress, craft.SlotIndex).Result!.itemUsable!; + var equipment = (Equipment)outputStates.GetAllCombinationSlotState(craftData.AvatarAddress) + .GetSlot(craft.SlotIndex).Result!.itemUsable!; var relationship = prevStates.GetRelationship(craftData.AvatarAddress); var recipeSheet = sheets.GetSheet(); diff --git a/NineChronicles.DataProvider/DataRendering/RapidCombinationData.cs b/NineChronicles.DataProvider/DataRendering/RapidCombinationData.cs index 5997e293..7146c396 100644 --- a/NineChronicles.DataProvider/DataRendering/RapidCombinationData.cs +++ b/NineChronicles.DataProvider/DataRendering/RapidCombinationData.cs @@ -21,7 +21,7 @@ DateTimeOffset blockTime ) { var states = previousStates; - var slotState = states.GetCombinationSlotState(avatarAddress, slotIndex); + var slotState = states.GetAllCombinationSlotState(avatarAddress).GetSlot(slotIndex); var diff = slotState.Result.itemUsable.RequiredBlockIndex - blockIndex; var gameConfigState = states.GetGameConfigState(); var count = RapidCombination0.CalculateHourglassCount(gameConfigState, diff); diff --git a/NineChronicles.DataProvider/RenderSubscriber.cs b/NineChronicles.DataProvider/RenderSubscriber.cs index 58e8c315..6afe62a9 100644 --- a/NineChronicles.DataProvider/RenderSubscriber.cs +++ b/NineChronicles.DataProvider/RenderSubscriber.cs @@ -577,9 +577,8 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = outputState.GetCombinationSlotState( - combinationEquipment.avatarAddress, - combinationEquipment.slotIndex); + var slotState = outputState.GetAllCombinationSlotState(combinationEquipment.avatarAddress) + .GetSlot(combinationEquipment.slotIndex); int optionCount = 0; bool skillContains = false; @@ -684,9 +683,8 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) Log.Debug("[DataProvider] Stored ItemEnhancement action in block #{index}. Time Taken: {time} ms.", ev.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = outputState.GetCombinationSlotState( - itemEnhancement.avatarAddress, - itemEnhancement.slotIndex); + var slotState = outputState.GetAllCombinationSlotState(itemEnhancement.avatarAddress) + .GetSlot(itemEnhancement.slotIndex); if (slotState?.Result.itemUsable.ItemType is ItemType.Equipment) { @@ -732,7 +730,7 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) foreach (var purchaseInfo in buy.purchaseInfos) { var state = outputState.GetLegacyState( - Addresses.GetItemAddress(purchaseInfo.TradableId)); + Addresses.GetItemAddress(purchaseInfo.TradableId)); ITradableItem orderItem = (ITradableItem)ItemFactory.Deserialize((Dictionary)state!); Order order = @@ -1592,7 +1590,7 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) auraSummon.Id, ev.BlockIndex, _blockTimeOffset - )); + )); } else { From f544cf128dba1db6f838edf073df5237d50bcb19 Mon Sep 17 00:00:00 2001 From: hyeon Date: Fri, 23 Aug 2024 13:36:51 +0900 Subject: [PATCH 22/62] Bump headless --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index 76c39620..ee43cdb5 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit 76c3962065d1a3d6d0085dfb220e05342965ae1a +Subproject commit ee43cdb5684a2826f5d3bc96a2ff63864d7b85aa From 407d247bcfa43c9716f4e2d4574fd018611ba276 Mon Sep 17 00:00:00 2001 From: Yang Chun Ung Date: Wed, 28 Aug 2024 18:45:44 +0900 Subject: [PATCH 23/62] Bump headless for hotfix --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index 8d3df2ad..ee4e1578 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit 8d3df2ada4b9ed38b8d94a228286d6050b933ea8 +Subproject commit ee4e15786c35c71b9959270227069b574abda070 From e4d0ad2925999c690253dea092b60d88bcfc6545 Mon Sep 17 00:00:00 2001 From: moreal Date: Thu, 29 Aug 2024 14:00:20 +0900 Subject: [PATCH 24/62] Bump headless to 192 --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index ee4e1578..40fa2f83 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit ee4e15786c35c71b9959270227069b574abda070 +Subproject commit 40fa2f8336de64c33e9248577f3dc25659b5633b From e4938a896fa55a7e3a6026ca6f0068aeccde9072 Mon Sep 17 00:00:00 2001 From: sonohoshi Date: Thu, 29 Aug 2024 14:39:36 +0900 Subject: [PATCH 25/62] bump headless --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index ee43cdb5..427a5b7f 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit ee43cdb5684a2826f5d3bc96a2ff63864d7b85aa +Subproject commit 427a5b7f347410b744587536660fffa48d42d74c From ed861b2683f8568f56425a78cee1bb48c9ff147b Mon Sep 17 00:00:00 2001 From: hyeon Date: Thu, 29 Aug 2024 15:13:19 +0900 Subject: [PATCH 26/62] Bump headless --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index 40fa2f83..e0ca6d3b 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit 40fa2f8336de64c33e9248577f3dc25659b5633b +Subproject commit e0ca6d3bd6e4ffd14bc86b7565cc23945fd95cca From ed7ddc6e8f1e5f261722e3a13b297fedb2910c94 Mon Sep 17 00:00:00 2001 From: hyeon Date: Tue, 10 Sep 2024 11:26:05 +0900 Subject: [PATCH 27/62] Bump headless --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index e0ca6d3b..23fd4019 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit e0ca6d3bd6e4ffd14bc86b7565cc23945fd95cca +Subproject commit 23fd4019385a938ad35dc3b088090059df3d8464 From a1ee50caef81f4c1e98d41c4ab1f10f28ada1910 Mon Sep 17 00:00:00 2001 From: hyeon Date: Tue, 10 Sep 2024 13:54:46 +0900 Subject: [PATCH 28/62] Apply new AllCombinationSlotState model --- .../Commands/MySqlMigration.cs | 19 +++++---- .../ItemEnhancementDataTest.cs | 22 ++++++++-- .../DataRendering/RapidCombinationData.cs | 40 +++++++++++-------- .../RenderSubscriber.cs | 22 +++++----- 4 files changed, 61 insertions(+), 42 deletions(-) diff --git a/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs b/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs index 4033f96a..932b7c92 100644 --- a/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs +++ b/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs @@ -598,9 +598,8 @@ private void ProcessTasks(Task>[] taskArray, IB (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = outputState.GetCombinationSlotState( - combinationEquipment.avatarAddress, - combinationEquipment.slotIndex); + var slotState = outputState.GetAllCombinationSlotState(combinationEquipment.avatarAddress) + .GetSlot(combinationEquipment.slotIndex); int optionCount = 0; bool skillContains = false; @@ -672,9 +671,8 @@ private void ProcessTasks(Task>[] taskArray, IB Console.WriteLine("Writing ItemEnhancement action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = outputState.GetCombinationSlotState( - itemEnhancement.avatarAddress, - itemEnhancement.slotIndex); + var slotState = outputState.GetAllCombinationSlotState(itemEnhancement.avatarAddress) + .GetSlot(itemEnhancement.slotIndex); if (slotState?.Result.itemUsable.ItemType is ItemType.Equipment) { @@ -1058,15 +1056,16 @@ private void ProcessTasks(Task>[] taskArray, IB if (action is RapidCombination rapidCombination) { var start = DateTimeOffset.UtcNow; - _rapidCombinationList.Add(RapidCombinationData.GetRapidCombinationInfo( + _rapidCombinationList = _rapidCombinationList.Concat( + RapidCombinationData.GetRapidCombinationInfo( inputState, - outputState, ae.InputContext.Signer, rapidCombination.avatarAddress, - rapidCombination.slotIndex, + rapidCombination.slotIndexList, rapidCombination.Id, ae.InputContext.BlockIndex, - _blockTimeOffset)); + _blockTimeOffset) + ).ToList(); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing RapidCombination action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); } diff --git a/NineChronicles.DataProvider.Tests/ItemEnhancementDataTest.cs b/NineChronicles.DataProvider.Tests/ItemEnhancementDataTest.cs index 42effcc8..bc3161c2 100644 --- a/NineChronicles.DataProvider.Tests/ItemEnhancementDataTest.cs +++ b/NineChronicles.DataProvider.Tests/ItemEnhancementDataTest.cs @@ -9,7 +9,9 @@ using Microsoft.Extensions.DependencyInjection; using Nekoyume; using Nekoyume.Action; +using Nekoyume.Model; using Nekoyume.Model.Item; +using Nekoyume.Model.Quest; using Nekoyume.Model.State; using Nekoyume.Module; using Nekoyume.TableData; @@ -44,10 +46,20 @@ public void GetItemEnhancementInfo() 6,Jotunheim,251,300 7,Niflheim,301,350 8,Hel,351,400"); + var avatarName = "test"; var avatarSheets = new AvatarSheets(worldSheet, new QuestSheet(), new QuestRewardSheet(), new QuestItemRewardSheet(), new EquipmentItemRecipeSheet(), new EquipmentItemSubRecipeSheet()); var avatarAddress = new PrivateKey().Address; - var avatarState = new AvatarState(avatarAddress, _signer, 1L, avatarSheets, default, "test"); + var worldInformation = new WorldInformation(blockIndex, avatarSheets.WorldSheet, + GameConfig.IsEditor, avatarName); + var questList = new QuestList( + avatarSheets.QuestSheet, + avatarSheets.QuestRewardSheet, + avatarSheets.QuestItemRewardSheet, + avatarSheets.EquipmentItemRecipeSheet, + avatarSheets.EquipmentItemSubRecipeSheet + ); + var avatarState = new AvatarState(avatarAddress, _signer, 1L, questList, worldInformation, default, avatarName); var equipmentRow = new EquipmentItemSheet.Row(); equipmentRow.Set("10100000,Weapon,0,Normal,0,ATK,1,2,10100000,10".Split(",")); var itemId = Guid.NewGuid(); @@ -94,14 +106,16 @@ public void GetItemEnhancementInfo() Assert.Equal(totalHammerCount, model.HammerCount); Assert.Equal(totalHammerExp, model.HammerExp); } + protected override IWorldState GetMockState() { var mockWorldState = MockWorldState.CreateModern(); var goldCurrencyState = new GoldCurrencyState(_currency); - mockWorldState = mockWorldState.SetAccount(ReservedAddresses.LegacyAccount, + mockWorldState = mockWorldState.SetAccount( + ReservedAddresses.LegacyAccount, new Account(mockWorldState.GetAccountState(ReservedAddresses.LegacyAccount)) - .SetState(Addresses.GoldCurrency, goldCurrencyState.Serialize())) - .SetBalance(_signer, 1 * _currency); + .SetState(Addresses.GoldCurrency, goldCurrencyState.Serialize()) + ).SetBalance(_signer, 1 * _currency); return mockWorldState; } } diff --git a/NineChronicles.DataProvider/DataRendering/RapidCombinationData.cs b/NineChronicles.DataProvider/DataRendering/RapidCombinationData.cs index 5997e293..e976ff87 100644 --- a/NineChronicles.DataProvider/DataRendering/RapidCombinationData.cs +++ b/NineChronicles.DataProvider/DataRendering/RapidCombinationData.cs @@ -1,6 +1,7 @@ namespace NineChronicles.DataProvider.DataRendering { using System; + using System.Collections.Generic; using Libplanet.Action.State; using Libplanet.Crypto; using Nekoyume.Action; @@ -9,35 +10,40 @@ namespace NineChronicles.DataProvider.DataRendering public static class RapidCombinationData { - public static RapidCombinationModel GetRapidCombinationInfo( + public static List GetRapidCombinationInfo( IWorld previousStates, - IWorld outputStates, Address signer, Address avatarAddress, - int slotIndex, + List slotIndexList, Guid actionId, long blockIndex, DateTimeOffset blockTime ) { var states = previousStates; - var slotState = states.GetCombinationSlotState(avatarAddress, slotIndex); - var diff = slotState.Result.itemUsable.RequiredBlockIndex - blockIndex; + var slotStates = states.GetAllCombinationSlotState(avatarAddress); var gameConfigState = states.GetGameConfigState(); - var count = RapidCombination0.CalculateHourglassCount(gameConfigState, diff); - var rapidCombinationModel = new RapidCombinationModel() + var combinationList = new List(); + for (var i = 0; i < slotIndexList.Count; i++) { - Id = actionId.ToString(), - BlockIndex = blockIndex, - AgentAddress = signer.ToString(), - AvatarAddress = avatarAddress.ToString(), - SlotIndex = slotIndex, - HourglassCount = count, - Date = DateOnly.FromDateTime(blockTime.DateTime), - TimeStamp = blockTime, - }; + var slotIndex = slotIndexList[i]; + var slotState = slotStates.GetSlot(slotIndex); + var diff = slotState.Result.itemUsable.RequiredBlockIndex - blockIndex; + var count = RapidCombination0.CalculateHourglassCount(gameConfigState, diff); + combinationList.Add(new RapidCombinationModel + { + Id = $"{actionId}_{i}", + BlockIndex = blockIndex, + AgentAddress = signer.ToString(), + AvatarAddress = avatarAddress.ToString(), + SlotIndex = slotIndex, + HourglassCount = count, + Date = DateOnly.FromDateTime(blockTime.DateTime), + TimeStamp = blockTime, + }); + } - return rapidCombinationModel; + return combinationList; } } } diff --git a/NineChronicles.DataProvider/RenderSubscriber.cs b/NineChronicles.DataProvider/RenderSubscriber.cs index 768e7a5c..fe331360 100644 --- a/NineChronicles.DataProvider/RenderSubscriber.cs +++ b/NineChronicles.DataProvider/RenderSubscriber.cs @@ -80,7 +80,6 @@ public partial class RenderSubscriber : BackgroundService private readonly List _runeEnhancementList = new List(); private readonly List _runesAcquiredList = new List(); private readonly List _unlockRuneSlotList = new List(); - private readonly List _rapidCombinationList = new List(); private readonly List _petEnhancementList = new List(); private readonly List _transferAssetList = new List(); private readonly List _requestPledgeList = new List(); @@ -92,10 +91,12 @@ public partial class RenderSubscriber : BackgroundService private readonly List
_agents; private readonly List
_avatars; private readonly bool _render; + private int _renderedBlockCount; private DateTimeOffset _blockTimeOffset; private Address _miner; private string? _blockHash; + private List _rapidCombinationList = new List(); public RenderSubscriber( NineChroniclesNodeService nodeService, @@ -576,9 +577,8 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = outputState.GetCombinationSlotState( - combinationEquipment.avatarAddress, - combinationEquipment.slotIndex); + var slotState = outputState.GetAllCombinationSlotState(combinationEquipment.avatarAddress) + .GetSlot(combinationEquipment.slotIndex); int optionCount = 0; bool skillContains = false; @@ -683,9 +683,8 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) Log.Debug("[DataProvider] Stored ItemEnhancement action in block #{index}. Time Taken: {time} ms.", ev.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = outputState.GetCombinationSlotState( - itemEnhancement.avatarAddress, - itemEnhancement.slotIndex); + var slotState = outputState.GetAllCombinationSlotState(itemEnhancement.avatarAddress) + .GetSlot(itemEnhancement.slotIndex); if (slotState?.Result.itemUsable.ItemType is ItemType.Equipment) { @@ -1424,15 +1423,16 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) _avatarList.Add(AvatarData.GetAvatarInfo(outputState, ev.Signer, avatarAddress, _blockTimeOffset, BattleType.Adventure)); } - _rapidCombinationList.Add(RapidCombinationData.GetRapidCombinationInfo( + _rapidCombinationList = _rapidCombinationList.Concat( + RapidCombinationData.GetRapidCombinationInfo( inputState, - outputState, ev.Signer, rapidCombination.avatarAddress, - rapidCombination.slotIndex, + rapidCombination.slotIndexList, rapidCombination.Id, ev.BlockIndex, - _blockTimeOffset)); + _blockTimeOffset) + ).ToList(); var end = DateTimeOffset.UtcNow; Log.Debug("[DataProvider] Stored RapidCombination action in block #{index}. Time Taken: {time} ms.", ev.BlockIndex, (end - start).Milliseconds); } From 60515aca34472fbc2e4f9da6dbc1cb5eecb39b20 Mon Sep 17 00:00:00 2001 From: hyeon Date: Wed, 11 Sep 2024 16:33:09 +0900 Subject: [PATCH 29/62] Separate RapidCombination --- .../Commands/MySqlMigration.cs | 9 +++- .../{ => Crafting}/RapidCombinationData.cs | 2 +- .../RenderSubscriber.cs | 6 +-- .../{ => Crafting}/RapidCombinationModel.cs | 0 .../Store/MySql/CraftingStore.cs | 52 +++++++++++++++++++ .../Store/MySqlStore.cs | 37 +------------ .../Subscriber/CraftingRenderSubscriber.cs | 39 ++++++++++++++ 7 files changed, 104 insertions(+), 41 deletions(-) rename NineChronicles.DataProvider/DataRendering/{ => Crafting}/RapidCombinationData.cs (96%) rename NineChronicles.DataProvider/Store/Models/{ => Crafting}/RapidCombinationModel.cs (100%) create mode 100644 NineChronicles.DataProvider/Store/MySql/CraftingStore.cs create mode 100644 NineChronicles.DataProvider/Subscriber/CraftingRenderSubscriber.cs diff --git a/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs b/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs index 932b7c92..9601cbd7 100644 --- a/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs +++ b/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs @@ -1,6 +1,7 @@ using Nekoyume.Action.AdventureBoss; using Nekoyume.Model.EnumType; using NineChronicles.DataProvider.DataRendering.AdventureBoss; +using NineChronicles.DataProvider.DataRendering.Crafting; using NineChronicles.DataProvider.Store.Models.AdventureBoss; namespace NineChronicles.DataProvider.Executable.Commands @@ -41,7 +42,6 @@ namespace NineChronicles.DataProvider.Executable.Commands using NineChronicles.DataProvider.DataRendering; using NineChronicles.DataProvider.Store; using NineChronicles.DataProvider.Store.Models; - using Serilog; using static Lib9c.SerializeKeys; public class MySqlMigration @@ -381,7 +381,6 @@ public async Task Migration( _mySqlStore.StoreRuneEnhancementList(_runeEnhancementList); _mySqlStore.StoreRunesAcquiredList(_runesAcquiredList); _mySqlStore.StoreUnlockRuneSlotList(_unlockRuneSlotList); - _mySqlStore.StoreRapidCombinationList(_rapidCombinationList); _mySqlStore.StorePetEnhancementList(_petEnhancementList); _mySqlStore.StoreTransferAssetList(_transferAssetList); _mySqlStore.StoreRequestPledgeList(_requestPledgeList); @@ -420,6 +419,12 @@ await Task.Run(async () => Console.WriteLine($"[Adventure Boss] {_adventureBossClaimRewardList.Count} claim"); await _mySqlStore.StoreAdventureBossClaimRewardList(_adventureBossClaimRewardList); }); + + await Task.Run(async () => + { + Console.WriteLine($"[RapidCombination] {_rapidCombinationList.Count}"); + await _mySqlStore.StoreRapidCombinationList(_rapidCombinationList); + }); } catch (Exception e) { diff --git a/NineChronicles.DataProvider/DataRendering/RapidCombinationData.cs b/NineChronicles.DataProvider/DataRendering/Crafting/RapidCombinationData.cs similarity index 96% rename from NineChronicles.DataProvider/DataRendering/RapidCombinationData.cs rename to NineChronicles.DataProvider/DataRendering/Crafting/RapidCombinationData.cs index e976ff87..d2a61425 100644 --- a/NineChronicles.DataProvider/DataRendering/RapidCombinationData.cs +++ b/NineChronicles.DataProvider/DataRendering/Crafting/RapidCombinationData.cs @@ -1,4 +1,4 @@ -namespace NineChronicles.DataProvider.DataRendering +namespace NineChronicles.DataProvider.DataRendering.Crafting { using System; using System.Collections.Generic; diff --git a/NineChronicles.DataProvider/RenderSubscriber.cs b/NineChronicles.DataProvider/RenderSubscriber.cs index fe331360..5df47ae1 100644 --- a/NineChronicles.DataProvider/RenderSubscriber.cs +++ b/NineChronicles.DataProvider/RenderSubscriber.cs @@ -29,6 +29,7 @@ namespace NineChronicles.DataProvider using Nekoyume.TableData.Rune; using Nekoyume.TableData.Summon; using NineChronicles.DataProvider.DataRendering; + using NineChronicles.DataProvider.DataRendering.Crafting; using NineChronicles.DataProvider.Store; using NineChronicles.DataProvider.Store.Models; using NineChronicles.Headless; @@ -96,7 +97,6 @@ public partial class RenderSubscriber : BackgroundService private DateTimeOffset _blockTimeOffset; private Address _miner; private string? _blockHash; - private List _rapidCombinationList = new List(); public RenderSubscriber( NineChroniclesNodeService nodeService, @@ -1867,7 +1867,6 @@ private void StoreRenderedData((Block OldTip, Block NewTip) b) MySqlStore.StoreRuneEnhancementList(_runeEnhancementList); MySqlStore.StoreRunesAcquiredList(_runesAcquiredList); MySqlStore.StoreUnlockRuneSlotList(_unlockRuneSlotList); - MySqlStore.StoreRapidCombinationList(_rapidCombinationList); MySqlStore.StorePetEnhancementList(_petEnhancementList); MySqlStore.StoreTransferAssetList(_transferAssetList); MySqlStore.StoreRequestPledgeList(_requestPledgeList); @@ -1877,6 +1876,7 @@ private void StoreRenderedData((Block OldTip, Block NewTip) b) MySqlStore.StoreRuneSummonList(_runeSummonList); MySqlStore.StoreRuneSummonFailList(_runeSummonFailList); StoreAdventureBossList(); + StoreRapidCombinationList(); }), }; @@ -1919,7 +1919,6 @@ private void StoreRenderedData((Block OldTip, Block NewTip) b) _runeEnhancementList.Clear(); _runesAcquiredList.Clear(); _unlockRuneSlotList.Clear(); - _rapidCombinationList.Clear(); _petEnhancementList.Clear(); _transferAssetList.Clear(); _requestPledgeList.Clear(); @@ -1927,6 +1926,7 @@ private void StoreRenderedData((Block OldTip, Block NewTip) b) _auraSummonList.Clear(); _auraSummonFailList.Clear(); ClearAdventureBossList(); + ClearRapidCombinationList(); var end = DateTimeOffset.Now; long blockIndex = b.OldTip.Index; diff --git a/NineChronicles.DataProvider/Store/Models/RapidCombinationModel.cs b/NineChronicles.DataProvider/Store/Models/Crafting/RapidCombinationModel.cs similarity index 100% rename from NineChronicles.DataProvider/Store/Models/RapidCombinationModel.cs rename to NineChronicles.DataProvider/Store/Models/Crafting/RapidCombinationModel.cs diff --git a/NineChronicles.DataProvider/Store/MySql/CraftingStore.cs b/NineChronicles.DataProvider/Store/MySql/CraftingStore.cs new file mode 100644 index 00000000..d7a86108 --- /dev/null +++ b/NineChronicles.DataProvider/Store/MySql/CraftingStore.cs @@ -0,0 +1,52 @@ +namespace NineChronicles.DataProvider.Store +{ + using System; + using System.Collections.Generic; + using System.Threading.Tasks; + using Microsoft.EntityFrameworkCore; + using NineChronicles.DataProvider.Store.Models; + using Serilog; + + /// + /// Store functions related to crafting. + /// - ItemEnhancement + /// - CombinationEquipment + /// - RapidCombination + /// and so on. + /// + public partial class MySqlStore + { + // RapidCombination + public async partial Task StoreRapidCombinationList(List rapidCombinationList) + { + NineChroniclesContext? ctx = null; + try + { + ctx = await _dbContextFactory.CreateDbContextAsync(); + + foreach (var rc in rapidCombinationList) + { + if (await ctx.RapidCombinations.FirstOrDefaultAsync(r => r.Id == rc.Id) is null) + { + await ctx.RapidCombinations.AddAsync(rc); + } + } + + await ctx.SaveChangesAsync(); + Log.Debug($"[RapidCombination] {rapidCombinationList.Count} RapidCombinations saved."); + } + catch (Exception e) + { + Log.Debug(e.Message); + Log.Debug(e.StackTrace); + } + finally + { + if (ctx is not null) + { + await ctx.DisposeAsync(); + } + } + } + } +} diff --git a/NineChronicles.DataProvider/Store/MySqlStore.cs b/NineChronicles.DataProvider/Store/MySqlStore.cs index b3f92dc4..c79d017f 100644 --- a/NineChronicles.DataProvider/Store/MySqlStore.cs +++ b/NineChronicles.DataProvider/Store/MySqlStore.cs @@ -1767,41 +1767,6 @@ public void StoreUnlockRuneSlotList(List unlockRuneSlotList } } - public void StoreRapidCombinationList(List rapidCombinationList) - { - try - { - var tasks = new List(); - foreach (var rapidCombination in rapidCombinationList) - { - tasks.Add(Task.Run(async () => - { - await using NineChroniclesContext ctx = await _dbContextFactory.CreateDbContextAsync(); - if (ctx.RapidCombinations.FindAsync(rapidCombination.Id).Result is null) - { - await ctx.RapidCombinations.AddRangeAsync(rapidCombination); - await ctx.SaveChangesAsync(); - await ctx.DisposeAsync(); - } - else - { - await ctx.DisposeAsync(); - await using NineChroniclesContext updateCtx = await _dbContextFactory.CreateDbContextAsync(); - updateCtx.RapidCombinations.UpdateRange(rapidCombination); - await updateCtx.SaveChangesAsync(); - await updateCtx.DisposeAsync(); - } - })); - } - - Task.WaitAll(tasks.ToArray()); - } - catch (Exception e) - { - Log.Debug(e.Message); - } - } - public void StoreAuraSummonList(List auraSummonList) { try @@ -1956,6 +1921,8 @@ public void StoreRuneSummonFailList(List runeSummonFailList public partial Task StoreAdventureBossClaimRewardList(List claimList); /* Adventure Boss */ + public partial Task StoreRapidCombinationList(List rapidCombinationList); + public List GetRaiderList() { using NineChroniclesContext ctx = _dbContextFactory.CreateDbContext(); diff --git a/NineChronicles.DataProvider/Subscriber/CraftingRenderSubscriber.cs b/NineChronicles.DataProvider/Subscriber/CraftingRenderSubscriber.cs new file mode 100644 index 00000000..9364a8f7 --- /dev/null +++ b/NineChronicles.DataProvider/Subscriber/CraftingRenderSubscriber.cs @@ -0,0 +1,39 @@ +namespace NineChronicles.DataProvider +{ + using System; + using System.Collections.Generic; + using System.Threading.Tasks; + using NineChronicles.DataProvider.Store.Models; + using Serilog; + + public partial class RenderSubscriber + { + private List _rapidCombinationList = new (); + + // RapidCombination + private void StoreRapidCombinationList() + { + try + { + var tasks = new List(); + Log.Debug("[Crafting] Store RapidCombination list"); + + tasks.Add(Task.Run(async () => + { + Log.Debug($"[RapidCombination] {_rapidCombinationList.Count}"); + await MySqlStore.StoreRapidCombinationList(_rapidCombinationList); + })); + } + catch (Exception e) + { + Log.Error(e.Message); + } + } + + private void ClearRapidCombinationList() + { + Log.Debug("[Crafting] Clear crafting related action data"); + _rapidCombinationList.Clear(); + } + } +} From de8f6c439e349d2f98c6153201a0ad54013c2452 Mon Sep 17 00:00:00 2001 From: hyeon Date: Wed, 11 Sep 2024 17:04:39 +0900 Subject: [PATCH 30/62] Move RapidCombinationModel to new namespace --- .../Commands/MySqlMigration.cs | 1 + .../DataRendering/Crafting/RapidCombinationData.cs | 2 +- .../Store/Models/Crafting/RapidCombinationModel.cs | 3 +-- NineChronicles.DataProvider/Store/MySql/CraftingStore.cs | 2 +- NineChronicles.DataProvider/Store/MySqlStore.cs | 1 + NineChronicles.DataProvider/Store/NineChroniclesContext.cs | 1 + .../Subscriber/CraftingRenderSubscriber.cs | 2 +- 7 files changed, 7 insertions(+), 5 deletions(-) diff --git a/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs b/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs index 9601cbd7..ea9d4634 100644 --- a/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs +++ b/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs @@ -3,6 +3,7 @@ using NineChronicles.DataProvider.DataRendering.AdventureBoss; using NineChronicles.DataProvider.DataRendering.Crafting; using NineChronicles.DataProvider.Store.Models.AdventureBoss; +using NineChronicles.DataProvider.Store.Models.Crafting; namespace NineChronicles.DataProvider.Executable.Commands { diff --git a/NineChronicles.DataProvider/DataRendering/Crafting/RapidCombinationData.cs b/NineChronicles.DataProvider/DataRendering/Crafting/RapidCombinationData.cs index d2a61425..ea1c19b6 100644 --- a/NineChronicles.DataProvider/DataRendering/Crafting/RapidCombinationData.cs +++ b/NineChronicles.DataProvider/DataRendering/Crafting/RapidCombinationData.cs @@ -6,7 +6,7 @@ namespace NineChronicles.DataProvider.DataRendering.Crafting using Libplanet.Crypto; using Nekoyume.Action; using Nekoyume.Module; - using NineChronicles.DataProvider.Store.Models; + using NineChronicles.DataProvider.Store.Models.Crafting; public static class RapidCombinationData { diff --git a/NineChronicles.DataProvider/Store/Models/Crafting/RapidCombinationModel.cs b/NineChronicles.DataProvider/Store/Models/Crafting/RapidCombinationModel.cs index a20ca622..f01929fb 100644 --- a/NineChronicles.DataProvider/Store/Models/Crafting/RapidCombinationModel.cs +++ b/NineChronicles.DataProvider/Store/Models/Crafting/RapidCombinationModel.cs @@ -1,11 +1,10 @@ -namespace NineChronicles.DataProvider.Store.Models +namespace NineChronicles.DataProvider.Store.Models.Crafting { using System; using System.ComponentModel.DataAnnotations; using Microsoft.EntityFrameworkCore; [Index(nameof(Date))] - public class RapidCombinationModel { [Key] diff --git a/NineChronicles.DataProvider/Store/MySql/CraftingStore.cs b/NineChronicles.DataProvider/Store/MySql/CraftingStore.cs index d7a86108..4177a22c 100644 --- a/NineChronicles.DataProvider/Store/MySql/CraftingStore.cs +++ b/NineChronicles.DataProvider/Store/MySql/CraftingStore.cs @@ -4,7 +4,7 @@ namespace NineChronicles.DataProvider.Store using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; - using NineChronicles.DataProvider.Store.Models; + using NineChronicles.DataProvider.Store.Models.Crafting; using Serilog; /// diff --git a/NineChronicles.DataProvider/Store/MySqlStore.cs b/NineChronicles.DataProvider/Store/MySqlStore.cs index c79d017f..f6b64eb4 100644 --- a/NineChronicles.DataProvider/Store/MySqlStore.cs +++ b/NineChronicles.DataProvider/Store/MySqlStore.cs @@ -9,6 +9,7 @@ namespace NineChronicles.DataProvider.Store using Nekoyume.Model.Item; using NineChronicles.DataProvider.Store.Models; using NineChronicles.DataProvider.Store.Models.AdventureBoss; + using NineChronicles.DataProvider.Store.Models.Crafting; using Serilog; public partial class MySqlStore diff --git a/NineChronicles.DataProvider/Store/NineChroniclesContext.cs b/NineChronicles.DataProvider/Store/NineChroniclesContext.cs index 20b4b6bc..6b6e848c 100644 --- a/NineChronicles.DataProvider/Store/NineChroniclesContext.cs +++ b/NineChronicles.DataProvider/Store/NineChroniclesContext.cs @@ -3,6 +3,7 @@ namespace NineChronicles.DataProvider.Store using Microsoft.EntityFrameworkCore; using NineChronicles.DataProvider.Store.Models; using NineChronicles.DataProvider.Store.Models.AdventureBoss; + using NineChronicles.DataProvider.Store.Models.Crafting; public sealed class NineChroniclesContext : DbContext { diff --git a/NineChronicles.DataProvider/Subscriber/CraftingRenderSubscriber.cs b/NineChronicles.DataProvider/Subscriber/CraftingRenderSubscriber.cs index 9364a8f7..6b436b63 100644 --- a/NineChronicles.DataProvider/Subscriber/CraftingRenderSubscriber.cs +++ b/NineChronicles.DataProvider/Subscriber/CraftingRenderSubscriber.cs @@ -3,7 +3,7 @@ namespace NineChronicles.DataProvider using System; using System.Collections.Generic; using System.Threading.Tasks; - using NineChronicles.DataProvider.Store.Models; + using NineChronicles.DataProvider.Store.Models.Crafting; using Serilog; public partial class RenderSubscriber From 5c457ddb4e74ce39fe5ac989192f2af43f3f2ec7 Mon Sep 17 00:00:00 2001 From: hyeon Date: Wed, 11 Sep 2024 18:43:10 +0900 Subject: [PATCH 31/62] Fix missing codes --- .../RenderSubscriber.cs | 43 ++------------ .../Subscriber/CraftingRenderSubscriber.cs | 58 +++++++++++++++++++ 2 files changed, 64 insertions(+), 37 deletions(-) diff --git a/NineChronicles.DataProvider/RenderSubscriber.cs b/NineChronicles.DataProvider/RenderSubscriber.cs index 5df47ae1..af1d14e0 100644 --- a/NineChronicles.DataProvider/RenderSubscriber.cs +++ b/NineChronicles.DataProvider/RenderSubscriber.cs @@ -1406,43 +1406,6 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) } }); - _actionRenderer.EveryRender() - .Subscribe(ev => - { - try - { - if (ev.Exception == null && ev.Action is { } rapidCombination) - { - var start = DateTimeOffset.UtcNow; - var inputState = new World(_blockChainStates.GetWorldState(ev.PreviousState)); - var outputState = new World(_blockChainStates.GetWorldState(ev.OutputState)); - var avatarAddress = rapidCombination.avatarAddress; - if (!_avatars.Contains(avatarAddress)) - { - _avatars.Add(avatarAddress); - _avatarList.Add(AvatarData.GetAvatarInfo(outputState, ev.Signer, avatarAddress, _blockTimeOffset, BattleType.Adventure)); - } - - _rapidCombinationList = _rapidCombinationList.Concat( - RapidCombinationData.GetRapidCombinationInfo( - inputState, - ev.Signer, - rapidCombination.avatarAddress, - rapidCombination.slotIndexList, - rapidCombination.Id, - ev.BlockIndex, - _blockTimeOffset) - ).ToList(); - var end = DateTimeOffset.UtcNow; - Log.Debug("[DataProvider] Stored RapidCombination action in block #{index}. Time Taken: {time} ms.", ev.BlockIndex, (end - start).Milliseconds); - } - } - catch (Exception ex) - { - Log.Error(ex, "[DataProvider] RenderSubscriber Error: {ErrorMessage}, StackTrace: {StackTrace}", ex.Message, ex.StackTrace); - } - }); - _actionRenderer.EveryRender() .Subscribe(ev => { @@ -1726,6 +1689,9 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) _actionRenderer.EveryRender().Subscribe(SubscribeAdventureBossClaim); /* Adventure Boss */ + // Crafting + _actionRenderer.EveryRender().Subscribe(SubscribeRapidCombination); + return Task.CompletedTask; } @@ -1740,7 +1706,10 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) partial void SubscribeAdventureBossUnlockFloor(ActionEvaluation evt); partial void SubscribeAdventureBossClaim(ActionEvaluation evt); + /** Adventure Boss **/ + //// Cafting + partial void SubscribeRapidCombination(ActionEvaluation ev); /* Partial Methods */ private void AddShopHistoryItem(ITradableItem orderItem, Address buyerAvatarAddress, PurchaseInfo purchaseInfo, int itemCount, long blockIndex) diff --git a/NineChronicles.DataProvider/Subscriber/CraftingRenderSubscriber.cs b/NineChronicles.DataProvider/Subscriber/CraftingRenderSubscriber.cs index 6b436b63..bc7e90e9 100644 --- a/NineChronicles.DataProvider/Subscriber/CraftingRenderSubscriber.cs +++ b/NineChronicles.DataProvider/Subscriber/CraftingRenderSubscriber.cs @@ -2,7 +2,14 @@ namespace NineChronicles.DataProvider { using System; using System.Collections.Generic; + using System.Linq; using System.Threading.Tasks; + using Lib9c.Renderers; + using Libplanet.Action.State; + using Nekoyume.Action; + using Nekoyume.Model.EnumType; + using NineChronicles.DataProvider.DataRendering; + using NineChronicles.DataProvider.DataRendering.Crafting; using NineChronicles.DataProvider.Store.Models.Crafting; using Serilog; @@ -23,6 +30,8 @@ private void StoreRapidCombinationList() Log.Debug($"[RapidCombination] {_rapidCombinationList.Count}"); await MySqlStore.StoreRapidCombinationList(_rapidCombinationList); })); + + Task.WaitAll(tasks.ToArray()); } catch (Exception e) { @@ -35,5 +44,54 @@ private void ClearRapidCombinationList() Log.Debug("[Crafting] Clear crafting related action data"); _rapidCombinationList.Clear(); } + + partial void SubscribeRapidCombination(ActionEvaluation ev) + { + try + { + if (ev.Exception == null && ev.Action is { } rapidCombination) + { + var start = DateTimeOffset.UtcNow; + var inputState = new World(_blockChainStates.GetWorldState(ev.PreviousState)); + var outputState = new World(_blockChainStates.GetWorldState(ev.OutputState)); + var avatarAddress = rapidCombination.avatarAddress; + if (!_avatars.Contains(avatarAddress)) + { + _avatars.Add(avatarAddress); + _avatarList.Add( + AvatarData.GetAvatarInfo( + outputState, ev.Signer, avatarAddress, _blockTimeOffset, BattleType.Adventure + ) + ); + } + + _rapidCombinationList = _rapidCombinationList.Concat( + RapidCombinationData.GetRapidCombinationInfo( + inputState, + ev.Signer, + rapidCombination.avatarAddress, + rapidCombination.slotIndexList, + rapidCombination.Id, + ev.BlockIndex, + _blockTimeOffset) + ).ToList(); + var end = DateTimeOffset.UtcNow; + Log.Debug( + "[DataProvider] Stored RapidCombination action in block #{index}. Time Taken: {time} ms.", + ev.BlockIndex, + (end - start).Milliseconds + ); + } + } + catch (Exception ex) + { + Log.Error( + ex, + "[DataProvider] RenderSubscriber Error: {ErrorMessage}, StackTrace: {StackTrace}", + ex.Message, + ex.StackTrace + ); + } + } } } From bd31d78fd809ea1cb3022b0d5ea9f8e331bad5a7 Mon Sep 17 00:00:00 2001 From: hyeon Date: Thu, 12 Sep 2024 10:10:44 +0900 Subject: [PATCH 32/62] Update build env to .net8.0 --- .github/workflows/pull_request.yml | 2 +- Dockerfile | 4 ++-- Dockerfile.amd64 | 2 +- Dockerfile.arm64v8 | 2 +- .../NineChronicles.DataProvider.Executable.csproj | 2 +- .../NineChronicles.DataProvider.Tests.csproj | 2 +- .../NineChronicles.DataProvider.csproj | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 896e0394..47fd6a76 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -14,7 +14,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 6.0.* + dotnet-version: 8.0.* - name: Install dependencies run: dotnet restore - uses: shogo82148/actions-setup-mysql@v1 diff --git a/Dockerfile b/Dockerfile index 30ab02dd..796a03fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env WORKDIR /app ARG COMMIT @@ -35,7 +35,7 @@ RUN dotnet publish NineChronicles.Headless/NineChronicles.Headless.Executable/Ni --version-suffix $COMMIT # Build runtime image -FROM mcr.microsoft.com/dotnet/sdk:6.0 +FROM mcr.microsoft.com/dotnet/sdk:8.0 WORKDIR /app RUN dotnet tool install --global dotnet-ef --version 7.0.14 ENV PATH="${PATH}:/${HOME}/.dotnet/tools" diff --git a/Dockerfile.amd64 b/Dockerfile.amd64 index 5adbd213..6e896c5c 100644 --- a/Dockerfile.amd64 +++ b/Dockerfile.amd64 @@ -35,7 +35,7 @@ RUN dotnet publish NineChronicles.Headless/NineChronicles.Headless.Executable/Ni --version-suffix $COMMIT # Build runtime image -FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim +FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim WORKDIR /app RUN dotnet tool install --global dotnet-ef --version 7.0.14 ENV PATH="${PATH}:/${HOME}/.dotnet/tools" diff --git a/Dockerfile.arm64v8 b/Dockerfile.arm64v8 index de966e82..f909af5d 100644 --- a/Dockerfile.arm64v8 +++ b/Dockerfile.arm64v8 @@ -35,7 +35,7 @@ RUN dotnet publish NineChronicles.Headless/NineChronicles.Headless.Executable/Ni --version-suffix $COMMIT # Build runtime image -FROM --platform=linux/arm64 mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim-arm64v8 +FROM --platform=linux/arm64 mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim-arm64v8 WORKDIR /app RUN dotnet tool install --global dotnet-ef --version 7.0.14 ENV PATH="${PATH}:/${HOME}/.dotnet/tools" diff --git a/NineChronicles.DataProvider.Executable/NineChronicles.DataProvider.Executable.csproj b/NineChronicles.DataProvider.Executable/NineChronicles.DataProvider.Executable.csproj index c3e365a0..d403c775 100644 --- a/NineChronicles.DataProvider.Executable/NineChronicles.DataProvider.Executable.csproj +++ b/NineChronicles.DataProvider.Executable/NineChronicles.DataProvider.Executable.csproj @@ -1,7 +1,7 @@ Exe - net6 + net8.0 true true $(NoWarn),1573,1591,1712,MEN002,MEN003,MEN005,S1450,SA1009,SA1101,SA1111,SA1116,S1134,SA1200,SA1309,SA1413,SA1600,SA1601,SA1633,EF1001,S1075 diff --git a/NineChronicles.DataProvider.Tests/NineChronicles.DataProvider.Tests.csproj b/NineChronicles.DataProvider.Tests/NineChronicles.DataProvider.Tests.csproj index 35c5c327..4da9a358 100644 --- a/NineChronicles.DataProvider.Tests/NineChronicles.DataProvider.Tests.csproj +++ b/NineChronicles.DataProvider.Tests/NineChronicles.DataProvider.Tests.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 enable false diff --git a/NineChronicles.DataProvider/NineChronicles.DataProvider.csproj b/NineChronicles.DataProvider/NineChronicles.DataProvider.csproj index e2a5d835..bcbec0e6 100644 --- a/NineChronicles.DataProvider/NineChronicles.DataProvider.csproj +++ b/NineChronicles.DataProvider/NineChronicles.DataProvider.csproj @@ -1,7 +1,7 @@ - net6 + net8.0 true enable true From 47d0eaa36185f9b0a4ec249e780baf12e9f1bd87 Mon Sep 17 00:00:00 2001 From: hyeon Date: Thu, 12 Sep 2024 10:11:50 +0900 Subject: [PATCH 33/62] Update github actions version --- .github/workflows/pull_request.yml | 4 ++-- .github/workflows/push_docker_image.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 47fd6a76..00c8b8f3 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -8,11 +8,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: recursive - name: Setup .NET Core - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v4 with: dotnet-version: 8.0.* - name: Install dependencies diff --git a/.github/workflows/push_docker_image.yml b/.github/workflows/push_docker_image.yml index 9ddaf73e..28a5708c 100644 --- a/.github/workflows/push_docker_image.yml +++ b/.github/workflows/push_docker_image.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: recursive - name: login From 7922eab58fafc657e3d130c591381171a79332a9 Mon Sep 17 00:00:00 2001 From: hyeon Date: Wed, 11 Sep 2024 18:29:41 +0900 Subject: [PATCH 34/62] Update Grinding data model --- .../20240911092734_UpdateGrinding.Designer.cs | 4250 +++++++++++++++++ .../20240911092734_UpdateGrinding.cs | 26 + .../NineChroniclesContextModelSnapshot.cs | 111 +- .../Models/{ => Grinding}/GrindingModel.cs | 5 +- 4 files changed, 4336 insertions(+), 56 deletions(-) create mode 100644 NineChronicles.DataProvider.Executable/Migrations/20240911092734_UpdateGrinding.Designer.cs create mode 100644 NineChronicles.DataProvider.Executable/Migrations/20240911092734_UpdateGrinding.cs rename NineChronicles.DataProvider/Store/Models/{ => Grinding}/GrindingModel.cs (87%) diff --git a/NineChronicles.DataProvider.Executable/Migrations/20240911092734_UpdateGrinding.Designer.cs b/NineChronicles.DataProvider.Executable/Migrations/20240911092734_UpdateGrinding.Designer.cs new file mode 100644 index 00000000..0f7fa859 --- /dev/null +++ b/NineChronicles.DataProvider.Executable/Migrations/20240911092734_UpdateGrinding.Designer.cs @@ -0,0 +1,4250 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using NineChronicles.DataProvider.Store; + +#nullable disable + +namespace NineChronicles.DataProvider.Executable.Migrations +{ + [DbContext(typeof(NineChroniclesContext))] + [Migration("20240911092734_UpdateGrinding")] + partial class UpdateGrinding + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.1") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AbilityRankingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("AbilityRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ActivateCollectionModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ActionId") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("AvatarAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CollectionId") + .HasColumnType("int"); + + b.Property("CreatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AvatarAddress", "CollectionId") + .IsUnique(); + + b.ToTable("ActivateCollections"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossChallengeModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EndFloor") + .HasColumnType("int"); + + b.Property("Point") + .HasColumnType("int"); + + b.Property("Season") + .HasColumnType("bigint"); + + b.Property("StartFloor") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalPoint") + .HasColumnType("bigint"); + + b.Property("UsedApPotion") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("AdventureBossChallenge"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossClaimRewardModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ClaimedSeason") + .HasColumnType("longtext"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("NcgReward") + .HasColumnType("decimal(65,30)"); + + b.Property("RewardData") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("AdventureBossClaimReward"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossRushModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EndFloor") + .HasColumnType("int"); + + b.Property("Point") + .HasColumnType("int"); + + b.Property("Season") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalPoint") + .HasColumnType("bigint"); + + b.Property("UsedApPotion") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("AdventureBossRush"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossSeasonModel", b => + { + b.Property("Season") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("BossId") + .HasColumnType("int"); + + b.Property("ClaimableBlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EndBlockIndex") + .HasColumnType("bigint"); + + b.Property("FixedRewardData") + .HasColumnType("longtext"); + + b.Property("NextSeasonBlockIndex") + .HasColumnType("bigint"); + + b.Property("RaffleReward") + .HasColumnType("decimal(65,30)"); + + b.Property("RaffleWinnerAddress") + .HasColumnType("varchar(255)"); + + b.Property("RandomRewardData") + .HasColumnType("longtext"); + + b.Property("StartBlockIndex") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Season"); + + b.HasIndex("RaffleWinnerAddress"); + + b.ToTable("AdventureBossSeason"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossUnlockFloorModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Season") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalUsedGoldenDust") + .HasColumnType("bigint"); + + b.Property("TotalUsedNcg") + .HasColumnType("decimal(65,30)"); + + b.Property("UnlockFloor") + .HasColumnType("int"); + + b.Property("UsedGoldenDust") + .HasColumnType("bigint"); + + b.Property("UsedNcg") + .HasColumnType("decimal(65,30)"); + + b.HasKey("Id"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("AdventureBossUnlockFloor"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossWantedModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Bounty") + .HasColumnType("decimal(65,30)"); + + b.Property("Count") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Season") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalBounty") + .HasColumnType("decimal(65,30)"); + + b.HasKey("Id"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("AdventureBossWanted"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AgentModel", b => + { + b.Property("Address") + .HasColumnType("varchar(255)"); + + b.HasKey("Address"); + + b.ToTable("Agents"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ApprovePledgeModel", b => + { + b.Property("TxId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("PatronAddress") + .HasColumnType("longtext"); + + b.Property("Signer") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("TxId"); + + b.HasIndex("Date"); + + b.ToTable("ApprovePledges"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonFailModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Exception") + .HasColumnType("longtext"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.Property("SummonCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("AuraSummonFails"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.Property("SummonCount") + .HasColumnType("int"); + + b.Property("SummonResult") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("AuraSummons"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AvatarModel", b => + { + b.Property("Address") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.HasKey("Address"); + + b.HasIndex("AgentAddress"); + + b.ToTable("Avatars"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleArenaModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("ChampionshipId") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EnemyAvatarAddress") + .HasColumnType("longtext"); + + b.Property("MedalCount") + .HasColumnType("int"); + + b.Property("Round") + .HasColumnType("int"); + + b.Property("TicketCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("Victory") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("BattleArenas"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleArenaRankingModel", b => + { + b.Property("AdditionalTicketPrice") + .HasColumnType("bigint"); + + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArenaType") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ChampionshipId") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EndBlockIndex") + .HasColumnType("bigint"); + + b.Property("EntranceFee") + .HasColumnType("bigint"); + + b.Property("LossCount") + .HasColumnType("int"); + + b.Property("MedalCount") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("PurchasedTicketCount") + .HasColumnType("int"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("RequiredMedalCount") + .HasColumnType("int"); + + b.Property("Round") + .HasColumnType("int"); + + b.Property("Score") + .HasColumnType("int"); + + b.Property("StartBlockIndex") + .HasColumnType("bigint"); + + b.Property("Ticket") + .HasColumnType("int"); + + b.Property("TicketPrice") + .HasColumnType("bigint"); + + b.Property("TicketResetCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.Property("WinCount") + .HasColumnType("int"); + + b.ToTable("BattleArenaRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleGrandFinaleModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("EnemyAvatarAddress") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("GrandFinaleId") + .HasColumnType("int"); + + b.Property("GrandFinaleScore") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("Victory") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("BattleGrandFinales"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BlockModel", b => + { + b.Property("Hash") + .HasColumnType("varchar(255)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Difficulty") + .HasColumnType("bigint"); + + b.Property("Index") + .HasColumnType("bigint"); + + b.Property("Miner") + .HasColumnType("longtext"); + + b.Property("Nonce") + .HasColumnType("longtext"); + + b.Property("PreviousHash") + .HasColumnType("longtext"); + + b.Property("ProtocolVersion") + .HasColumnType("int"); + + b.Property("PublicKey") + .HasColumnType("longtext"); + + b.Property("StateRootHash") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalDifficulty") + .HasColumnType("bigint"); + + b.Property("TxCount") + .HasColumnType("int"); + + b.Property("TxHash") + .HasColumnType("longtext"); + + b.HasKey("Hash"); + + b.HasIndex("Date"); + + b.HasIndex("Index"); + + b.ToTable("Blocks"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ClaimStakeRewardModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ApPotionCount") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ClaimRewardAvatarAddress") + .HasColumnType("longtext"); + + b.Property("ClaimStakeEndBlockIndex") + .HasColumnType("bigint"); + + b.Property("ClaimStakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("HourGlassCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("Date"); + + b.ToTable("ClaimStakeRewards"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationConsumableModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("RecipeId") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("CombinationConsumables"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationEquipmentModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("OptionCount") + .HasColumnType("int"); + + b.Property("RecipeId") + .HasColumnType("int"); + + b.Property("SkillContains") + .HasColumnType("tinyint(1)"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("SubRecipeId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("CombinationEquipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Crafting.RapidCombinationModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("HourglassCount") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("RapidCombinations"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CraftRankingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("CraftCount") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("CraftRankings"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.DailyMetricModel", b => + { + b.Property("Date") + .HasColumnType("date"); + + b.Property("ApUsage") + .HasColumnType("int"); + + b.Property("ArenaNcg") + .HasColumnType("decimal(65,30)"); + + b.Property("AuraSummonCount") + .HasColumnType("int"); + + b.Property("CraftingConsumableCount") + .HasColumnType("int"); + + b.Property("CraftingConsumableUsers") + .HasColumnType("int"); + + b.Property("CraftingEquipmentCount") + .HasColumnType("int"); + + b.Property("CraftingEquipmentUsers") + .HasColumnType("int"); + + b.Property("DailyNew") + .HasColumnType("int"); + + b.Property("Dau") + .HasColumnType("int"); + + b.Property("EnhanceCount") + .HasColumnType("int"); + + b.Property("EnhanceNcg") + .HasColumnType("decimal(65,30)"); + + b.Property("EnhanceUsers") + .HasColumnType("int"); + + b.Property("EventTicketNcg") + .HasColumnType("decimal(65,30)"); + + b.Property("HackAndSlashCount") + .HasColumnType("int"); + + b.Property("HackAndSlashUsers") + .HasColumnType("int"); + + b.Property("HourglassUsage") + .HasColumnType("int"); + + b.Property("NcgTrade") + .HasColumnType("decimal(65,30)"); + + b.Property("RuneNcg") + .HasColumnType("decimal(65,30)"); + + b.Property("RuneSlotNcg") + .HasColumnType("decimal(65,30)"); + + b.Property("RuneSummonCount") + .HasColumnType("int"); + + b.Property("SweepCount") + .HasColumnType("int"); + + b.Property("SweepUsers") + .HasColumnType("int"); + + b.Property("TxCount") + .HasColumnType("int"); + + b.HasKey("Date"); + + b.HasIndex("Date"); + + b.ToTable("DailyMetrics"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("ItemId"); + + b.ToTable("Equipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingArmorModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingArmor"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingBeltModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingBelt"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingNecklaceModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingNecklace"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingRingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingRing"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingWeaponModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingWeapon"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventConsumableItemCraftsModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EventConsumableItemRecipeId") + .HasColumnType("int"); + + b.Property("EventScheduleId") + .HasColumnType("int"); + + b.Property("RequiredItem1Count") + .HasColumnType("int"); + + b.Property("RequiredItem1Id") + .HasColumnType("int"); + + b.Property("RequiredItem2Count") + .HasColumnType("int"); + + b.Property("RequiredItem2Id") + .HasColumnType("int"); + + b.Property("RequiredItem3Count") + .HasColumnType("int"); + + b.Property("RequiredItem3Id") + .HasColumnType("int"); + + b.Property("RequiredItem4Count") + .HasColumnType("int"); + + b.Property("RequiredItem4Id") + .HasColumnType("int"); + + b.Property("RequiredItem5Count") + .HasColumnType("int"); + + b.Property("RequiredItem5Id") + .HasColumnType("int"); + + b.Property("RequiredItem6Count") + .HasColumnType("int"); + + b.Property("RequiredItem6Id") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("EventConsumableItemCrafts"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventDungeonBattleModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("CostumesCount") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EquipmentsCount") + .HasColumnType("int"); + + b.Property("EventDungeonId") + .HasColumnType("int"); + + b.Property("EventDungeonStageId") + .HasColumnType("int"); + + b.Property("EventScheduleId") + .HasColumnType("int"); + + b.Property("FoodsCount") + .HasColumnType("int"); + + b.Property("RemainingTickets") + .HasColumnType("int"); + + b.Property("RewardItem10Count") + .HasColumnType("int"); + + b.Property("RewardItem10Id") + .HasColumnType("int"); + + b.Property("RewardItem1Count") + .HasColumnType("int"); + + b.Property("RewardItem1Id") + .HasColumnType("int"); + + b.Property("RewardItem2Count") + .HasColumnType("int"); + + b.Property("RewardItem2Id") + .HasColumnType("int"); + + b.Property("RewardItem3Count") + .HasColumnType("int"); + + b.Property("RewardItem3Id") + .HasColumnType("int"); + + b.Property("RewardItem4Count") + .HasColumnType("int"); + + b.Property("RewardItem4Id") + .HasColumnType("int"); + + b.Property("RewardItem5Count") + .HasColumnType("int"); + + b.Property("RewardItem5Id") + .HasColumnType("int"); + + b.Property("RewardItem6Count") + .HasColumnType("int"); + + b.Property("RewardItem6Id") + .HasColumnType("int"); + + b.Property("RewardItem7Count") + .HasColumnType("int"); + + b.Property("RewardItem7Id") + .HasColumnType("int"); + + b.Property("RewardItem8Count") + .HasColumnType("int"); + + b.Property("RewardItem8Id") + .HasColumnType("int"); + + b.Property("RewardItem9Count") + .HasColumnType("int"); + + b.Property("RewardItem9Id") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("EventDungeonBattles"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventMaterialItemCraftsModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("EventMaterialItemRecipeId") + .HasColumnType("int"); + + b.Property("EventScheduleId") + .HasColumnType("int"); + + b.Property("Material10Count") + .HasColumnType("int"); + + b.Property("Material10Id") + .HasColumnType("int"); + + b.Property("Material11Count") + .HasColumnType("int"); + + b.Property("Material11Id") + .HasColumnType("int"); + + b.Property("Material12Count") + .HasColumnType("int"); + + b.Property("Material12Id") + .HasColumnType("int"); + + b.Property("Material1Count") + .HasColumnType("int"); + + b.Property("Material1Id") + .HasColumnType("int"); + + b.Property("Material2Count") + .HasColumnType("int"); + + b.Property("Material2Id") + .HasColumnType("int"); + + b.Property("Material3Count") + .HasColumnType("int"); + + b.Property("Material3Id") + .HasColumnType("int"); + + b.Property("Material4Count") + .HasColumnType("int"); + + b.Property("Material4Id") + .HasColumnType("int"); + + b.Property("Material5Count") + .HasColumnType("int"); + + b.Property("Material5Id") + .HasColumnType("int"); + + b.Property("Material6Count") + .HasColumnType("int"); + + b.Property("Material6Id") + .HasColumnType("int"); + + b.Property("Material7Count") + .HasColumnType("int"); + + b.Property("Material7Id") + .HasColumnType("int"); + + b.Property("Material8Count") + .HasColumnType("int"); + + b.Property("Material8Id") + .HasColumnType("int"); + + b.Property("Material9Count") + .HasColumnType("int"); + + b.Property("Material9Id") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("EventMaterialItemCrafts"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Grinding.GrindingModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Crystal") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("EquipmentItemId") + .HasColumnType("longtext"); + + b.Property("EquipmentLevel") + .HasColumnType("int"); + + b.Property("Materials") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("Grindings"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Mimisbrunnr") + .HasColumnType("tinyint(1)"); + + b.Property("StageId") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("HackAndSlashes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashSweepModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("ActionPoint") + .HasColumnType("int"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ApStoneCount") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("CostumesCount") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EquipmentsCount") + .HasColumnType("int"); + + b.Property("Mimisbrunnr") + .HasColumnType("tinyint(1)"); + + b.Property("StageId") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.Property("WorldId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("HackAndSlashSweeps"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasRandomBuffModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("GachaCount") + .HasColumnType("int"); + + b.Property("HasStageId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("HasRandomBuffs"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasWithRandomBuffModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffId") + .HasColumnType("int"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("StageId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("HasWithRandomBuffs"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementFailModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EquipmentItemId") + .HasColumnType("longtext"); + + b.Property("EquipmentLevel") + .HasColumnType("int"); + + b.Property("GainedCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("MaterialIdsCount") + .HasColumnType("int"); + + b.Property("MaterialItemId") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("ItemEnhancementFails"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Exp") + .HasColumnType("bigint"); + + b.Property("HammerCount") + .HasColumnType("int"); + + b.Property("HammerExp") + .HasColumnType("bigint"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("MaterialId") + .HasColumnType("longtext"); + + b.Property("MaterialIdsCount") + .HasColumnType("int"); + + b.Property("SheetId") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("ItemEnhancements"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.JoinArenaModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ArenaRound") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("ChampionshipId") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("JoinArenas"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.MigrateMonsterCollectionModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("MigrationAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("MigrationStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("StakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("Date"); + + b.ToTable("MigrateMonsterCollections"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.PetEnhancementModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("BurntSoulStone") + .HasColumnType("decimal(65,30)"); + + b.Property("ChangedLevel") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("OutputPetLevel") + .HasColumnType("int"); + + b.Property("PetId") + .HasColumnType("int"); + + b.Property("PreviousPetLevel") + .HasColumnType("int"); + + b.Property("TargetLevel") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("PetEnhancements"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RaiderModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Address") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarName") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("CreatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("HighScore") + .HasColumnType("bigint"); + + b.Property("IconId") + .HasColumnType("int"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("PurchaseCount") + .HasColumnType("int"); + + b.Property("RaidId") + .HasColumnType("int"); + + b.Property("TotalScore") + .HasColumnType("bigint"); + + b.Property("UpdatedAt") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("RaidId", "Address") + .IsUnique(); + + b.ToTable("Raiders"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ReplaceCombinationEquipmentMaterialModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("ReplacedMaterialCount") + .HasColumnType("int"); + + b.Property("ReplacedMaterialId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("ReplaceCombinationEquipmentMaterials"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RequestPledgeModel", b => + { + b.Property("TxId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("PledgeAgentAddress") + .HasColumnType("longtext"); + + b.Property("RefillMead") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxSigner") + .HasColumnType("longtext"); + + b.HasKey("TxId"); + + b.HasIndex("Date"); + + b.ToTable("RequestPledges"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneEnhancementModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("BurntRune") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("OutputRuneLevel") + .HasColumnType("int"); + + b.Property("OutputRuneLevelBonus") + .HasColumnType("int"); + + b.Property("PreviousRuneLevel") + .HasColumnType("int"); + + b.Property("PreviousRuneLevelBonus") + .HasColumnType("int"); + + b.Property("RuneId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TryCount") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("RuneEnhancements"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RunesAcquiredModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("ActionType") + .HasColumnType("varchar(255)"); + + b.Property("TickerType") + .HasColumnType("varchar(255)"); + + b.Property("AcquiredRune") + .HasColumnType("decimal(65,30)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id", "ActionType", "TickerType"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.HasIndex("Id", "ActionType", "TickerType") + .IsUnique(); + + b.ToTable("RunesAcquired"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneSummonFailModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Exception") + .HasColumnType("longtext"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.Property("SummonCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("RuneSummonFails"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneSummonModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.Property("SummonCount") + .HasColumnType("int"); + + b.Property("SummonResult") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("RuneSummons"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopConsumableModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("MainStat") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.HasKey("ItemId"); + + b.ToTable("ShopConsumables"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopCostumeModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Equipped") + .HasColumnType("tinyint(1)"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.HasKey("ItemId"); + + b.ToTable("ShopCostumes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopEquipmentModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SetId") + .HasColumnType("int"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("UniqueStatType") + .HasColumnType("longtext"); + + b.HasKey("ItemId"); + + b.ToTable("ShopEquipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryConsumableModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("MainStat") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.HasIndex("Date"); + + b.ToTable("ShopHistoryConsumables"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryCostumeModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Equipped") + .HasColumnType("tinyint(1)"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.HasIndex("Date"); + + b.ToTable("ShopHistoryCostumes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryEquipmentModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SetId") + .HasColumnType("int"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.Property("UniqueStatType") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.HasIndex("Date"); + + b.ToTable("ShopHistoryEquipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryFungibleAssetValueModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("Quantity") + .HasColumnType("decimal(65,30)"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Ticker") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.HasIndex("Date"); + + b.ToTable("ShopHistoryFungibleAssetValues"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryMaterialModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.HasIndex("Date"); + + b.ToTable("ShopHistoryMaterials"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopMaterialModel", b => + { + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.ToTable("ShopMaterials"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.StageRankingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ClearedStageId") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("StageRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.StakeModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("NewAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("NewStakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("PrevStakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("PreviousAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("RemainingNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("Date"); + + b.ToTable("Stakings"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.TransactionModel", b => + { + b.Property("TxId") + .HasColumnType("varchar(255)"); + + b.Property("ActionType") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("Nonce") + .HasColumnType("bigint"); + + b.Property("PublicKey") + .HasColumnType("longtext"); + + b.Property("Signer") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("UpdatedAddressesCount") + .HasColumnType("int"); + + b.HasKey("TxId"); + + b.HasIndex("Date"); + + b.HasIndex(new[] { "Date", "ActionType" }, "IDX_Date_ActionType"); + + b.ToTable("Transactions"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.TransferAssetModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("Amount") + .HasColumnType("decimal(65,30)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Recipient") + .HasColumnType("longtext"); + + b.Property("Sender") + .HasColumnType("longtext"); + + b.Property("TickerType") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Date"); + + b.ToTable("TransferAssets"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockEquipmentRecipeModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("UnlockEquipmentRecipeId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("UnlockEquipmentRecipes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockRuneSlotModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCRYSTAL") + .HasColumnType("decimal(65,30)"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("UnlockRuneSlots"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockWorldModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("UnlockWorldId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("UnlockWorlds"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserConsumablesModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("MainStat") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UserConsumables"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserCostumesModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Equipped") + .HasColumnType("tinyint(1)"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UserCostumes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserCrystalsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CrystalBalance") + .HasColumnType("decimal(65,30)"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("UserCrystals"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserEquipmentsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SetId") + .HasColumnType("int"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("UniqueStatType") + .HasColumnType("longtext"); + + b.ToTable("UserEquipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserMaterialsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Count") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UserMaterials"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserMonsterCollectionsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("MonsterCollectionAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("ReceivedBlockIndex") + .HasColumnType("bigint"); + + b.Property("RewardLevel") + .HasColumnType("bigint"); + + b.Property("StartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("UserMonsterCollections"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserNCGsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("NCGBalance") + .HasColumnType("decimal(65,30)"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("UserNCGs"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserRunesModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("RuneBalance") + .HasColumnType("decimal(65,30)"); + + b.Property("Ticker") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UserRunes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserStakingsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CancellableBlockIndex") + .HasColumnType("bigint"); + + b.Property("ReceivedBlockIndex") + .HasColumnType("bigint"); + + b.Property("StakeAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("StartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("UserStakings"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.WorldBossRankingModel", b => + { + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("AvatarName") + .HasColumnType("longtext"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("HighScore") + .HasColumnType("int"); + + b.Property("IconId") + .HasColumnType("int"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TotalScore") + .HasColumnType("int"); + + b.ToTable("WorldBossRankings", null, t => t.ExcludeFromMigrations()); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.WorldBossSeasonMigrationModel", b => + { + b.Property("RaidId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("MigratedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.HasKey("RaidId"); + + b.HasIndex("RaidId") + .IsUnique(); + + b.ToTable("WorldBossSeasonMigrationModels"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ActivateCollectionModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany("ActivateCollections") + .HasForeignKey("AvatarAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsMany("NineChronicles.DataProvider.Store.Models.CollectionOptionModel", "Options", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b1.Property("ActivateCollectionId") + .HasColumnType("int"); + + b1.Property("OperationType") + .IsRequired() + .HasColumnType("longtext"); + + b1.Property("StatType") + .IsRequired() + .HasColumnType("longtext"); + + b1.Property("Value") + .HasColumnType("bigint"); + + b1.HasKey("Id"); + + b1.HasIndex("ActivateCollectionId"); + + b1.ToTable("CollectionOptionModel"); + + b1.WithOwner() + .HasForeignKey("ActivateCollectionId"); + }); + + b.Navigation("Avatar"); + + b.Navigation("Options"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossChallengeModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossClaimRewardModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossRushModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossSeasonModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "RaffleWinner") + .WithMany() + .HasForeignKey("RaffleWinnerAddress"); + + b.Navigation("RaffleWinner"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossUnlockFloorModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossWantedModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonFailModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AvatarModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleArenaModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleGrandFinaleModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ClaimStakeRewardModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationConsumableModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationEquipmentModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Crafting.RapidCombinationModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventConsumableItemCraftsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventDungeonBattleModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventMaterialItemCraftsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Grinding.GrindingModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashSweepModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasRandomBuffModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasWithRandomBuffModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementFailModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.JoinArenaModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.MigrateMonsterCollectionModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.PetEnhancementModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ReplaceCombinationEquipmentMaterialModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneEnhancementModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RunesAcquiredModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneSummonFailModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneSummonModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.StakeModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockEquipmentRecipeModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockRuneSlotModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockWorldModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserConsumablesModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserCostumesModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserCrystalsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserMaterialsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserMonsterCollectionsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserNCGsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserRunesModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserStakingsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AvatarModel", b => + { + b.Navigation("ActivateCollections"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/NineChronicles.DataProvider.Executable/Migrations/20240911092734_UpdateGrinding.cs b/NineChronicles.DataProvider.Executable/Migrations/20240911092734_UpdateGrinding.cs new file mode 100644 index 00000000..ab64d2a6 --- /dev/null +++ b/NineChronicles.DataProvider.Executable/Migrations/20240911092734_UpdateGrinding.cs @@ -0,0 +1,26 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace NineChronicles.DataProvider.Executable.Migrations +{ + public partial class UpdateGrinding : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Materials", + table: "Grindings", + type: "longtext", + nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Materials", + table: "Grindings"); + } + } +} diff --git a/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs b/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs index c5efded0..e2952ca0 100644 --- a/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs +++ b/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs @@ -835,6 +835,43 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("CombinationEquipments"); }); + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Crafting.RapidCombinationModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("HourglassCount") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("RapidCombinations"); + }); + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CraftRankingModel", b => { b.Property("AgentAddress") @@ -1533,7 +1570,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("EventMaterialItemCrafts"); }); - modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.GrindingModel", b => + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Grinding.GrindingModel", b => { b.Property("Id") .HasColumnType("varchar(255)"); @@ -1562,6 +1599,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("EquipmentLevel") .HasColumnType("int"); + b.Property("Materials") + .HasColumnType("longtext"); + b.Property("TimeStamp") .HasColumnType("datetime(6)"); @@ -2035,43 +2075,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("Raiders"); }); - modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RapidCombinationModel", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AgentAddress") - .HasColumnType("varchar(255)"); - - b.Property("AvatarAddress") - .HasColumnType("varchar(255)"); - - b.Property("BlockIndex") - .HasColumnType("bigint"); - - b.Property("Date") - .HasColumnType("date"); - - b.Property("HourglassCount") - .HasColumnType("int"); - - b.Property("SlotIndex") - .HasColumnType("int"); - - b.Property("TimeStamp") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.HasIndex("AgentAddress"); - - b.HasIndex("AvatarAddress"); - - b.HasIndex("Date"); - - b.ToTable("RapidCombinations"); - }); - modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ReplaceCombinationEquipmentMaterialModel", b => { b.Property("Id") @@ -3802,6 +3805,21 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("Avatar"); }); + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Crafting.RapidCombinationModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventConsumableItemCraftsModel", b => { b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") @@ -3851,7 +3869,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("Avatar"); }); - modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.GrindingModel", b => + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Grinding.GrindingModel", b => { b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") .WithMany() @@ -3995,21 +4013,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("Avatar"); }); - modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RapidCombinationModel", b => - { - b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") - .WithMany() - .HasForeignKey("AgentAddress"); - - b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") - .WithMany() - .HasForeignKey("AvatarAddress"); - - b.Navigation("Agent"); - - b.Navigation("Avatar"); - }); - modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ReplaceCombinationEquipmentMaterialModel", b => { b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") diff --git a/NineChronicles.DataProvider/Store/Models/GrindingModel.cs b/NineChronicles.DataProvider/Store/Models/Grinding/GrindingModel.cs similarity index 87% rename from NineChronicles.DataProvider/Store/Models/GrindingModel.cs rename to NineChronicles.DataProvider/Store/Models/Grinding/GrindingModel.cs index 90658abf..55aae778 100644 --- a/NineChronicles.DataProvider/Store/Models/GrindingModel.cs +++ b/NineChronicles.DataProvider/Store/Models/Grinding/GrindingModel.cs @@ -1,11 +1,10 @@ -namespace NineChronicles.DataProvider.Store.Models +namespace NineChronicles.DataProvider.Store.Models.Grinding { using System; using System.ComponentModel.DataAnnotations; using Microsoft.EntityFrameworkCore; [Index(nameof(Date))] - public class GrindingModel { [Key] @@ -29,6 +28,8 @@ public class GrindingModel public decimal Crystal { get; set; } + public string? Materials { get; set; } + public DateOnly Date { get; set; } public DateTimeOffset TimeStamp { get; set; } From 5ebe63601f0e14d2de07b8e291efc7ac6eeec9bb Mon Sep 17 00:00:00 2001 From: hyeon Date: Wed, 11 Sep 2024 18:44:34 +0900 Subject: [PATCH 35/62] Move RapidCombinationModel to new namespace --- NineChronicles.DataProvider/Store/MySqlStore.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NineChronicles.DataProvider/Store/MySqlStore.cs b/NineChronicles.DataProvider/Store/MySqlStore.cs index f6b64eb4..444fabf7 100644 --- a/NineChronicles.DataProvider/Store/MySqlStore.cs +++ b/NineChronicles.DataProvider/Store/MySqlStore.cs @@ -1,3 +1,5 @@ +using NineChronicles.DataProvider.Store.Models.Crafting; + namespace NineChronicles.DataProvider.Store { using System; From eaf82202eb68060dc930370a3c0a1eace9c8a2af Mon Sep 17 00:00:00 2001 From: hyeon Date: Wed, 11 Sep 2024 18:48:32 +0900 Subject: [PATCH 36/62] Separate Grinding action --- .../Commands/MySqlMigration.cs | 11 ++- .../{ => Grinding}/GrindingData.cs | 14 ++- .../RenderSubscriber.cs | 45 ++------- .../Store/MySql/GrindingStore.cs | 46 +++++++++ .../Store/MySqlStore.cs | 38 +------ .../Store/NineChroniclesContext.cs | 1 + .../Subscriber/GrindingRenderSubscriber.cs | 99 +++++++++++++++++++ 7 files changed, 177 insertions(+), 77 deletions(-) rename NineChronicles.DataProvider/DataRendering/{ => Grinding}/GrindingData.cs (88%) create mode 100644 NineChronicles.DataProvider/Store/MySql/GrindingStore.cs create mode 100644 NineChronicles.DataProvider/Subscriber/GrindingRenderSubscriber.cs diff --git a/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs b/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs index ea9d4634..0dfe956f 100644 --- a/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs +++ b/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs @@ -2,8 +2,10 @@ using Nekoyume.Model.EnumType; using NineChronicles.DataProvider.DataRendering.AdventureBoss; using NineChronicles.DataProvider.DataRendering.Crafting; +using NineChronicles.DataProvider.DataRendering.Grinding; using NineChronicles.DataProvider.Store.Models.AdventureBoss; using NineChronicles.DataProvider.Store.Models.Crafting; +using NineChronicles.DataProvider.Store.Models.Grinding; namespace NineChronicles.DataProvider.Executable.Commands { @@ -364,7 +366,6 @@ public async Task Migration( _mySqlStore.StoreStakingList(_stakeList); _mySqlStore.StoreClaimStakeRewardList(_claimStakeList); _mySqlStore.StoreMigrateMonsterCollectionList(_migrateMonsterCollectionList); - _mySqlStore.StoreGrindList(_grindList); _mySqlStore.StoreItemEnhancementFailList(_itemEnhancementFailList); _mySqlStore.StoreUnlockEquipmentRecipeList(_unlockEquipmentRecipeList); _mySqlStore.StoreUnlockWorldList(_unlockWorldList); @@ -426,6 +427,12 @@ await Task.Run(async () => Console.WriteLine($"[RapidCombination] {_rapidCombinationList.Count}"); await _mySqlStore.StoreRapidCombinationList(_rapidCombinationList); }); + + await Task.Run(async () => + { + Console.WriteLine($"[Grinding] {_grindList.Count} grinding"); + await _mySqlStore.StoreGrindList(_grindList); + }); } catch (Exception e) { @@ -828,7 +835,7 @@ private void ProcessTasks(Task>[] taskArray, IB { var start = DateTimeOffset.UtcNow; - var grindList = GrindingData.GetGrindingInfo(inputState, outputState, ae.InputContext.Signer, grinding.AvatarAddress, grinding.EquipmentIds, grinding.Id, ae.InputContext.BlockIndex, _blockTimeOffset); + var grindList = GrindingData.GetGrindingInfo(inputState, ae.InputContext.Signer, grinding.AvatarAddress, grinding.EquipmentIds, grinding.Id, ae.InputContext.BlockIndex, _blockTimeOffset); foreach (var grind in grindList) { diff --git a/NineChronicles.DataProvider/DataRendering/GrindingData.cs b/NineChronicles.DataProvider/DataRendering/Grinding/GrindingData.cs similarity index 88% rename from NineChronicles.DataProvider/DataRendering/GrindingData.cs rename to NineChronicles.DataProvider/DataRendering/Grinding/GrindingData.cs index acac7c41..98a604a4 100644 --- a/NineChronicles.DataProvider/DataRendering/GrindingData.cs +++ b/NineChronicles.DataProvider/DataRendering/Grinding/GrindingData.cs @@ -1,7 +1,8 @@ -namespace NineChronicles.DataProvider.DataRendering +namespace NineChronicles.DataProvider.DataRendering.Grinding { using System; using System.Collections.Generic; + using System.Linq; using Bencodex.Types; using Libplanet.Action.State; using Libplanet.Crypto; @@ -15,13 +16,12 @@ namespace NineChronicles.DataProvider.DataRendering using Nekoyume.Module; using Nekoyume.TableData; using Nekoyume.TableData.Crystal; - using NineChronicles.DataProvider.Store.Models; + using NineChronicles.DataProvider.Store.Models.Grinding; public static class GrindingData { public static List GetGrindingInfo( IWorld previousStates, - IWorld outputStates, Address signer, Address avatarAddress, List equipmentIds, @@ -83,6 +83,13 @@ DateTimeOffset blockTime sheets.GetSheet() ); + var materials = Grinding.CalculateMaterialReward( + equipmentList, + sheets.GetSheet(), + sheets.GetSheet() + ); + var materialList = materials.Select(kv => $"{kv.Key.Id}:{kv.Value}").ToList(); + var grindList = new List(); foreach (var equipment in equipmentList) { @@ -95,6 +102,7 @@ DateTimeOffset blockTime EquipmentId = equipment.Id, EquipmentLevel = equipment.level, Crystal = Convert.ToDecimal(crystal.GetQuantityString()), + Materials = string.Join(",", materialList), BlockIndex = blockIndex, Date = DateOnly.FromDateTime(blockTime.DateTime), TimeStamp = blockTime, diff --git a/NineChronicles.DataProvider/RenderSubscriber.cs b/NineChronicles.DataProvider/RenderSubscriber.cs index af1d14e0..9eab5eb0 100644 --- a/NineChronicles.DataProvider/RenderSubscriber.cs +++ b/NineChronicles.DataProvider/RenderSubscriber.cs @@ -61,7 +61,6 @@ public partial class RenderSubscriber : BackgroundService private readonly List _stakeList = new List(); private readonly List _claimStakeList = new List(); private readonly List _mmcList = new List(); - private readonly List _grindList = new List(); private readonly List _itemEnhancementFailList = new List(); private readonly List _unlockEquipmentRecipeList = new List(); private readonly List _unlockWorldList = new List(); @@ -949,40 +948,6 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) } }); - _actionRenderer.EveryRender() - .Subscribe(ev => - { - try - { - if (ev.Action is { } grinding) - { - var start = DateTimeOffset.UtcNow; - var inputState = new World(_blockChainStates.GetWorldState(ev.PreviousState)); - var outputState = new World(_blockChainStates.GetWorldState(ev.OutputState)); - var avatarAddress = grinding.AvatarAddress; - if (!_avatars.Contains(avatarAddress)) - { - _avatars.Add(avatarAddress); - _avatarList.Add(AvatarData.GetAvatarInfo(outputState, ev.Signer, avatarAddress, _blockTimeOffset, BattleType.Adventure)); - } - - var grindList = GrindingData.GetGrindingInfo(inputState, outputState, ev.Signer, grinding.AvatarAddress, grinding.EquipmentIds, grinding.Id, ev.BlockIndex, _blockTimeOffset); - - foreach (var grind in grindList) - { - _grindList.Add(grind); - } - - var end = DateTimeOffset.UtcNow; - Log.Debug("[DataProvider] Stored Grinding action in block #{index}. Time Taken: {time} ms.", ev.BlockIndex, (end - start).Milliseconds); - } - } - catch (Exception ex) - { - Log.Error(ex, "[DataProvider] RenderSubscriber Error: {ErrorMessage}, StackTrace: {StackTrace}", ex.Message, ex.StackTrace); - } - }); - _actionRenderer.EveryRender() .Subscribe(ev => { @@ -1692,6 +1657,9 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) // Crafting _actionRenderer.EveryRender().Subscribe(SubscribeRapidCombination); + // Grinding + _actionRenderer.EveryRender().Subscribe(SubscribeGrinding); + return Task.CompletedTask; } @@ -1710,6 +1678,9 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) /** Adventure Boss **/ //// Cafting partial void SubscribeRapidCombination(ActionEvaluation ev); + + //// Grinding + partial void SubscribeGrinding(ActionEvaluation ev); /* Partial Methods */ private void AddShopHistoryItem(ITradableItem orderItem, Address buyerAvatarAddress, PurchaseInfo purchaseInfo, int itemCount, long blockIndex) @@ -1816,7 +1787,6 @@ private void StoreRenderedData((Block OldTip, Block NewTip) b) MySqlStore.StoreStakingList(_stakeList); MySqlStore.StoreClaimStakeRewardList(_claimStakeList); MySqlStore.StoreMigrateMonsterCollectionList(_mmcList); - MySqlStore.StoreGrindList(_grindList); MySqlStore.StoreItemEnhancementFailList(_itemEnhancementFailList); MySqlStore.StoreUnlockEquipmentRecipeList(_unlockEquipmentRecipeList); MySqlStore.StoreUnlockWorldList(_unlockWorldList); @@ -1846,6 +1816,7 @@ private void StoreRenderedData((Block OldTip, Block NewTip) b) MySqlStore.StoreRuneSummonFailList(_runeSummonFailList); StoreAdventureBossList(); StoreRapidCombinationList(); + StoreGrindList(); }), }; @@ -1868,7 +1839,6 @@ private void StoreRenderedData((Block OldTip, Block NewTip) b) _stakeList.Clear(); _claimStakeList.Clear(); _mmcList.Clear(); - _grindList.Clear(); _itemEnhancementFailList.Clear(); _unlockEquipmentRecipeList.Clear(); _unlockWorldList.Clear(); @@ -1896,6 +1866,7 @@ private void StoreRenderedData((Block OldTip, Block NewTip) b) _auraSummonFailList.Clear(); ClearAdventureBossList(); ClearRapidCombinationList(); + ClearGrindList(); var end = DateTimeOffset.Now; long blockIndex = b.OldTip.Index; diff --git a/NineChronicles.DataProvider/Store/MySql/GrindingStore.cs b/NineChronicles.DataProvider/Store/MySql/GrindingStore.cs new file mode 100644 index 00000000..cb00e755 --- /dev/null +++ b/NineChronicles.DataProvider/Store/MySql/GrindingStore.cs @@ -0,0 +1,46 @@ +// Refactor: Move MySqlStore.cs to MySql and make all namespaces to NineChronicles.dataProvider.MySqlStore + +namespace NineChronicles.DataProvider.Store +{ + using System; + using System.Collections.Generic; + using System.Threading.Tasks; + using Microsoft.EntityFrameworkCore; + using NineChronicles.DataProvider.Store.Models.Grinding; + using Serilog; + + public partial class MySqlStore + { + public async partial Task StoreGrindList(List grindingList) + { + NineChroniclesContext? ctx = null; + try + { + ctx = await _dbContextFactory.CreateDbContextAsync(); + + foreach (var grind in grindingList) + { + if (await ctx.Grindings!.FirstOrDefaultAsync(g => g.Id == grind.Id) is null) + { + await ctx.Grindings!.AddRangeAsync(grind); + } + } + + await ctx.SaveChangesAsync(); + Log.Debug($"[Grinding] {grindingList.Count} grind saved"); + } + catch (Exception e) + { + Log.Debug(e.Message); + Log.Debug(e.StackTrace); + } + finally + { + if (ctx is not null) + { + await ctx.DisposeAsync(); + } + } + } + } +} diff --git a/NineChronicles.DataProvider/Store/MySqlStore.cs b/NineChronicles.DataProvider/Store/MySqlStore.cs index 444fabf7..69c2a658 100644 --- a/NineChronicles.DataProvider/Store/MySqlStore.cs +++ b/NineChronicles.DataProvider/Store/MySqlStore.cs @@ -12,6 +12,7 @@ namespace NineChronicles.DataProvider.Store using NineChronicles.DataProvider.Store.Models; using NineChronicles.DataProvider.Store.Models.AdventureBoss; using NineChronicles.DataProvider.Store.Models.Crafting; + using NineChronicles.DataProvider.Store.Models.Grinding; using Serilog; public partial class MySqlStore @@ -1138,41 +1139,6 @@ public void StoreMigrateMonsterCollectionList( } } - public void StoreGrindList(List grindList) - { - try - { - var tasks = new List(); - foreach (var grind in grindList) - { - tasks.Add(Task.Run(async () => - { - await using NineChroniclesContext ctx = await _dbContextFactory.CreateDbContextAsync(); - if (ctx.Grindings?.FindAsync(grind.Id).Result is null) - { - await ctx.Grindings!.AddRangeAsync(grind); - await ctx.SaveChangesAsync(); - await ctx.DisposeAsync(); - } - else - { - await ctx.DisposeAsync(); - await using NineChroniclesContext updateCtx = await _dbContextFactory.CreateDbContextAsync(); - updateCtx.Grindings!.UpdateRange(grind); - await updateCtx.SaveChangesAsync(); - await updateCtx.DisposeAsync(); - } - })); - } - - Task.WaitAll(tasks.ToArray()); - } - catch (Exception e) - { - Log.Debug(e.Message); - } - } - public void StoreItemEnhancementFailList(List itemEnhancementFailList) { try @@ -1926,6 +1892,8 @@ public void StoreRuneSummonFailList(List runeSummonFailList public partial Task StoreRapidCombinationList(List rapidCombinationList); + public partial Task StoreGrindList(List grindingList); + public List GetRaiderList() { using NineChroniclesContext ctx = _dbContextFactory.CreateDbContext(); diff --git a/NineChronicles.DataProvider/Store/NineChroniclesContext.cs b/NineChronicles.DataProvider/Store/NineChroniclesContext.cs index 6b6e848c..ec3f6681 100644 --- a/NineChronicles.DataProvider/Store/NineChroniclesContext.cs +++ b/NineChronicles.DataProvider/Store/NineChroniclesContext.cs @@ -4,6 +4,7 @@ namespace NineChronicles.DataProvider.Store using NineChronicles.DataProvider.Store.Models; using NineChronicles.DataProvider.Store.Models.AdventureBoss; using NineChronicles.DataProvider.Store.Models.Crafting; + using NineChronicles.DataProvider.Store.Models.Grinding; public sealed class NineChroniclesContext : DbContext { diff --git a/NineChronicles.DataProvider/Subscriber/GrindingRenderSubscriber.cs b/NineChronicles.DataProvider/Subscriber/GrindingRenderSubscriber.cs new file mode 100644 index 00000000..14354857 --- /dev/null +++ b/NineChronicles.DataProvider/Subscriber/GrindingRenderSubscriber.cs @@ -0,0 +1,99 @@ +namespace NineChronicles.DataProvider +{ + using System; + using System.Collections.Generic; + using System.Threading.Tasks; + using Lib9c.Renderers; + using Libplanet.Action.State; + using Nekoyume.Action; + using Nekoyume.Model.EnumType; + using NineChronicles.DataProvider.DataRendering; + using NineChronicles.DataProvider.DataRendering.Grinding; + using NineChronicles.DataProvider.Store.Models.Grinding; + using Serilog; + + public partial class RenderSubscriber + { + private readonly List _grindList = new (); + + public void StoreGrindList() + { + try + { + var tasks = new List(); + Log.Debug("[DataProvider] Store grinding list"); + + tasks.Add(Task.Run(async () => + { + Log.Debug($"[Grinding] {_grindList.Count} Grindings"); + await MySqlStore.StoreGrindList(_grindList); + } + )); + + Task.WaitAll(tasks.ToArray()); + } + catch (Exception e) + { + Log.Debug(e.Message); + } + } + + partial void SubscribeGrinding(ActionEvaluation ev) + { + try + { + if (ev.Action is { } grinding) + { + var start = DateTimeOffset.UtcNow; + var inputState = new World(_blockChainStates.GetWorldState(ev.PreviousState)); + var outputState = new World(_blockChainStates.GetWorldState(ev.OutputState)); + var avatarAddress = grinding.AvatarAddress; + if (!_avatars.Contains(avatarAddress)) + { + _avatars.Add(avatarAddress); + _avatarList.Add(AvatarData.GetAvatarInfo( + outputState, ev.Signer, avatarAddress, _blockTimeOffset, BattleType.Adventure + )); + } + + var grindList = GrindingData.GetGrindingInfo( + inputState, + ev.Signer, + grinding.AvatarAddress, + grinding.EquipmentIds, + grinding.Id, + ev.BlockIndex, + _blockTimeOffset + ); + + foreach (var grind in grindList) + { + _grindList.Add(grind); + } + + var end = DateTimeOffset.UtcNow; + Log.Debug( + "[DataProvider] Stored Grinding action in block #{index}. Time Taken: {time} ms.", + ev.BlockIndex, + (end - start).Milliseconds + ); + } + } + catch (Exception ex) + { + Log.Error( + ex, + "[DataProvider] RenderSubscriber Error: {ErrorMessage}, StackTrace: {StackTrace}", + ex.Message, + ex.StackTrace + ); + } + } + + private void ClearGrindList() + { + Log.Debug("[Grinding] Clear grind list"); + _grindList.Clear(); + } + } +} From 8d363e9ce83680fddc27b4d5c69a92a1132be6d8 Mon Sep 17 00:00:00 2001 From: hyeon Date: Thu, 12 Sep 2024 11:05:28 +0900 Subject: [PATCH 37/62] Remove unused code --- NineChronicles.DataProvider/Store/MySqlStore.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/NineChronicles.DataProvider/Store/MySqlStore.cs b/NineChronicles.DataProvider/Store/MySqlStore.cs index 69c2a658..c873ff64 100644 --- a/NineChronicles.DataProvider/Store/MySqlStore.cs +++ b/NineChronicles.DataProvider/Store/MySqlStore.cs @@ -1,5 +1,3 @@ -using NineChronicles.DataProvider.Store.Models.Crafting; - namespace NineChronicles.DataProvider.Store { using System; From 7cc658bd6841653ca1913780ef76ba9959c13071 Mon Sep 17 00:00:00 2001 From: hyeon Date: Thu, 12 Sep 2024 21:52:05 +0900 Subject: [PATCH 38/62] Introduce CustomEquipmentCraft model --- ...912124503_CustomEquipmentCraft.Designer.cs | 4333 +++++++++++++++++ .../20240912124503_CustomEquipmentCraft.cs | 74 + .../NineChroniclesContextModelSnapshot.cs | 83 + .../Crafting/CustomEquipmentCraftModel.cs | 55 + 4 files changed, 4545 insertions(+) create mode 100644 NineChronicles.DataProvider.Executable/Migrations/20240912124503_CustomEquipmentCraft.Designer.cs create mode 100644 NineChronicles.DataProvider.Executable/Migrations/20240912124503_CustomEquipmentCraft.cs create mode 100644 NineChronicles.DataProvider/Store/Models/Crafting/CustomEquipmentCraftModel.cs diff --git a/NineChronicles.DataProvider.Executable/Migrations/20240912124503_CustomEquipmentCraft.Designer.cs b/NineChronicles.DataProvider.Executable/Migrations/20240912124503_CustomEquipmentCraft.Designer.cs new file mode 100644 index 00000000..8dc5cc2d --- /dev/null +++ b/NineChronicles.DataProvider.Executable/Migrations/20240912124503_CustomEquipmentCraft.Designer.cs @@ -0,0 +1,4333 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using NineChronicles.DataProvider.Store; + +#nullable disable + +namespace NineChronicles.DataProvider.Executable.Migrations +{ + [DbContext(typeof(NineChroniclesContext))] + [Migration("20240912124503_CustomEquipmentCraft")] + partial class CustomEquipmentCraft + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.1") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AbilityRankingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("AbilityRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ActivateCollectionModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ActionId") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("AvatarAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CollectionId") + .HasColumnType("int"); + + b.Property("CreatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AvatarAddress", "CollectionId") + .IsUnique(); + + b.ToTable("ActivateCollections"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossChallengeModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EndFloor") + .HasColumnType("int"); + + b.Property("Point") + .HasColumnType("int"); + + b.Property("Season") + .HasColumnType("bigint"); + + b.Property("StartFloor") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalPoint") + .HasColumnType("bigint"); + + b.Property("UsedApPotion") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("AdventureBossChallenge"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossClaimRewardModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ClaimedSeason") + .HasColumnType("longtext"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("NcgReward") + .HasColumnType("decimal(65,30)"); + + b.Property("RewardData") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("AdventureBossClaimReward"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossRushModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EndFloor") + .HasColumnType("int"); + + b.Property("Point") + .HasColumnType("int"); + + b.Property("Season") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalPoint") + .HasColumnType("bigint"); + + b.Property("UsedApPotion") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("AdventureBossRush"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossSeasonModel", b => + { + b.Property("Season") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("BossId") + .HasColumnType("int"); + + b.Property("ClaimableBlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EndBlockIndex") + .HasColumnType("bigint"); + + b.Property("FixedRewardData") + .HasColumnType("longtext"); + + b.Property("NextSeasonBlockIndex") + .HasColumnType("bigint"); + + b.Property("RaffleReward") + .HasColumnType("decimal(65,30)"); + + b.Property("RaffleWinnerAddress") + .HasColumnType("varchar(255)"); + + b.Property("RandomRewardData") + .HasColumnType("longtext"); + + b.Property("StartBlockIndex") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Season"); + + b.HasIndex("RaffleWinnerAddress"); + + b.ToTable("AdventureBossSeason"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossUnlockFloorModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Season") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalUsedGoldenDust") + .HasColumnType("bigint"); + + b.Property("TotalUsedNcg") + .HasColumnType("decimal(65,30)"); + + b.Property("UnlockFloor") + .HasColumnType("int"); + + b.Property("UsedGoldenDust") + .HasColumnType("bigint"); + + b.Property("UsedNcg") + .HasColumnType("decimal(65,30)"); + + b.HasKey("Id"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("AdventureBossUnlockFloor"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossWantedModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Bounty") + .HasColumnType("decimal(65,30)"); + + b.Property("Count") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Season") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalBounty") + .HasColumnType("decimal(65,30)"); + + b.HasKey("Id"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("AdventureBossWanted"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AgentModel", b => + { + b.Property("Address") + .HasColumnType("varchar(255)"); + + b.HasKey("Address"); + + b.ToTable("Agents"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ApprovePledgeModel", b => + { + b.Property("TxId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("PatronAddress") + .HasColumnType("longtext"); + + b.Property("Signer") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("TxId"); + + b.HasIndex("Date"); + + b.ToTable("ApprovePledges"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonFailModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Exception") + .HasColumnType("longtext"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.Property("SummonCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("AuraSummonFails"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.Property("SummonCount") + .HasColumnType("int"); + + b.Property("SummonResult") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("AuraSummons"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AvatarModel", b => + { + b.Property("Address") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.HasKey("Address"); + + b.HasIndex("AgentAddress"); + + b.ToTable("Avatars"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleArenaModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("ChampionshipId") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EnemyAvatarAddress") + .HasColumnType("longtext"); + + b.Property("MedalCount") + .HasColumnType("int"); + + b.Property("Round") + .HasColumnType("int"); + + b.Property("TicketCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("Victory") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("BattleArenas"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleArenaRankingModel", b => + { + b.Property("AdditionalTicketPrice") + .HasColumnType("bigint"); + + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArenaType") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ChampionshipId") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EndBlockIndex") + .HasColumnType("bigint"); + + b.Property("EntranceFee") + .HasColumnType("bigint"); + + b.Property("LossCount") + .HasColumnType("int"); + + b.Property("MedalCount") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("PurchasedTicketCount") + .HasColumnType("int"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("RequiredMedalCount") + .HasColumnType("int"); + + b.Property("Round") + .HasColumnType("int"); + + b.Property("Score") + .HasColumnType("int"); + + b.Property("StartBlockIndex") + .HasColumnType("bigint"); + + b.Property("Ticket") + .HasColumnType("int"); + + b.Property("TicketPrice") + .HasColumnType("bigint"); + + b.Property("TicketResetCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.Property("WinCount") + .HasColumnType("int"); + + b.ToTable("BattleArenaRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleGrandFinaleModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("EnemyAvatarAddress") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("GrandFinaleId") + .HasColumnType("int"); + + b.Property("GrandFinaleScore") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("Victory") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("BattleGrandFinales"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BlockModel", b => + { + b.Property("Hash") + .HasColumnType("varchar(255)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Difficulty") + .HasColumnType("bigint"); + + b.Property("Index") + .HasColumnType("bigint"); + + b.Property("Miner") + .HasColumnType("longtext"); + + b.Property("Nonce") + .HasColumnType("longtext"); + + b.Property("PreviousHash") + .HasColumnType("longtext"); + + b.Property("ProtocolVersion") + .HasColumnType("int"); + + b.Property("PublicKey") + .HasColumnType("longtext"); + + b.Property("StateRootHash") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalDifficulty") + .HasColumnType("bigint"); + + b.Property("TxCount") + .HasColumnType("int"); + + b.Property("TxHash") + .HasColumnType("longtext"); + + b.HasKey("Hash"); + + b.HasIndex("Date"); + + b.HasIndex("Index"); + + b.ToTable("Blocks"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ClaimStakeRewardModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ApPotionCount") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ClaimRewardAvatarAddress") + .HasColumnType("longtext"); + + b.Property("ClaimStakeEndBlockIndex") + .HasColumnType("bigint"); + + b.Property("ClaimStakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("HourGlassCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("Date"); + + b.ToTable("ClaimStakeRewards"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationConsumableModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("RecipeId") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("CombinationConsumables"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationEquipmentModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("OptionCount") + .HasColumnType("int"); + + b.Property("RecipeId") + .HasColumnType("int"); + + b.Property("SkillContains") + .HasColumnType("tinyint(1)"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("SubRecipeId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("CombinationEquipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Crafting.CustomEquipmentCraftModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AdditionalMaterials") + .HasColumnType("longtext"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Circle") + .HasColumnType("int"); + + b.Property("CraftWithRandom") + .HasColumnType("tinyint(1)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("HasRandomOnlyIcon") + .HasColumnType("tinyint(1)"); + + b.Property("IconId") + .HasColumnType("int"); + + b.Property("OptionId") + .HasColumnType("int"); + + b.Property("RecipeId") + .HasColumnType("int"); + + b.Property("Relationship") + .HasColumnType("int"); + + b.Property("Scroll") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalCP") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("CustomEquipmentCraft"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Crafting.RapidCombinationModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("HourglassCount") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("RapidCombinations"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CraftRankingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("CraftCount") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("CraftRankings"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.DailyMetricModel", b => + { + b.Property("Date") + .HasColumnType("date"); + + b.Property("ApUsage") + .HasColumnType("int"); + + b.Property("ArenaNcg") + .HasColumnType("decimal(65,30)"); + + b.Property("AuraSummonCount") + .HasColumnType("int"); + + b.Property("CraftingConsumableCount") + .HasColumnType("int"); + + b.Property("CraftingConsumableUsers") + .HasColumnType("int"); + + b.Property("CraftingEquipmentCount") + .HasColumnType("int"); + + b.Property("CraftingEquipmentUsers") + .HasColumnType("int"); + + b.Property("DailyNew") + .HasColumnType("int"); + + b.Property("Dau") + .HasColumnType("int"); + + b.Property("EnhanceCount") + .HasColumnType("int"); + + b.Property("EnhanceNcg") + .HasColumnType("decimal(65,30)"); + + b.Property("EnhanceUsers") + .HasColumnType("int"); + + b.Property("EventTicketNcg") + .HasColumnType("decimal(65,30)"); + + b.Property("HackAndSlashCount") + .HasColumnType("int"); + + b.Property("HackAndSlashUsers") + .HasColumnType("int"); + + b.Property("HourglassUsage") + .HasColumnType("int"); + + b.Property("NcgTrade") + .HasColumnType("decimal(65,30)"); + + b.Property("RuneNcg") + .HasColumnType("decimal(65,30)"); + + b.Property("RuneSlotNcg") + .HasColumnType("decimal(65,30)"); + + b.Property("RuneSummonCount") + .HasColumnType("int"); + + b.Property("SweepCount") + .HasColumnType("int"); + + b.Property("SweepUsers") + .HasColumnType("int"); + + b.Property("TxCount") + .HasColumnType("int"); + + b.HasKey("Date"); + + b.HasIndex("Date"); + + b.ToTable("DailyMetrics"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("ItemId"); + + b.ToTable("Equipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingArmorModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingArmor"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingBeltModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingBelt"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingNecklaceModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingNecklace"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingRingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingRing"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingWeaponModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingWeapon"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventConsumableItemCraftsModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EventConsumableItemRecipeId") + .HasColumnType("int"); + + b.Property("EventScheduleId") + .HasColumnType("int"); + + b.Property("RequiredItem1Count") + .HasColumnType("int"); + + b.Property("RequiredItem1Id") + .HasColumnType("int"); + + b.Property("RequiredItem2Count") + .HasColumnType("int"); + + b.Property("RequiredItem2Id") + .HasColumnType("int"); + + b.Property("RequiredItem3Count") + .HasColumnType("int"); + + b.Property("RequiredItem3Id") + .HasColumnType("int"); + + b.Property("RequiredItem4Count") + .HasColumnType("int"); + + b.Property("RequiredItem4Id") + .HasColumnType("int"); + + b.Property("RequiredItem5Count") + .HasColumnType("int"); + + b.Property("RequiredItem5Id") + .HasColumnType("int"); + + b.Property("RequiredItem6Count") + .HasColumnType("int"); + + b.Property("RequiredItem6Id") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("EventConsumableItemCrafts"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventDungeonBattleModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("CostumesCount") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EquipmentsCount") + .HasColumnType("int"); + + b.Property("EventDungeonId") + .HasColumnType("int"); + + b.Property("EventDungeonStageId") + .HasColumnType("int"); + + b.Property("EventScheduleId") + .HasColumnType("int"); + + b.Property("FoodsCount") + .HasColumnType("int"); + + b.Property("RemainingTickets") + .HasColumnType("int"); + + b.Property("RewardItem10Count") + .HasColumnType("int"); + + b.Property("RewardItem10Id") + .HasColumnType("int"); + + b.Property("RewardItem1Count") + .HasColumnType("int"); + + b.Property("RewardItem1Id") + .HasColumnType("int"); + + b.Property("RewardItem2Count") + .HasColumnType("int"); + + b.Property("RewardItem2Id") + .HasColumnType("int"); + + b.Property("RewardItem3Count") + .HasColumnType("int"); + + b.Property("RewardItem3Id") + .HasColumnType("int"); + + b.Property("RewardItem4Count") + .HasColumnType("int"); + + b.Property("RewardItem4Id") + .HasColumnType("int"); + + b.Property("RewardItem5Count") + .HasColumnType("int"); + + b.Property("RewardItem5Id") + .HasColumnType("int"); + + b.Property("RewardItem6Count") + .HasColumnType("int"); + + b.Property("RewardItem6Id") + .HasColumnType("int"); + + b.Property("RewardItem7Count") + .HasColumnType("int"); + + b.Property("RewardItem7Id") + .HasColumnType("int"); + + b.Property("RewardItem8Count") + .HasColumnType("int"); + + b.Property("RewardItem8Id") + .HasColumnType("int"); + + b.Property("RewardItem9Count") + .HasColumnType("int"); + + b.Property("RewardItem9Id") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("EventDungeonBattles"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventMaterialItemCraftsModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("EventMaterialItemRecipeId") + .HasColumnType("int"); + + b.Property("EventScheduleId") + .HasColumnType("int"); + + b.Property("Material10Count") + .HasColumnType("int"); + + b.Property("Material10Id") + .HasColumnType("int"); + + b.Property("Material11Count") + .HasColumnType("int"); + + b.Property("Material11Id") + .HasColumnType("int"); + + b.Property("Material12Count") + .HasColumnType("int"); + + b.Property("Material12Id") + .HasColumnType("int"); + + b.Property("Material1Count") + .HasColumnType("int"); + + b.Property("Material1Id") + .HasColumnType("int"); + + b.Property("Material2Count") + .HasColumnType("int"); + + b.Property("Material2Id") + .HasColumnType("int"); + + b.Property("Material3Count") + .HasColumnType("int"); + + b.Property("Material3Id") + .HasColumnType("int"); + + b.Property("Material4Count") + .HasColumnType("int"); + + b.Property("Material4Id") + .HasColumnType("int"); + + b.Property("Material5Count") + .HasColumnType("int"); + + b.Property("Material5Id") + .HasColumnType("int"); + + b.Property("Material6Count") + .HasColumnType("int"); + + b.Property("Material6Id") + .HasColumnType("int"); + + b.Property("Material7Count") + .HasColumnType("int"); + + b.Property("Material7Id") + .HasColumnType("int"); + + b.Property("Material8Count") + .HasColumnType("int"); + + b.Property("Material8Id") + .HasColumnType("int"); + + b.Property("Material9Count") + .HasColumnType("int"); + + b.Property("Material9Id") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("EventMaterialItemCrafts"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Grinding.GrindingModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Crystal") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("EquipmentItemId") + .HasColumnType("longtext"); + + b.Property("EquipmentLevel") + .HasColumnType("int"); + + b.Property("Materials") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("Grindings"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Mimisbrunnr") + .HasColumnType("tinyint(1)"); + + b.Property("StageId") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("HackAndSlashes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashSweepModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("ActionPoint") + .HasColumnType("int"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ApStoneCount") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("CostumesCount") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EquipmentsCount") + .HasColumnType("int"); + + b.Property("Mimisbrunnr") + .HasColumnType("tinyint(1)"); + + b.Property("StageId") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.Property("WorldId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("HackAndSlashSweeps"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasRandomBuffModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("GachaCount") + .HasColumnType("int"); + + b.Property("HasStageId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("HasRandomBuffs"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasWithRandomBuffModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffId") + .HasColumnType("int"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("StageId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("HasWithRandomBuffs"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementFailModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EquipmentItemId") + .HasColumnType("longtext"); + + b.Property("EquipmentLevel") + .HasColumnType("int"); + + b.Property("GainedCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("MaterialIdsCount") + .HasColumnType("int"); + + b.Property("MaterialItemId") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("ItemEnhancementFails"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Exp") + .HasColumnType("bigint"); + + b.Property("HammerCount") + .HasColumnType("int"); + + b.Property("HammerExp") + .HasColumnType("bigint"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("MaterialId") + .HasColumnType("longtext"); + + b.Property("MaterialIdsCount") + .HasColumnType("int"); + + b.Property("SheetId") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("ItemEnhancements"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.JoinArenaModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ArenaRound") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("ChampionshipId") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("JoinArenas"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.MigrateMonsterCollectionModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("MigrationAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("MigrationStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("StakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("Date"); + + b.ToTable("MigrateMonsterCollections"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.PetEnhancementModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("BurntSoulStone") + .HasColumnType("decimal(65,30)"); + + b.Property("ChangedLevel") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("OutputPetLevel") + .HasColumnType("int"); + + b.Property("PetId") + .HasColumnType("int"); + + b.Property("PreviousPetLevel") + .HasColumnType("int"); + + b.Property("TargetLevel") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("PetEnhancements"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RaiderModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Address") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarName") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("CreatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("HighScore") + .HasColumnType("bigint"); + + b.Property("IconId") + .HasColumnType("int"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("PurchaseCount") + .HasColumnType("int"); + + b.Property("RaidId") + .HasColumnType("int"); + + b.Property("TotalScore") + .HasColumnType("bigint"); + + b.Property("UpdatedAt") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("RaidId", "Address") + .IsUnique(); + + b.ToTable("Raiders"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ReplaceCombinationEquipmentMaterialModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("ReplacedMaterialCount") + .HasColumnType("int"); + + b.Property("ReplacedMaterialId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("ReplaceCombinationEquipmentMaterials"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RequestPledgeModel", b => + { + b.Property("TxId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("PledgeAgentAddress") + .HasColumnType("longtext"); + + b.Property("RefillMead") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxSigner") + .HasColumnType("longtext"); + + b.HasKey("TxId"); + + b.HasIndex("Date"); + + b.ToTable("RequestPledges"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneEnhancementModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("BurntRune") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("OutputRuneLevel") + .HasColumnType("int"); + + b.Property("OutputRuneLevelBonus") + .HasColumnType("int"); + + b.Property("PreviousRuneLevel") + .HasColumnType("int"); + + b.Property("PreviousRuneLevelBonus") + .HasColumnType("int"); + + b.Property("RuneId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TryCount") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("RuneEnhancements"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RunesAcquiredModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("ActionType") + .HasColumnType("varchar(255)"); + + b.Property("TickerType") + .HasColumnType("varchar(255)"); + + b.Property("AcquiredRune") + .HasColumnType("decimal(65,30)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id", "ActionType", "TickerType"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.HasIndex("Id", "ActionType", "TickerType") + .IsUnique(); + + b.ToTable("RunesAcquired"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneSummonFailModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Exception") + .HasColumnType("longtext"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.Property("SummonCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("RuneSummonFails"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneSummonModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.Property("SummonCount") + .HasColumnType("int"); + + b.Property("SummonResult") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("RuneSummons"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopConsumableModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("MainStat") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.HasKey("ItemId"); + + b.ToTable("ShopConsumables"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopCostumeModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Equipped") + .HasColumnType("tinyint(1)"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.HasKey("ItemId"); + + b.ToTable("ShopCostumes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopEquipmentModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SetId") + .HasColumnType("int"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("UniqueStatType") + .HasColumnType("longtext"); + + b.HasKey("ItemId"); + + b.ToTable("ShopEquipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryConsumableModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("MainStat") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.HasIndex("Date"); + + b.ToTable("ShopHistoryConsumables"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryCostumeModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Equipped") + .HasColumnType("tinyint(1)"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.HasIndex("Date"); + + b.ToTable("ShopHistoryCostumes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryEquipmentModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SetId") + .HasColumnType("int"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.Property("UniqueStatType") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.HasIndex("Date"); + + b.ToTable("ShopHistoryEquipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryFungibleAssetValueModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("Quantity") + .HasColumnType("decimal(65,30)"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Ticker") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.HasIndex("Date"); + + b.ToTable("ShopHistoryFungibleAssetValues"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryMaterialModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.HasIndex("Date"); + + b.ToTable("ShopHistoryMaterials"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopMaterialModel", b => + { + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.ToTable("ShopMaterials"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.StageRankingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ClearedStageId") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("StageRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.StakeModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("NewAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("NewStakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("PrevStakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("PreviousAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("RemainingNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("Date"); + + b.ToTable("Stakings"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.TransactionModel", b => + { + b.Property("TxId") + .HasColumnType("varchar(255)"); + + b.Property("ActionType") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("Nonce") + .HasColumnType("bigint"); + + b.Property("PublicKey") + .HasColumnType("longtext"); + + b.Property("Signer") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("UpdatedAddressesCount") + .HasColumnType("int"); + + b.HasKey("TxId"); + + b.HasIndex("Date"); + + b.HasIndex(new[] { "Date", "ActionType" }, "IDX_Date_ActionType"); + + b.ToTable("Transactions"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.TransferAssetModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("Amount") + .HasColumnType("decimal(65,30)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Recipient") + .HasColumnType("longtext"); + + b.Property("Sender") + .HasColumnType("longtext"); + + b.Property("TickerType") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Date"); + + b.ToTable("TransferAssets"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockEquipmentRecipeModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("UnlockEquipmentRecipeId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("UnlockEquipmentRecipes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockRuneSlotModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCRYSTAL") + .HasColumnType("decimal(65,30)"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("UnlockRuneSlots"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockWorldModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("UnlockWorldId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("UnlockWorlds"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserConsumablesModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("MainStat") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UserConsumables"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserCostumesModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Equipped") + .HasColumnType("tinyint(1)"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UserCostumes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserCrystalsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CrystalBalance") + .HasColumnType("decimal(65,30)"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("UserCrystals"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserEquipmentsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SetId") + .HasColumnType("int"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("UniqueStatType") + .HasColumnType("longtext"); + + b.ToTable("UserEquipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserMaterialsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Count") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UserMaterials"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserMonsterCollectionsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("MonsterCollectionAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("ReceivedBlockIndex") + .HasColumnType("bigint"); + + b.Property("RewardLevel") + .HasColumnType("bigint"); + + b.Property("StartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("UserMonsterCollections"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserNCGsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("NCGBalance") + .HasColumnType("decimal(65,30)"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("UserNCGs"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserRunesModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("RuneBalance") + .HasColumnType("decimal(65,30)"); + + b.Property("Ticker") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UserRunes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserStakingsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CancellableBlockIndex") + .HasColumnType("bigint"); + + b.Property("ReceivedBlockIndex") + .HasColumnType("bigint"); + + b.Property("StakeAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("StartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("UserStakings"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.WorldBossRankingModel", b => + { + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("AvatarName") + .HasColumnType("longtext"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("HighScore") + .HasColumnType("int"); + + b.Property("IconId") + .HasColumnType("int"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TotalScore") + .HasColumnType("int"); + + b.ToTable("WorldBossRankings", null, t => t.ExcludeFromMigrations()); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.WorldBossSeasonMigrationModel", b => + { + b.Property("RaidId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("MigratedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.HasKey("RaidId"); + + b.HasIndex("RaidId") + .IsUnique(); + + b.ToTable("WorldBossSeasonMigrationModels"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ActivateCollectionModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany("ActivateCollections") + .HasForeignKey("AvatarAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsMany("NineChronicles.DataProvider.Store.Models.CollectionOptionModel", "Options", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b1.Property("ActivateCollectionId") + .HasColumnType("int"); + + b1.Property("OperationType") + .IsRequired() + .HasColumnType("longtext"); + + b1.Property("StatType") + .IsRequired() + .HasColumnType("longtext"); + + b1.Property("Value") + .HasColumnType("bigint"); + + b1.HasKey("Id"); + + b1.HasIndex("ActivateCollectionId"); + + b1.ToTable("CollectionOptionModel"); + + b1.WithOwner() + .HasForeignKey("ActivateCollectionId"); + }); + + b.Navigation("Avatar"); + + b.Navigation("Options"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossChallengeModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossClaimRewardModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossRushModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossSeasonModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "RaffleWinner") + .WithMany() + .HasForeignKey("RaffleWinnerAddress"); + + b.Navigation("RaffleWinner"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossUnlockFloorModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossWantedModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonFailModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AvatarModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleArenaModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleGrandFinaleModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ClaimStakeRewardModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationConsumableModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationEquipmentModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Crafting.CustomEquipmentCraftModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Crafting.RapidCombinationModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventConsumableItemCraftsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventDungeonBattleModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventMaterialItemCraftsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Grinding.GrindingModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashSweepModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasRandomBuffModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasWithRandomBuffModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementFailModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.JoinArenaModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.MigrateMonsterCollectionModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.PetEnhancementModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ReplaceCombinationEquipmentMaterialModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneEnhancementModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RunesAcquiredModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneSummonFailModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneSummonModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.StakeModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockEquipmentRecipeModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockRuneSlotModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockWorldModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserConsumablesModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserCostumesModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserCrystalsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserMaterialsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserMonsterCollectionsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserNCGsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserRunesModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserStakingsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AvatarModel", b => + { + b.Navigation("ActivateCollections"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/NineChronicles.DataProvider.Executable/Migrations/20240912124503_CustomEquipmentCraft.cs b/NineChronicles.DataProvider.Executable/Migrations/20240912124503_CustomEquipmentCraft.cs new file mode 100644 index 00000000..27f6c6a7 --- /dev/null +++ b/NineChronicles.DataProvider.Executable/Migrations/20240912124503_CustomEquipmentCraft.cs @@ -0,0 +1,74 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace NineChronicles.DataProvider.Executable.Migrations +{ + public partial class CustomEquipmentCraft : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "CustomEquipmentCraft", + columns: table => new + { + Id = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + BlockIndex = table.Column(type: "bigint", nullable: false), + AgentAddress = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AvatarAddress = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + SlotIndex = table.Column(type: "int", nullable: false), + RecipeId = table.Column(type: "int", nullable: false), + Relationship = table.Column(type: "int", nullable: false), + Scroll = table.Column(type: "int", nullable: false), + Circle = table.Column(type: "int", nullable: false), + AdditionalMaterials = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + EquipmentId = table.Column(type: "int", nullable: false), + ElementalType = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IconId = table.Column(type: "int", nullable: false), + TotalCP = table.Column(type: "bigint", nullable: false), + OptionId = table.Column(type: "int", nullable: false), + CraftWithRandom = table.Column(type: "tinyint(1)", nullable: false), + HasRandomOnlyIcon = table.Column(type: "tinyint(1)", nullable: false), + Date = table.Column(type: "date", nullable: false), + TimeStamp = table.Column(type: "datetime(6)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_CustomEquipmentCraft", x => x.Id); + table.ForeignKey( + name: "FK_CustomEquipmentCraft_Agents_AgentAddress", + column: x => x.AgentAddress, + principalTable: "Agents", + principalColumn: "Address"); + table.ForeignKey( + name: "FK_CustomEquipmentCraft_Avatars_AvatarAddress", + column: x => x.AvatarAddress, + principalTable: "Avatars", + principalColumn: "Address"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_CustomEquipmentCraft_AgentAddress", + table: "CustomEquipmentCraft", + column: "AgentAddress"); + + migrationBuilder.CreateIndex( + name: "IX_CustomEquipmentCraft_AvatarAddress", + table: "CustomEquipmentCraft", + column: "AvatarAddress"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "CustomEquipmentCraft"); + } + } +} diff --git a/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs b/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs index e2952ca0..01f27f51 100644 --- a/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs +++ b/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs @@ -835,6 +835,74 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("CombinationEquipments"); }); + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Crafting.CustomEquipmentCraftModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AdditionalMaterials") + .HasColumnType("longtext"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Circle") + .HasColumnType("int"); + + b.Property("CraftWithRandom") + .HasColumnType("tinyint(1)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("HasRandomOnlyIcon") + .HasColumnType("tinyint(1)"); + + b.Property("IconId") + .HasColumnType("int"); + + b.Property("OptionId") + .HasColumnType("int"); + + b.Property("RecipeId") + .HasColumnType("int"); + + b.Property("Relationship") + .HasColumnType("int"); + + b.Property("Scroll") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalCP") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("CustomEquipmentCraft"); + }); + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Crafting.RapidCombinationModel", b => { b.Property("Id") @@ -3805,6 +3873,21 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("Avatar"); }); + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Crafting.CustomEquipmentCraftModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Crafting.RapidCombinationModel", b => { b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") diff --git a/NineChronicles.DataProvider/Store/Models/Crafting/CustomEquipmentCraftModel.cs b/NineChronicles.DataProvider/Store/Models/Crafting/CustomEquipmentCraftModel.cs new file mode 100644 index 00000000..7a1469e9 --- /dev/null +++ b/NineChronicles.DataProvider/Store/Models/Crafting/CustomEquipmentCraftModel.cs @@ -0,0 +1,55 @@ +namespace NineChronicles.DataProvider.Store.Models.Crafting +{ + using System; + using System.ComponentModel.DataAnnotations; + + public class CustomEquipmentCraftModel + { + [Key] + public string? Id { get; set; } + + // Common + public long BlockIndex { get; set; } + + public string? AgentAddress { get; set; } + + public AgentModel? Agent { get; set; } + + public string? AvatarAddress { get; set; } + + public AvatarModel? Avatar { get; set; } + + // Input + public int SlotIndex { get; set; } + + public int RecipeId { get; set; } + + public int Relationship { get; set; } + + public int Scroll { get; set; } + + public int Circle { get; set; } + + public string? AdditionalMaterials { get; set; } + + // Result + public int EquipmentId { get; set; } + + public string? ElementalType { get; set; } + + public int IconId { get; set; } + + public long TotalCP { get; set; } + + public int OptionId { get; set; } + + public bool CraftWithRandom { get; set; } + + public bool HasRandomOnlyIcon { get; set; } + + // Time + public DateOnly Date { get; set; } + + public DateTimeOffset TimeStamp { get; set; } + } +} From 3c7190ec709e9052b4ff69118f9a901a2c9620d7 Mon Sep 17 00:00:00 2001 From: hyeon Date: Thu, 12 Sep 2024 21:52:31 +0900 Subject: [PATCH 39/62] Record CustomEquipmentCraft action to DB --- .../Crafting/CustomEquipmentCraftData.cs | 89 +++++++++++++++++++ .../RenderSubscriber.cs | 7 +- .../Store/MySql/CraftingStore.cs | 36 +++++++- .../Store/MySqlStore.cs | 2 + .../Store/NineChroniclesContext.cs | 2 + .../Subscriber/CraftingRenderSubscriber.cs | 72 ++++++++++++++- 6 files changed, 202 insertions(+), 6 deletions(-) create mode 100644 NineChronicles.DataProvider/DataRendering/Crafting/CustomEquipmentCraftData.cs diff --git a/NineChronicles.DataProvider/DataRendering/Crafting/CustomEquipmentCraftData.cs b/NineChronicles.DataProvider/DataRendering/Crafting/CustomEquipmentCraftData.cs new file mode 100644 index 00000000..d611af7c --- /dev/null +++ b/NineChronicles.DataProvider/DataRendering/Crafting/CustomEquipmentCraftData.cs @@ -0,0 +1,89 @@ +namespace NineChronicles.DataProvider.DataRendering.Crafting +{ + using System; + using System.Collections.Generic; + using System.Linq; + using Libplanet.Action; + using Libplanet.Action.State; + using Libplanet.Crypto; + using Nekoyume.Action.CustomEquipmentCraft; + using Nekoyume.Extensions; + using Nekoyume.Model.Item; + using Nekoyume.Module; + using Nekoyume.TableData.CustomEquipmentCraft; + using NineChronicles.DataProvider.Store.Models.Crafting; + + public static class CustomEquipmentCraftData + { + public static List GetCustomEquipmentCraftInfo( + IWorld prevState, + IWorld outputState, + IRandom random, + Address signer, + Guid actionId, + CustomEquipmentCraft action, + long blockIndex, + DateTimeOffset blockTime + ) + { + var info = new List(); + var outputCombinationSlots = outputState.GetAllCombinationSlotState(action.AvatarAddress); + var relationship = prevState.GetRelationship(action.AvatarAddress); + var sheets = prevState.GetSheets(sheetTypes: new List + { + typeof(CustomEquipmentCraftRecipeSheet), + typeof(CustomEquipmentCraftRelationshipSheet), + typeof(CustomEquipmentCraftOptionSheet), + }); + var recipeSheet = sheets.GetSheet(); + var relationshipSheet = sheets.GetSheet(); + var optionSheet = sheets.GetSheet(); + + for (var i = 0; i < action.CraftList.Count; i++) + { + var craftData = action.CraftList[i]; + var gameConfig = prevState.GetGameConfigState(); + var recipeRow = recipeSheet.OrderedList!.First(row => row.Id == craftData.RecipeId); + var relationshipRow = relationshipSheet.OrderedList!.Reverse() + .First(row => row.Relationship <= relationship); + var slot = outputCombinationSlots.GetSlot(craftData.SlotIndex); + var equipment = (Equipment)slot.Result.itemUsable; + + var circleCost = (decimal)recipeRow.CircleAmount * relationshipRow.CostMultiplier / 10000m; + if (craftData.RecipeId == 0) + { + // Random + circleCost = circleCost * gameConfig.CustomEquipmentCraftIconCostMultiplier / 10000m; + } + + info.Add(new CustomEquipmentCraftModel + { + Id = $"{actionId}_{i}", + AgentAddress = signer.ToString(), + AvatarAddress = action.AvatarAddress.ToString(), + RecipeId = craftData.RecipeId, + SlotIndex = craftData.SlotIndex, + Scroll = (int)Math.Floor(recipeRow.ScrollAmount * relationshipRow.CostMultiplier / 10000m), + Circle = (int)Math.Floor(circleCost), + AdditionalMaterials = string.Empty, + Relationship = relationship, + EquipmentId = equipment.Id, + IconId = equipment.IconId, + ElementalType = equipment.ElementalType.ToString(), + OptionId = ItemFactory.SelectOption(recipeRow.ItemSubType, optionSheet, random).Id, + TotalCP = random.Next(relationshipRow.MinCp, relationshipRow.MaxCp + 1), + CraftWithRandom = equipment.CraftWithRandom, + HasRandomOnlyIcon = equipment.HasRandomOnlyIcon, + BlockIndex = blockIndex, + Date = DateOnly.FromDateTime(blockTime.DateTime), + TimeStamp = blockTime.UtcDateTime, + } + ); + + relationship++; + } + + return info; + } + } +} diff --git a/NineChronicles.DataProvider/RenderSubscriber.cs b/NineChronicles.DataProvider/RenderSubscriber.cs index 9eab5eb0..c8e5dbfc 100644 --- a/NineChronicles.DataProvider/RenderSubscriber.cs +++ b/NineChronicles.DataProvider/RenderSubscriber.cs @@ -18,6 +18,7 @@ namespace NineChronicles.DataProvider using Nekoyume; using Nekoyume.Action; using Nekoyume.Action.AdventureBoss; + using Nekoyume.Action.CustomEquipmentCraft; using Nekoyume.Extensions; using Nekoyume.Helper; using Nekoyume.Model.EnumType; @@ -1660,6 +1661,8 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) // Grinding _actionRenderer.EveryRender().Subscribe(SubscribeGrinding); + _actionRenderer.EveryRender().Subscribe(SubscribeCustomEquipmentCraft); + return Task.CompletedTask; } @@ -1681,6 +1684,8 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) //// Grinding partial void SubscribeGrinding(ActionEvaluation ev); + + partial void SubscribeCustomEquipmentCraft(ActionEvaluation evt); /* Partial Methods */ private void AddShopHistoryItem(ITradableItem orderItem, Address buyerAvatarAddress, PurchaseInfo purchaseInfo, int itemCount, long blockIndex) @@ -1815,7 +1820,7 @@ private void StoreRenderedData((Block OldTip, Block NewTip) b) MySqlStore.StoreRuneSummonList(_runeSummonList); MySqlStore.StoreRuneSummonFailList(_runeSummonFailList); StoreAdventureBossList(); - StoreRapidCombinationList(); + StoreCraftingData(); StoreGrindList(); }), }; diff --git a/NineChronicles.DataProvider/Store/MySql/CraftingStore.cs b/NineChronicles.DataProvider/Store/MySql/CraftingStore.cs index 4177a22c..b060b6e8 100644 --- a/NineChronicles.DataProvider/Store/MySql/CraftingStore.cs +++ b/NineChronicles.DataProvider/Store/MySql/CraftingStore.cs @@ -9,9 +9,8 @@ namespace NineChronicles.DataProvider.Store /// /// Store functions related to crafting. - /// - ItemEnhancement - /// - CombinationEquipment /// - RapidCombination + /// - CustomEquipmentCraft /// and so on. /// public partial class MySqlStore @@ -48,5 +47,38 @@ public async partial Task StoreRapidCombinationList(List } } } + + // CustomEquipmentCraft + public async partial Task StoreCustomEquipmentCraftList( + List customEquipmentCraftList) + { + NineChroniclesContext? ctx = null; + try + { + ctx = await _dbContextFactory.CreateDbContextAsync(); + foreach (var cec in customEquipmentCraftList) + { + if (await ctx.CustomEquipmentCraft.FirstOrDefaultAsync(c => c.Id == cec.Id) is null) + { + await ctx.CustomEquipmentCraft.AddAsync(cec); + } + } + + await ctx.SaveChangesAsync(); + Log.Debug($"[CustomEquipmentCraft] {customEquipmentCraftList.Count} CustomEquipmentCraft saved."); + } + catch (Exception e) + { + Log.Debug(e.Message); + Log.Debug(e.StackTrace); + } + finally + { + if (ctx is not null) + { + await ctx.DisposeAsync(); + } + } + } } } diff --git a/NineChronicles.DataProvider/Store/MySqlStore.cs b/NineChronicles.DataProvider/Store/MySqlStore.cs index c873ff64..9d194628 100644 --- a/NineChronicles.DataProvider/Store/MySqlStore.cs +++ b/NineChronicles.DataProvider/Store/MySqlStore.cs @@ -1890,6 +1890,8 @@ public void StoreRuneSummonFailList(List runeSummonFailList public partial Task StoreRapidCombinationList(List rapidCombinationList); + public partial Task StoreCustomEquipmentCraftList(List customEquipmentCraftList); + public partial Task StoreGrindList(List grindingList); public List GetRaiderList() diff --git a/NineChronicles.DataProvider/Store/NineChroniclesContext.cs b/NineChronicles.DataProvider/Store/NineChroniclesContext.cs index ec3f6681..f705169e 100644 --- a/NineChronicles.DataProvider/Store/NineChroniclesContext.cs +++ b/NineChronicles.DataProvider/Store/NineChroniclesContext.cs @@ -221,6 +221,8 @@ public NineChroniclesContext(DbContextOptions options) public DbSet AdventureBossClaimReward => Set(); /* Adventure Boss */ + public DbSet CustomEquipmentCraft => Set(); + // Table for daily metrics data public DbSet DailyMetrics => Set(); diff --git a/NineChronicles.DataProvider/Subscriber/CraftingRenderSubscriber.cs b/NineChronicles.DataProvider/Subscriber/CraftingRenderSubscriber.cs index bc7e90e9..56ec66a8 100644 --- a/NineChronicles.DataProvider/Subscriber/CraftingRenderSubscriber.cs +++ b/NineChronicles.DataProvider/Subscriber/CraftingRenderSubscriber.cs @@ -7,6 +7,7 @@ namespace NineChronicles.DataProvider using Lib9c.Renderers; using Libplanet.Action.State; using Nekoyume.Action; + using Nekoyume.Action.CustomEquipmentCraft; using Nekoyume.Model.EnumType; using NineChronicles.DataProvider.DataRendering; using NineChronicles.DataProvider.DataRendering.Crafting; @@ -16,21 +17,31 @@ namespace NineChronicles.DataProvider public partial class RenderSubscriber { private List _rapidCombinationList = new (); + private List _customEquipmentCraftList = new (); - // RapidCombination - private void StoreRapidCombinationList() + // Store + private void StoreCraftingData() { try { var tasks = new List(); - Log.Debug("[Crafting] Store RapidCombination list"); + // RapidCombination + Log.Debug("[Crafting] Store RapidCombination list"); tasks.Add(Task.Run(async () => { Log.Debug($"[RapidCombination] {_rapidCombinationList.Count}"); await MySqlStore.StoreRapidCombinationList(_rapidCombinationList); })); + // CustomEquipmentCraft + Log.Debug("[Crafting] Store CustomEquipmentCraft list"); + tasks.Add(Task.Run(async () => + { + Log.Debug($"[CustomEquipmentCraft] {_customEquipmentCraftList.Count}"); + await MySqlStore.StoreCustomEquipmentCraftList(_customEquipmentCraftList); + })); + Task.WaitAll(tasks.ToArray()); } catch (Exception e) @@ -39,12 +50,15 @@ private void StoreRapidCombinationList() } } + // Clear private void ClearRapidCombinationList() { Log.Debug("[Crafting] Clear crafting related action data"); _rapidCombinationList.Clear(); + _customEquipmentCraftList.Clear(); } + // Subscribe partial void SubscribeRapidCombination(ActionEvaluation ev) { try @@ -93,5 +107,57 @@ partial void SubscribeRapidCombination(ActionEvaluation ev) ); } } + + partial void SubscribeCustomEquipmentCraft(ActionEvaluation evt) + { + try + { + if (evt.Exception == null && evt.Action is { } customEquipmentCraft) + { + var start = DateTimeOffset.UtcNow; + var prevState = new World(_blockChainStates.GetWorldState(evt.PreviousState)); + var outputState = new World(_blockChainStates.GetWorldState(evt.OutputState)); + var avatarAddress = customEquipmentCraft.AvatarAddress; + + if (!_avatars.Contains(avatarAddress)) + { + _avatars.Add(avatarAddress); + _avatarList.Add( + AvatarData.GetAvatarInfo( + outputState, evt.Signer, avatarAddress, _blockTimeOffset, BattleType.Adventure + ) + ); + } + + var actionId = Guid.NewGuid(); + _customEquipmentCraftList = _customEquipmentCraftList.Concat( + CustomEquipmentCraftData.GetCustomEquipmentCraftInfo( + prevState, + outputState, + new ReplayRandom(evt.RandomSeed), + evt.Signer, + actionId, + customEquipmentCraft, + evt.BlockIndex, + _blockTimeOffset + ) + ).ToList(); + Log.Debug( + "[DataProvider] Stored RapidCombination action in block #{index}. Time Taken: {time} ms.", + evt.BlockIndex, + (DateTimeOffset.UtcNow - start).Milliseconds + ); + } + } + catch (Exception e) + { + Log.Error( + e, + "[DataProvider] RenderSubscriber Error: {ErrorMessage}, StackTrace: {StackTrace}", + e.Message, + e.StackTrace + ); + } + } } } From 4b7ae8c90c3f77ff03f22c632da6396bf3ecd1b3 Mon Sep 17 00:00:00 2001 From: hyeon Date: Thu, 12 Sep 2024 22:40:29 +0900 Subject: [PATCH 40/62] Fix wrong params --- NineChronicles.DataProvider.Executable/Program.cs | 3 --- .../ItemEnhancementDataTest.cs | 12 +++++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/NineChronicles.DataProvider.Executable/Program.cs b/NineChronicles.DataProvider.Executable/Program.cs index 8760a6ec..dae3ac65 100644 --- a/NineChronicles.DataProvider.Executable/Program.cs +++ b/NineChronicles.DataProvider.Executable/Program.cs @@ -1,5 +1,4 @@ #nullable enable -using System.Collections.Concurrent; using System.Collections.Generic; using System.Collections.Immutable; using System.IO; @@ -8,7 +7,6 @@ using Libplanet.Headless.Hosting; using Microsoft.Extensions.Logging; using Nekoyume.Action.Loader; -using Sentry; using IPAddress = System.Net.IPAddress; namespace NineChronicles.DataProvider.Executable @@ -190,7 +188,6 @@ IActionEvaluatorConfiguration GetActionEvaluatorConfiguration(IConfiguration con { RpcRemoteSever = false }, - new ConcurrentDictionary(), new StateMemoryCache() ); diff --git a/NineChronicles.DataProvider.Tests/ItemEnhancementDataTest.cs b/NineChronicles.DataProvider.Tests/ItemEnhancementDataTest.cs index 87f50c8b..bc3161c2 100644 --- a/NineChronicles.DataProvider.Tests/ItemEnhancementDataTest.cs +++ b/NineChronicles.DataProvider.Tests/ItemEnhancementDataTest.cs @@ -46,10 +46,20 @@ public void GetItemEnhancementInfo() 6,Jotunheim,251,300 7,Niflheim,301,350 8,Hel,351,400"); + var avatarName = "test"; var avatarSheets = new AvatarSheets(worldSheet, new QuestSheet(), new QuestRewardSheet(), new QuestItemRewardSheet(), new EquipmentItemRecipeSheet(), new EquipmentItemSubRecipeSheet()); var avatarAddress = new PrivateKey().Address; - var avatarState = new AvatarState(avatarAddress, _signer, 1L, avatarSheets, default, "test"); + var worldInformation = new WorldInformation(blockIndex, avatarSheets.WorldSheet, + GameConfig.IsEditor, avatarName); + var questList = new QuestList( + avatarSheets.QuestSheet, + avatarSheets.QuestRewardSheet, + avatarSheets.QuestItemRewardSheet, + avatarSheets.EquipmentItemRecipeSheet, + avatarSheets.EquipmentItemSubRecipeSheet + ); + var avatarState = new AvatarState(avatarAddress, _signer, 1L, questList, worldInformation, default, avatarName); var equipmentRow = new EquipmentItemSheet.Row(); equipmentRow.Set("10100000,Weapon,0,Normal,0,ATK,1,2,10100000,10".Split(",")); var itemId = Guid.NewGuid(); From e09f8351641d1a60123e9946c5ed8d1654f6bbd1 Mon Sep 17 00:00:00 2001 From: hyeon Date: Fri, 13 Sep 2024 01:34:27 +0900 Subject: [PATCH 41/62] Add UnlockCombinationSlot model --- ...12163112_UnlockCombinationSlot.Designer.cs | 4415 +++++++++++++++++ .../20240912163112_UnlockCombinationSlot.cs | 64 + .../NineChroniclesContextModelSnapshot.cs | 115 +- .../Store/Models/Base/BaseModel.cs | 21 + .../Store/Models/Base/IAvatar.cs | 9 + .../Crafting/UnlockCombinationSlotModel.cs | 17 + .../Store/NineChroniclesContext.cs | 3 + 7 files changed, 4579 insertions(+), 65 deletions(-) create mode 100644 NineChronicles.DataProvider.Executable/Migrations/20240912163112_UnlockCombinationSlot.Designer.cs create mode 100644 NineChronicles.DataProvider.Executable/Migrations/20240912163112_UnlockCombinationSlot.cs create mode 100644 NineChronicles.DataProvider/Store/Models/Base/BaseModel.cs create mode 100644 NineChronicles.DataProvider/Store/Models/Base/IAvatar.cs create mode 100644 NineChronicles.DataProvider/Store/Models/Crafting/UnlockCombinationSlotModel.cs diff --git a/NineChronicles.DataProvider.Executable/Migrations/20240912163112_UnlockCombinationSlot.Designer.cs b/NineChronicles.DataProvider.Executable/Migrations/20240912163112_UnlockCombinationSlot.Designer.cs new file mode 100644 index 00000000..6f79ce83 --- /dev/null +++ b/NineChronicles.DataProvider.Executable/Migrations/20240912163112_UnlockCombinationSlot.Designer.cs @@ -0,0 +1,4415 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using NineChronicles.DataProvider.Store; + +#nullable disable + +namespace NineChronicles.DataProvider.Executable.Migrations +{ + [DbContext(typeof(NineChroniclesContext))] + [Migration("20240912163112_UnlockCombinationSlot")] + partial class UnlockCombinationSlot + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.1") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AbilityRankingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("AbilityRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ActivateCollectionModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ActionId") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("AvatarAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CollectionId") + .HasColumnType("int"); + + b.Property("CreatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AvatarAddress", "CollectionId") + .IsUnique(); + + b.ToTable("ActivateCollections"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossChallengeModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EndFloor") + .HasColumnType("int"); + + b.Property("Point") + .HasColumnType("int"); + + b.Property("Season") + .HasColumnType("bigint"); + + b.Property("StartFloor") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalPoint") + .HasColumnType("bigint"); + + b.Property("UsedApPotion") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("AdventureBossChallenge"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossClaimRewardModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ClaimedSeason") + .HasColumnType("longtext"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("NcgReward") + .HasColumnType("decimal(65,30)"); + + b.Property("RewardData") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("AdventureBossClaimReward"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossRushModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EndFloor") + .HasColumnType("int"); + + b.Property("Point") + .HasColumnType("int"); + + b.Property("Season") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalPoint") + .HasColumnType("bigint"); + + b.Property("UsedApPotion") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("AdventureBossRush"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossSeasonModel", b => + { + b.Property("Season") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("BossId") + .HasColumnType("int"); + + b.Property("ClaimableBlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EndBlockIndex") + .HasColumnType("bigint"); + + b.Property("FixedRewardData") + .HasColumnType("longtext"); + + b.Property("NextSeasonBlockIndex") + .HasColumnType("bigint"); + + b.Property("RaffleReward") + .HasColumnType("decimal(65,30)"); + + b.Property("RaffleWinnerAddress") + .HasColumnType("varchar(255)"); + + b.Property("RandomRewardData") + .HasColumnType("longtext"); + + b.Property("StartBlockIndex") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Season"); + + b.HasIndex("RaffleWinnerAddress"); + + b.ToTable("AdventureBossSeason"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossUnlockFloorModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Season") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalUsedGoldenDust") + .HasColumnType("bigint"); + + b.Property("TotalUsedNcg") + .HasColumnType("decimal(65,30)"); + + b.Property("UnlockFloor") + .HasColumnType("int"); + + b.Property("UsedGoldenDust") + .HasColumnType("bigint"); + + b.Property("UsedNcg") + .HasColumnType("decimal(65,30)"); + + b.HasKey("Id"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("AdventureBossUnlockFloor"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossWantedModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Bounty") + .HasColumnType("decimal(65,30)"); + + b.Property("Count") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Season") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalBounty") + .HasColumnType("decimal(65,30)"); + + b.HasKey("Id"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("AdventureBossWanted"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AgentModel", b => + { + b.Property("Address") + .HasColumnType("varchar(255)"); + + b.HasKey("Address"); + + b.ToTable("Agents"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ApprovePledgeModel", b => + { + b.Property("TxId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("PatronAddress") + .HasColumnType("longtext"); + + b.Property("Signer") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("TxId"); + + b.HasIndex("Date"); + + b.ToTable("ApprovePledges"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonFailModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Exception") + .HasColumnType("longtext"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.Property("SummonCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("AuraSummonFails"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.Property("SummonCount") + .HasColumnType("int"); + + b.Property("SummonResult") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("AuraSummons"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AvatarModel", b => + { + b.Property("Address") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.HasKey("Address"); + + b.HasIndex("AgentAddress"); + + b.ToTable("Avatars"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleArenaModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("ChampionshipId") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EnemyAvatarAddress") + .HasColumnType("longtext"); + + b.Property("MedalCount") + .HasColumnType("int"); + + b.Property("Round") + .HasColumnType("int"); + + b.Property("TicketCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("Victory") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("BattleArenas"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleArenaRankingModel", b => + { + b.Property("AdditionalTicketPrice") + .HasColumnType("bigint"); + + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArenaType") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ChampionshipId") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EndBlockIndex") + .HasColumnType("bigint"); + + b.Property("EntranceFee") + .HasColumnType("bigint"); + + b.Property("LossCount") + .HasColumnType("int"); + + b.Property("MedalCount") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("PurchasedTicketCount") + .HasColumnType("int"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("RequiredMedalCount") + .HasColumnType("int"); + + b.Property("Round") + .HasColumnType("int"); + + b.Property("Score") + .HasColumnType("int"); + + b.Property("StartBlockIndex") + .HasColumnType("bigint"); + + b.Property("Ticket") + .HasColumnType("int"); + + b.Property("TicketPrice") + .HasColumnType("bigint"); + + b.Property("TicketResetCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.Property("WinCount") + .HasColumnType("int"); + + b.ToTable("BattleArenaRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleGrandFinaleModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("EnemyAvatarAddress") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("GrandFinaleId") + .HasColumnType("int"); + + b.Property("GrandFinaleScore") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("Victory") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("BattleGrandFinales"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BlockModel", b => + { + b.Property("Hash") + .HasColumnType("varchar(255)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Difficulty") + .HasColumnType("bigint"); + + b.Property("Index") + .HasColumnType("bigint"); + + b.Property("Miner") + .HasColumnType("longtext"); + + b.Property("Nonce") + .HasColumnType("longtext"); + + b.Property("PreviousHash") + .HasColumnType("longtext"); + + b.Property("ProtocolVersion") + .HasColumnType("int"); + + b.Property("PublicKey") + .HasColumnType("longtext"); + + b.Property("StateRootHash") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalDifficulty") + .HasColumnType("bigint"); + + b.Property("TxCount") + .HasColumnType("int"); + + b.Property("TxHash") + .HasColumnType("longtext"); + + b.HasKey("Hash"); + + b.HasIndex("Date"); + + b.HasIndex("Index"); + + b.ToTable("Blocks"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ClaimStakeRewardModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ApPotionCount") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ClaimRewardAvatarAddress") + .HasColumnType("longtext"); + + b.Property("ClaimStakeEndBlockIndex") + .HasColumnType("bigint"); + + b.Property("ClaimStakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("HourGlassCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("Date"); + + b.ToTable("ClaimStakeRewards"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationConsumableModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("RecipeId") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("CombinationConsumables"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationEquipmentModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("OptionCount") + .HasColumnType("int"); + + b.Property("RecipeId") + .HasColumnType("int"); + + b.Property("SkillContains") + .HasColumnType("tinyint(1)"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("SubRecipeId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("CombinationEquipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Crafting.CustomEquipmentCraftCountModel", b => + { + b.Property("IconId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Count") + .HasColumnType("bigint"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.HasKey("IconId"); + + b.ToTable("CustomEquipmentCraftCount"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Crafting.CustomEquipmentCraftModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AdditionalCost") + .HasColumnType("longtext"); + + b.Property("AdditionalMaterials") + .HasColumnType("longtext"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Circle") + .HasColumnType("int"); + + b.Property("CraftWithRandom") + .HasColumnType("tinyint(1)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("EquipmentItemId") + .HasColumnType("int"); + + b.Property("HasRandomOnlyIcon") + .HasColumnType("tinyint(1)"); + + b.Property("IconId") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("NcgCost") + .HasColumnType("decimal(65,30)"); + + b.Property("OptionId") + .HasColumnType("int"); + + b.Property("RecipeId") + .HasColumnType("int"); + + b.Property("Relationship") + .HasColumnType("int"); + + b.Property("Scroll") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalCP") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("CustomEquipmentCraft"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Crafting.RapidCombinationModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("HourglassCount") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("RapidCombinations"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Crafting.UnlockCombinationSlotModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CrystalCost") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("MaterialCosts") + .HasColumnType("longtext"); + + b.Property("NcgCost") + .HasColumnType("decimal(65,30)"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UnlockCombinationSlot"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CraftRankingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("CraftCount") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("CraftRankings"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.DailyMetricModel", b => + { + b.Property("Date") + .HasColumnType("date"); + + b.Property("ApUsage") + .HasColumnType("int"); + + b.Property("ArenaNcg") + .HasColumnType("decimal(65,30)"); + + b.Property("AuraSummonCount") + .HasColumnType("int"); + + b.Property("CraftingConsumableCount") + .HasColumnType("int"); + + b.Property("CraftingConsumableUsers") + .HasColumnType("int"); + + b.Property("CraftingEquipmentCount") + .HasColumnType("int"); + + b.Property("CraftingEquipmentUsers") + .HasColumnType("int"); + + b.Property("DailyNew") + .HasColumnType("int"); + + b.Property("Dau") + .HasColumnType("int"); + + b.Property("EnhanceCount") + .HasColumnType("int"); + + b.Property("EnhanceNcg") + .HasColumnType("decimal(65,30)"); + + b.Property("EnhanceUsers") + .HasColumnType("int"); + + b.Property("EventTicketNcg") + .HasColumnType("decimal(65,30)"); + + b.Property("HackAndSlashCount") + .HasColumnType("int"); + + b.Property("HackAndSlashUsers") + .HasColumnType("int"); + + b.Property("HourglassUsage") + .HasColumnType("int"); + + b.Property("NcgTrade") + .HasColumnType("decimal(65,30)"); + + b.Property("RuneNcg") + .HasColumnType("decimal(65,30)"); + + b.Property("RuneSlotNcg") + .HasColumnType("decimal(65,30)"); + + b.Property("RuneSummonCount") + .HasColumnType("int"); + + b.Property("SweepCount") + .HasColumnType("int"); + + b.Property("SweepUsers") + .HasColumnType("int"); + + b.Property("TxCount") + .HasColumnType("int"); + + b.HasKey("Date"); + + b.HasIndex("Date"); + + b.ToTable("DailyMetrics"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("ItemId"); + + b.ToTable("Equipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingArmorModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingArmor"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingBeltModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingBelt"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingNecklaceModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingNecklace"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingRingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingRing"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingWeaponModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingWeapon"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventConsumableItemCraftsModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EventConsumableItemRecipeId") + .HasColumnType("int"); + + b.Property("EventScheduleId") + .HasColumnType("int"); + + b.Property("RequiredItem1Count") + .HasColumnType("int"); + + b.Property("RequiredItem1Id") + .HasColumnType("int"); + + b.Property("RequiredItem2Count") + .HasColumnType("int"); + + b.Property("RequiredItem2Id") + .HasColumnType("int"); + + b.Property("RequiredItem3Count") + .HasColumnType("int"); + + b.Property("RequiredItem3Id") + .HasColumnType("int"); + + b.Property("RequiredItem4Count") + .HasColumnType("int"); + + b.Property("RequiredItem4Id") + .HasColumnType("int"); + + b.Property("RequiredItem5Count") + .HasColumnType("int"); + + b.Property("RequiredItem5Id") + .HasColumnType("int"); + + b.Property("RequiredItem6Count") + .HasColumnType("int"); + + b.Property("RequiredItem6Id") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("EventConsumableItemCrafts"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventDungeonBattleModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("CostumesCount") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EquipmentsCount") + .HasColumnType("int"); + + b.Property("EventDungeonId") + .HasColumnType("int"); + + b.Property("EventDungeonStageId") + .HasColumnType("int"); + + b.Property("EventScheduleId") + .HasColumnType("int"); + + b.Property("FoodsCount") + .HasColumnType("int"); + + b.Property("RemainingTickets") + .HasColumnType("int"); + + b.Property("RewardItem10Count") + .HasColumnType("int"); + + b.Property("RewardItem10Id") + .HasColumnType("int"); + + b.Property("RewardItem1Count") + .HasColumnType("int"); + + b.Property("RewardItem1Id") + .HasColumnType("int"); + + b.Property("RewardItem2Count") + .HasColumnType("int"); + + b.Property("RewardItem2Id") + .HasColumnType("int"); + + b.Property("RewardItem3Count") + .HasColumnType("int"); + + b.Property("RewardItem3Id") + .HasColumnType("int"); + + b.Property("RewardItem4Count") + .HasColumnType("int"); + + b.Property("RewardItem4Id") + .HasColumnType("int"); + + b.Property("RewardItem5Count") + .HasColumnType("int"); + + b.Property("RewardItem5Id") + .HasColumnType("int"); + + b.Property("RewardItem6Count") + .HasColumnType("int"); + + b.Property("RewardItem6Id") + .HasColumnType("int"); + + b.Property("RewardItem7Count") + .HasColumnType("int"); + + b.Property("RewardItem7Id") + .HasColumnType("int"); + + b.Property("RewardItem8Count") + .HasColumnType("int"); + + b.Property("RewardItem8Id") + .HasColumnType("int"); + + b.Property("RewardItem9Count") + .HasColumnType("int"); + + b.Property("RewardItem9Id") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("EventDungeonBattles"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventMaterialItemCraftsModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("EventMaterialItemRecipeId") + .HasColumnType("int"); + + b.Property("EventScheduleId") + .HasColumnType("int"); + + b.Property("Material10Count") + .HasColumnType("int"); + + b.Property("Material10Id") + .HasColumnType("int"); + + b.Property("Material11Count") + .HasColumnType("int"); + + b.Property("Material11Id") + .HasColumnType("int"); + + b.Property("Material12Count") + .HasColumnType("int"); + + b.Property("Material12Id") + .HasColumnType("int"); + + b.Property("Material1Count") + .HasColumnType("int"); + + b.Property("Material1Id") + .HasColumnType("int"); + + b.Property("Material2Count") + .HasColumnType("int"); + + b.Property("Material2Id") + .HasColumnType("int"); + + b.Property("Material3Count") + .HasColumnType("int"); + + b.Property("Material3Id") + .HasColumnType("int"); + + b.Property("Material4Count") + .HasColumnType("int"); + + b.Property("Material4Id") + .HasColumnType("int"); + + b.Property("Material5Count") + .HasColumnType("int"); + + b.Property("Material5Id") + .HasColumnType("int"); + + b.Property("Material6Count") + .HasColumnType("int"); + + b.Property("Material6Id") + .HasColumnType("int"); + + b.Property("Material7Count") + .HasColumnType("int"); + + b.Property("Material7Id") + .HasColumnType("int"); + + b.Property("Material8Count") + .HasColumnType("int"); + + b.Property("Material8Id") + .HasColumnType("int"); + + b.Property("Material9Count") + .HasColumnType("int"); + + b.Property("Material9Id") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("EventMaterialItemCrafts"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Grinding.GrindingModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Crystal") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("EquipmentItemId") + .HasColumnType("longtext"); + + b.Property("EquipmentLevel") + .HasColumnType("int"); + + b.Property("Materials") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("Grindings"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Mimisbrunnr") + .HasColumnType("tinyint(1)"); + + b.Property("StageId") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("HackAndSlashes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashSweepModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("ActionPoint") + .HasColumnType("int"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ApStoneCount") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("CostumesCount") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EquipmentsCount") + .HasColumnType("int"); + + b.Property("Mimisbrunnr") + .HasColumnType("tinyint(1)"); + + b.Property("StageId") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.Property("WorldId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("HackAndSlashSweeps"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasRandomBuffModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("GachaCount") + .HasColumnType("int"); + + b.Property("HasStageId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("HasRandomBuffs"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasWithRandomBuffModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffId") + .HasColumnType("int"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("StageId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("HasWithRandomBuffs"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementFailModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EquipmentItemId") + .HasColumnType("longtext"); + + b.Property("EquipmentLevel") + .HasColumnType("int"); + + b.Property("GainedCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("MaterialIdsCount") + .HasColumnType("int"); + + b.Property("MaterialItemId") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("ItemEnhancementFails"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Exp") + .HasColumnType("bigint"); + + b.Property("HammerCount") + .HasColumnType("int"); + + b.Property("HammerExp") + .HasColumnType("bigint"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("MaterialId") + .HasColumnType("longtext"); + + b.Property("MaterialIdsCount") + .HasColumnType("int"); + + b.Property("SheetId") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("ItemEnhancements"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.JoinArenaModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ArenaRound") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("ChampionshipId") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("JoinArenas"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.MigrateMonsterCollectionModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("MigrationAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("MigrationStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("StakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("Date"); + + b.ToTable("MigrateMonsterCollections"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.PetEnhancementModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("BurntSoulStone") + .HasColumnType("decimal(65,30)"); + + b.Property("ChangedLevel") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("OutputPetLevel") + .HasColumnType("int"); + + b.Property("PetId") + .HasColumnType("int"); + + b.Property("PreviousPetLevel") + .HasColumnType("int"); + + b.Property("TargetLevel") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("PetEnhancements"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RaiderModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Address") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarName") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("CreatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("HighScore") + .HasColumnType("bigint"); + + b.Property("IconId") + .HasColumnType("int"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("PurchaseCount") + .HasColumnType("int"); + + b.Property("RaidId") + .HasColumnType("int"); + + b.Property("TotalScore") + .HasColumnType("bigint"); + + b.Property("UpdatedAt") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("RaidId", "Address") + .IsUnique(); + + b.ToTable("Raiders"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ReplaceCombinationEquipmentMaterialModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("ReplacedMaterialCount") + .HasColumnType("int"); + + b.Property("ReplacedMaterialId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("ReplaceCombinationEquipmentMaterials"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RequestPledgeModel", b => + { + b.Property("TxId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("PledgeAgentAddress") + .HasColumnType("longtext"); + + b.Property("RefillMead") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxSigner") + .HasColumnType("longtext"); + + b.HasKey("TxId"); + + b.HasIndex("Date"); + + b.ToTable("RequestPledges"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneEnhancementModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("BurntRune") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("OutputRuneLevel") + .HasColumnType("int"); + + b.Property("OutputRuneLevelBonus") + .HasColumnType("int"); + + b.Property("PreviousRuneLevel") + .HasColumnType("int"); + + b.Property("PreviousRuneLevelBonus") + .HasColumnType("int"); + + b.Property("RuneId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TryCount") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("RuneEnhancements"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RunesAcquiredModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("ActionType") + .HasColumnType("varchar(255)"); + + b.Property("TickerType") + .HasColumnType("varchar(255)"); + + b.Property("AcquiredRune") + .HasColumnType("decimal(65,30)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id", "ActionType", "TickerType"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.HasIndex("Id", "ActionType", "TickerType") + .IsUnique(); + + b.ToTable("RunesAcquired"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneSummonFailModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Exception") + .HasColumnType("longtext"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.Property("SummonCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("RuneSummonFails"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneSummonModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.Property("SummonCount") + .HasColumnType("int"); + + b.Property("SummonResult") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("RuneSummons"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopConsumableModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("MainStat") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.HasKey("ItemId"); + + b.ToTable("ShopConsumables"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopCostumeModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Equipped") + .HasColumnType("tinyint(1)"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.HasKey("ItemId"); + + b.ToTable("ShopCostumes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopEquipmentModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SetId") + .HasColumnType("int"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("UniqueStatType") + .HasColumnType("longtext"); + + b.HasKey("ItemId"); + + b.ToTable("ShopEquipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryConsumableModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("MainStat") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.HasIndex("Date"); + + b.ToTable("ShopHistoryConsumables"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryCostumeModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Equipped") + .HasColumnType("tinyint(1)"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.HasIndex("Date"); + + b.ToTable("ShopHistoryCostumes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryEquipmentModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SetId") + .HasColumnType("int"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.Property("UniqueStatType") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.HasIndex("Date"); + + b.ToTable("ShopHistoryEquipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryFungibleAssetValueModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("Quantity") + .HasColumnType("decimal(65,30)"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Ticker") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.HasIndex("Date"); + + b.ToTable("ShopHistoryFungibleAssetValues"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryMaterialModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.HasIndex("Date"); + + b.ToTable("ShopHistoryMaterials"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopMaterialModel", b => + { + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.ToTable("ShopMaterials"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.StageRankingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ClearedStageId") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("StageRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.StakeModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("NewAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("NewStakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("PrevStakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("PreviousAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("RemainingNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("Date"); + + b.ToTable("Stakings"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.TransactionModel", b => + { + b.Property("TxId") + .HasColumnType("varchar(255)"); + + b.Property("ActionType") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("Nonce") + .HasColumnType("bigint"); + + b.Property("PublicKey") + .HasColumnType("longtext"); + + b.Property("Signer") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("UpdatedAddressesCount") + .HasColumnType("int"); + + b.HasKey("TxId"); + + b.HasIndex("Date"); + + b.HasIndex(new[] { "Date", "ActionType" }, "IDX_Date_ActionType"); + + b.ToTable("Transactions"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.TransferAssetModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("Amount") + .HasColumnType("decimal(65,30)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Recipient") + .HasColumnType("longtext"); + + b.Property("Sender") + .HasColumnType("longtext"); + + b.Property("TickerType") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Date"); + + b.ToTable("TransferAssets"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockEquipmentRecipeModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("UnlockEquipmentRecipeId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("UnlockEquipmentRecipes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockRuneSlotModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCRYSTAL") + .HasColumnType("decimal(65,30)"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("UnlockRuneSlots"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockWorldModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("UnlockWorldId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Date"); + + b.ToTable("UnlockWorlds"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserConsumablesModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("MainStat") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UserConsumables"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserCostumesModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Equipped") + .HasColumnType("tinyint(1)"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UserCostumes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserCrystalsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CrystalBalance") + .HasColumnType("decimal(65,30)"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("UserCrystals"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserEquipmentsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SetId") + .HasColumnType("int"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("UniqueStatType") + .HasColumnType("longtext"); + + b.ToTable("UserEquipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserMaterialsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Count") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UserMaterials"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserMonsterCollectionsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("MonsterCollectionAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("ReceivedBlockIndex") + .HasColumnType("bigint"); + + b.Property("RewardLevel") + .HasColumnType("bigint"); + + b.Property("StartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("UserMonsterCollections"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserNCGsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("NCGBalance") + .HasColumnType("decimal(65,30)"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("UserNCGs"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserRunesModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("RuneBalance") + .HasColumnType("decimal(65,30)"); + + b.Property("Ticker") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UserRunes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserStakingsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CancellableBlockIndex") + .HasColumnType("bigint"); + + b.Property("ReceivedBlockIndex") + .HasColumnType("bigint"); + + b.Property("StakeAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("StartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("UserStakings"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.WorldBossRankingModel", b => + { + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("AvatarName") + .HasColumnType("longtext"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("HighScore") + .HasColumnType("int"); + + b.Property("IconId") + .HasColumnType("int"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TotalScore") + .HasColumnType("int"); + + b.ToTable("WorldBossRankings", null, t => t.ExcludeFromMigrations()); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.WorldBossSeasonMigrationModel", b => + { + b.Property("RaidId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("MigratedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.HasKey("RaidId"); + + b.HasIndex("RaidId") + .IsUnique(); + + b.ToTable("WorldBossSeasonMigrationModels"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ActivateCollectionModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany("ActivateCollections") + .HasForeignKey("AvatarAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsMany("NineChronicles.DataProvider.Store.Models.CollectionOptionModel", "Options", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b1.Property("ActivateCollectionId") + .HasColumnType("int"); + + b1.Property("OperationType") + .IsRequired() + .HasColumnType("longtext"); + + b1.Property("StatType") + .IsRequired() + .HasColumnType("longtext"); + + b1.Property("Value") + .HasColumnType("bigint"); + + b1.HasKey("Id"); + + b1.HasIndex("ActivateCollectionId"); + + b1.ToTable("CollectionOptionModel"); + + b1.WithOwner() + .HasForeignKey("ActivateCollectionId"); + }); + + b.Navigation("Avatar"); + + b.Navigation("Options"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossChallengeModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossClaimRewardModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossRushModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossSeasonModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "RaffleWinner") + .WithMany() + .HasForeignKey("RaffleWinnerAddress"); + + b.Navigation("RaffleWinner"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossUnlockFloorModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AdventureBoss.AdventureBossWantedModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonFailModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AvatarModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleArenaModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleGrandFinaleModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ClaimStakeRewardModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationConsumableModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationEquipmentModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Crafting.CustomEquipmentCraftModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Crafting.RapidCombinationModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Crafting.UnlockCombinationSlotModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventConsumableItemCraftsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventDungeonBattleModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventMaterialItemCraftsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Grinding.GrindingModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashSweepModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasRandomBuffModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasWithRandomBuffModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementFailModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.JoinArenaModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.MigrateMonsterCollectionModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.PetEnhancementModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ReplaceCombinationEquipmentMaterialModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneEnhancementModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RunesAcquiredModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneSummonFailModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneSummonModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.StakeModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockEquipmentRecipeModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockRuneSlotModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockWorldModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserConsumablesModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserCostumesModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserCrystalsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserMaterialsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserMonsterCollectionsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserNCGsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserRunesModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserStakingsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AvatarModel", b => + { + b.Navigation("ActivateCollections"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/NineChronicles.DataProvider.Executable/Migrations/20240912163112_UnlockCombinationSlot.cs b/NineChronicles.DataProvider.Executable/Migrations/20240912163112_UnlockCombinationSlot.cs new file mode 100644 index 00000000..874473b0 --- /dev/null +++ b/NineChronicles.DataProvider.Executable/Migrations/20240912163112_UnlockCombinationSlot.cs @@ -0,0 +1,64 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace NineChronicles.DataProvider.Executable.Migrations +{ + public partial class UnlockCombinationSlot : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "UnlockCombinationSlot", + columns: table => new + { + Id = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + AgentAddress = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AvatarAddress = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + SlotIndex = table.Column(type: "int", nullable: false), + NcgCost = table.Column(type: "decimal(65,30)", nullable: false), + CrystalCost = table.Column(type: "decimal(65,30)", nullable: false), + MaterialCosts = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + BlockIndex = table.Column(type: "bigint", nullable: false), + Date = table.Column(type: "date", nullable: false), + TimeStamp = table.Column(type: "datetime(6)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_UnlockCombinationSlot", x => x.Id); + table.ForeignKey( + name: "FK_UnlockCombinationSlot_Agents_AgentAddress", + column: x => x.AgentAddress, + principalTable: "Agents", + principalColumn: "Address"); + table.ForeignKey( + name: "FK_UnlockCombinationSlot_Avatars_AvatarAddress", + column: x => x.AvatarAddress, + principalTable: "Avatars", + principalColumn: "Address"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_UnlockCombinationSlot_AgentAddress", + table: "UnlockCombinationSlot", + column: "AgentAddress"); + + migrationBuilder.CreateIndex( + name: "IX_UnlockCombinationSlot_AvatarAddress", + table: "UnlockCombinationSlot", + column: "AvatarAddress"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "UnlockCombinationSlot"); + } + } +} diff --git a/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs b/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs index d1c61791..7edddb45 100644 --- a/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs +++ b/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs @@ -940,110 +940,80 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("RapidCombinations"); }); - modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CraftRankingModel", b => + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Crafting.UnlockCombinationSlotModel", b => { - b.Property("AgentAddress") - .HasColumnType("longtext"); + b.Property("Id") + .HasColumnType("varchar(255)"); - b.Property("ArmorId") - .HasColumnType("int"); + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); b.Property("AvatarAddress") - .HasColumnType("longtext"); - - b.Property("AvatarLevel") - .HasColumnType("int"); + .HasColumnType("varchar(255)"); b.Property("BlockIndex") .HasColumnType("bigint"); - b.Property("Cp") - .HasColumnType("int"); + b.Property("CrystalCost") + .HasColumnType("decimal(65,30)"); - b.Property("CraftCount") - .HasColumnType("int"); + b.Property("Date") + .HasColumnType("date"); - b.Property("Name") + b.Property("MaterialCosts") .HasColumnType("longtext"); - b.Property("Ranking") - .HasColumnType("int"); + b.Property("NcgCost") + .HasColumnType("decimal(65,30)"); - b.Property("TitleId") + b.Property("SlotIndex") .HasColumnType("int"); - b.ToTable("CraftRankings"); - }); - - modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CustomCraft.CustomEquipmentCraftCountModel", b => - { - b.Property("IconId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); - b.Property("Count") - .HasColumnType("bigint"); + b.HasKey("Id"); - b.Property("ItemSubType") - .HasColumnType("longtext"); + b.HasIndex("AgentAddress"); - b.HasKey("IconId"); + b.HasIndex("AvatarAddress"); - b.ToTable("CustomEquipmentCraftCount"); + b.ToTable("UnlockCombinationSlot"); }); - modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CustomCraft.CustomEquipmentCraftModel", b => + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CraftRankingModel", b => { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AdditionalCost") + b.Property("AgentAddress") .HasColumnType("longtext"); - b.Property("AvatarAddress") - .HasColumnType("varchar(255)"); - - b.Property("BlockIndex") - .HasColumnType("bigint"); - - b.Property("Date") - .HasColumnType("date"); - - b.Property("DrawingAmount") + b.Property("ArmorId") .HasColumnType("int"); - b.Property("DrawingToolAmount") + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") .HasColumnType("int"); - b.Property("ElementalType") - .HasColumnType("longtext"); + b.Property("BlockIndex") + .HasColumnType("bigint"); - b.Property("EquipmentItemId") + b.Property("Cp") .HasColumnType("int"); - b.Property("IconId") + b.Property("CraftCount") .HasColumnType("int"); - b.Property("ItemSubType") + b.Property("Name") .HasColumnType("longtext"); - b.Property("NcgCost") - .HasColumnType("decimal(65,30)"); - - b.Property("RecipeId") + b.Property("Ranking") .HasColumnType("int"); - b.Property("SlotIndex") + b.Property("TitleId") .HasColumnType("int"); - b.Property("TimeStamp") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.HasIndex("AvatarAddress"); - - b.ToTable("CustomEquipmentCraft"); + b.ToTable("CraftRankings"); }); modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.DailyMetricModel", b => @@ -3974,6 +3944,21 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("Avatar"); }); + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.Crafting.UnlockCombinationSlotModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventConsumableItemCraftsModel", b => { b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") diff --git a/NineChronicles.DataProvider/Store/Models/Base/BaseModel.cs b/NineChronicles.DataProvider/Store/Models/Base/BaseModel.cs new file mode 100644 index 00000000..5232a587 --- /dev/null +++ b/NineChronicles.DataProvider/Store/Models/Base/BaseModel.cs @@ -0,0 +1,21 @@ +namespace NineChronicles.DataProvider.Store.Models +{ + using System; + using System.ComponentModel.DataAnnotations; + + public abstract class BaseModel + { + [Key] + public string? Id { get; set; } + + public long BlockIndex { get; set; } + + public string? AgentAddress { get; set; } + + public AgentModel? Agent { get; set; } + + public DateOnly Date { get; set; } + + public DateTimeOffset TimeStamp { get; set; } + } +} diff --git a/NineChronicles.DataProvider/Store/Models/Base/IAvatar.cs b/NineChronicles.DataProvider/Store/Models/Base/IAvatar.cs new file mode 100644 index 00000000..78339d11 --- /dev/null +++ b/NineChronicles.DataProvider/Store/Models/Base/IAvatar.cs @@ -0,0 +1,9 @@ +namespace NineChronicles.DataProvider.Store.Models +{ + public interface IAvatar + { + string? AvatarAddress { get; set; } + + AvatarModel? Avatar { get; set; } + } +} diff --git a/NineChronicles.DataProvider/Store/Models/Crafting/UnlockCombinationSlotModel.cs b/NineChronicles.DataProvider/Store/Models/Crafting/UnlockCombinationSlotModel.cs new file mode 100644 index 00000000..c1dd1e6b --- /dev/null +++ b/NineChronicles.DataProvider/Store/Models/Crafting/UnlockCombinationSlotModel.cs @@ -0,0 +1,17 @@ +namespace NineChronicles.DataProvider.Store.Models.Crafting +{ + public class UnlockCombinationSlotModel : BaseModel, IAvatar + { + public string? AvatarAddress { get; set; } + + public AvatarModel? Avatar { get; set; } + + public int SlotIndex { get; set; } + + public decimal NcgCost { get; set; } + + public decimal CrystalCost { get; set; } + + public string? MaterialCosts { get; set; } + } +} diff --git a/NineChronicles.DataProvider/Store/NineChroniclesContext.cs b/NineChronicles.DataProvider/Store/NineChroniclesContext.cs index 4486af6e..09c9f371 100644 --- a/NineChronicles.DataProvider/Store/NineChroniclesContext.cs +++ b/NineChronicles.DataProvider/Store/NineChroniclesContext.cs @@ -227,6 +227,9 @@ public NineChroniclesContext(DbContextOptions options) public DbSet CustomEquipmentCraftCount => Set(); /* CustomCraft */ + // UnlockCombinationSlot + public DbSet UnlockCombinationSlot => Set(); + // Table for daily metrics data public DbSet DailyMetrics => Set(); From b1d58eb6fd60a59c3b80ffae6c5e7572ca8ac2ed Mon Sep 17 00:00:00 2001 From: hyeon Date: Fri, 13 Sep 2024 02:09:17 +0900 Subject: [PATCH 42/62] Store UnlockCombinationSlot action --- .../Crafting/UnlockCombinationSlotData.cs | 52 +++++++++++++++++++ .../RenderSubscriber.cs | 3 ++ .../Store/MySql/CraftingStore.cs | 35 +++++++++++++ .../Store/MySqlStore.cs | 2 + .../Subscriber/CraftingRenderSubscriber.cs | 43 +++++++++++++++ 5 files changed, 135 insertions(+) create mode 100644 NineChronicles.DataProvider/DataRendering/Crafting/UnlockCombinationSlotData.cs diff --git a/NineChronicles.DataProvider/DataRendering/Crafting/UnlockCombinationSlotData.cs b/NineChronicles.DataProvider/DataRendering/Crafting/UnlockCombinationSlotData.cs new file mode 100644 index 00000000..b622e84c --- /dev/null +++ b/NineChronicles.DataProvider/DataRendering/Crafting/UnlockCombinationSlotData.cs @@ -0,0 +1,52 @@ +namespace NineChronicles.DataProvider.DataRendering.Crafting +{ + using System; + using System.Collections.Generic; + using Libplanet.Action.State; + using Libplanet.Crypto; + using Nekoyume.Action; + using Nekoyume.Module; + using Nekoyume.TableData; + using NineChronicles.DataProvider.Store.Models.Crafting; + + public static class UnlockCombinationSlotData + { + private const int GoldenDustId = 600201; + private const int RubyDustId = 600202; + + public static UnlockCombinationSlotModel GetUnlockCombinationSlotInfo( + IWorld prevStates, + Address signer, + UnlockCombinationSlot action, + long blockIndex, + DateTimeOffset blockTime + ) + { + var cost = prevStates.GetSheet()[action.SlotIndex]; + var materialCost = new List(); + if (cost.GoldenDustPrice > 0) + { + materialCost.Add($"{GoldenDustId}:{cost.GoldenDustPrice}"); + } + + if (cost.RubyDustPrice > 0) + { + materialCost.Add($"{RubyDustId}:{cost.RubyDustPrice}"); + } + + return new UnlockCombinationSlotModel + { + Id = Guid.NewGuid().ToString(), + AgentAddress = signer.ToString(), + AvatarAddress = action.AvatarAddress.ToString(), + SlotIndex = action.SlotIndex, + NcgCost = (decimal)cost.NcgPrice, + CrystalCost = cost.CrystalPrice, + MaterialCosts = string.Join(",", materialCost), + BlockIndex = blockIndex, + Date = DateOnly.FromDateTime(blockTime.DateTime), + TimeStamp = blockTime, + }; + } + } +} diff --git a/NineChronicles.DataProvider/RenderSubscriber.cs b/NineChronicles.DataProvider/RenderSubscriber.cs index c522f93f..604b43f4 100644 --- a/NineChronicles.DataProvider/RenderSubscriber.cs +++ b/NineChronicles.DataProvider/RenderSubscriber.cs @@ -1658,6 +1658,7 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) // Crafting _actionRenderer.EveryRender().Subscribe(SubscribeRapidCombination); _actionRenderer.EveryRender().Subscribe(SubscribeCustomEquipmentCraft); + _actionRenderer.EveryRender().Subscribe(SubscribeUnlockCombinationSlot); // Grinding _actionRenderer.EveryRender().Subscribe(SubscribeGrinding); @@ -1685,6 +1686,8 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) partial void SubscribeCustomEquipmentCraft(ActionEvaluation evt); + partial void SubscribeUnlockCombinationSlot(ActionEvaluation evt); + //// Grinding partial void SubscribeGrinding(ActionEvaluation ev); /* Partial Methods */ diff --git a/NineChronicles.DataProvider/Store/MySql/CraftingStore.cs b/NineChronicles.DataProvider/Store/MySql/CraftingStore.cs index a6034e92..8d467f3f 100644 --- a/NineChronicles.DataProvider/Store/MySql/CraftingStore.cs +++ b/NineChronicles.DataProvider/Store/MySql/CraftingStore.cs @@ -124,5 +124,40 @@ public partial List GetCustomEquipmentCraftCount ? ctx.CustomEquipmentCraftCount.ToList() : ctx.CustomEquipmentCraftCount.Where(c => c.ItemSubType == itemSubType).ToList(); } + + // UnlockCombinationSlot + public async partial Task StoreUnlockCombinationSlotList( + List unlockCombinationSlotList + ) + { + NineChroniclesContext? ctx = null; + try + { + ctx = await _dbContextFactory.CreateDbContextAsync(); + + foreach (var ucs in unlockCombinationSlotList) + { + if (!await ctx.UnlockCombinationSlot.AnyAsync(u => u.Id == ucs.Id)) + { + await ctx.UnlockCombinationSlot.AddAsync(ucs); + } + } + + await ctx.SaveChangesAsync(); + Log.Debug($"[UnlockCombinationSlot] {unlockCombinationSlotList.Count} UnlockCombinationSlot saved."); + } + catch (Exception e) + { + Log.Debug(e.Message); + Log.Debug(e.StackTrace); + } + finally + { + if (ctx is not null) + { + await ctx.DisposeAsync(); + } + } + } } } diff --git a/NineChronicles.DataProvider/Store/MySqlStore.cs b/NineChronicles.DataProvider/Store/MySqlStore.cs index 99d82f7c..cf097187 100644 --- a/NineChronicles.DataProvider/Store/MySqlStore.cs +++ b/NineChronicles.DataProvider/Store/MySqlStore.cs @@ -1898,6 +1898,8 @@ public void StoreRuneSummonFailList(List runeSummonFailList public partial Task StoreGrindList(List grindingList); + public partial Task StoreUnlockCombinationSlotList(List unlockCombinationSlotList); + public List GetRaiderList() { using NineChroniclesContext ctx = _dbContextFactory.CreateDbContext(); diff --git a/NineChronicles.DataProvider/Subscriber/CraftingRenderSubscriber.cs b/NineChronicles.DataProvider/Subscriber/CraftingRenderSubscriber.cs index 95407c54..674aa150 100644 --- a/NineChronicles.DataProvider/Subscriber/CraftingRenderSubscriber.cs +++ b/NineChronicles.DataProvider/Subscriber/CraftingRenderSubscriber.cs @@ -18,6 +18,7 @@ public partial class RenderSubscriber { private List _rapidCombinationList = new (); private List _customEquipmentCraftList = new (); + private List _unlockCombinationSlotList = new (); // Store private void StoreCraftingData() @@ -42,6 +43,14 @@ private void StoreCraftingData() await MySqlStore.StoreCustomEquipmentCraftList(_customEquipmentCraftList); })); + // UnlockCombinationSlot + Log.Debug("[Crafting] Store UnlockCombinationSlot list"); + tasks.Add(Task.Run(async () => + { + Log.Debug($"[UnlockCombinationSlot] {_unlockCombinationSlotList.Count}"); + await MySqlStore.StoreUnlockCombinationSlotList(_unlockCombinationSlotList); + })); + Task.WaitAll(tasks.ToArray()); } catch (Exception e) @@ -56,6 +65,7 @@ private void ClearCraftingList() Log.Debug("[Crafting] Clear crafting related action data"); _rapidCombinationList.Clear(); _customEquipmentCraftList.Clear(); + _unlockCombinationSlotList.Clear(); } // Subscribe @@ -159,5 +169,38 @@ partial void SubscribeCustomEquipmentCraft(ActionEvaluation evt) + { + try + { + if (evt.Exception is null && evt.Action is { } unlockCombinationSlot) + { + var start = DateTimeOffset.UtcNow; + _unlockCombinationSlotList.Add(UnlockCombinationSlotData.GetUnlockCombinationSlotInfo( + new World(_blockChainStates.GetWorldState(evt.PreviousState)), + evt.Signer, + evt.Action, + evt.BlockIndex, + _blockTimeOffset + )); + + Log.Debug( + "[DataProvider] Stored RapidCombination action in block #{index}. Time Taken: {time} ms.", + evt.BlockIndex, + (DateTimeOffset.UtcNow - start).Milliseconds + ); + } + } + catch (Exception e) + { + Log.Error( + e, + "[DataProvider] RenderSubscriber Error: {ErrorMessage}, StackTrace: {StackTrace}", + e.Message, + e.StackTrace + ); + } + } } } From 6fed1633ed7acc08a306a1e1d4a658ca285826d3 Mon Sep 17 00:00:00 2001 From: hyeon Date: Fri, 13 Sep 2024 02:14:41 +0900 Subject: [PATCH 43/62] Apply AI code review - Remove duplicated subscription - Use `AnyAsync` to simplify code - Fix wrong action name in log --- NineChronicles.DataProvider/RenderSubscriber.cs | 2 -- NineChronicles.DataProvider/Store/MySql/CraftingStore.cs | 4 ++-- .../Subscriber/CraftingRenderSubscriber.cs | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/NineChronicles.DataProvider/RenderSubscriber.cs b/NineChronicles.DataProvider/RenderSubscriber.cs index c522f93f..88b24c34 100644 --- a/NineChronicles.DataProvider/RenderSubscriber.cs +++ b/NineChronicles.DataProvider/RenderSubscriber.cs @@ -1662,8 +1662,6 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) // Grinding _actionRenderer.EveryRender().Subscribe(SubscribeGrinding); - _actionRenderer.EveryRender().Subscribe(SubscribeCustomEquipmentCraft); - return Task.CompletedTask; } diff --git a/NineChronicles.DataProvider/Store/MySql/CraftingStore.cs b/NineChronicles.DataProvider/Store/MySql/CraftingStore.cs index a6034e92..ed5340da 100644 --- a/NineChronicles.DataProvider/Store/MySql/CraftingStore.cs +++ b/NineChronicles.DataProvider/Store/MySql/CraftingStore.cs @@ -26,7 +26,7 @@ public async partial Task StoreRapidCombinationList(List foreach (var rc in rapidCombinationList) { - if (await ctx.RapidCombinations.FirstOrDefaultAsync(r => r.Id == rc.Id) is null) + if (!await ctx.RapidCombinations.AnyAsync(r => r.Id == rc.Id)) { await ctx.RapidCombinations.AddAsync(rc); } @@ -65,7 +65,7 @@ List customEquipmentCraftList // Add new CustomCraft data foreach (var craftData in customEquipmentCraftList) { - if (await ctx.CustomEquipmentCraft.FirstOrDefaultAsync(c => c.Id == craftData.Id) is null) + if (!await ctx.CustomEquipmentCraft.AnyAsync(c => c.Id == craftData.Id)) { if (iconCraftCountDict.ContainsKey((craftData.ItemSubType!, craftData.IconId))) { diff --git a/NineChronicles.DataProvider/Subscriber/CraftingRenderSubscriber.cs b/NineChronicles.DataProvider/Subscriber/CraftingRenderSubscriber.cs index 95407c54..8ce102f3 100644 --- a/NineChronicles.DataProvider/Subscriber/CraftingRenderSubscriber.cs +++ b/NineChronicles.DataProvider/Subscriber/CraftingRenderSubscriber.cs @@ -143,7 +143,7 @@ partial void SubscribeCustomEquipmentCraft(ActionEvaluation Date: Fri, 13 Sep 2024 12:01:04 +0900 Subject: [PATCH 44/62] Bump headless --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index 23fd4019..6ec7c596 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit 23fd4019385a938ad35dc3b088090059df3d8464 +Subproject commit 6ec7c596d39eed967349fcced75b31c0c713875c From 4d873f0e60583a1b12f3afbbea0baf062f83fe34 Mon Sep 17 00:00:00 2001 From: hyeon Date: Fri, 13 Sep 2024 12:20:42 +0900 Subject: [PATCH 45/62] Upgrade to dotnet 8.0 --- Dockerfile.amd64 | 2 +- Dockerfile.arm64v8 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.amd64 b/Dockerfile.amd64 index 6e896c5c..b7cd4fbb 100644 --- a/Dockerfile.amd64 +++ b/Dockerfile.amd64 @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env WORKDIR /app ARG COMMIT diff --git a/Dockerfile.arm64v8 b/Dockerfile.arm64v8 index f909af5d..e9c09022 100644 --- a/Dockerfile.arm64v8 +++ b/Dockerfile.arm64v8 @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env WORKDIR /app ARG COMMIT From 5e5a21b7634e55c445fe07880f8f7a8856d586da Mon Sep 17 00:00:00 2001 From: hyeon Date: Fri, 13 Sep 2024 12:51:01 +0900 Subject: [PATCH 46/62] Apply changed helper function --- .../DataRendering/Crafting/CustomEquipmentCraftData.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/NineChronicles.DataProvider/DataRendering/Crafting/CustomEquipmentCraftData.cs b/NineChronicles.DataProvider/DataRendering/Crafting/CustomEquipmentCraftData.cs index 29ad56bd..93e2899f 100644 --- a/NineChronicles.DataProvider/DataRendering/Crafting/CustomEquipmentCraftData.cs +++ b/NineChronicles.DataProvider/DataRendering/Crafting/CustomEquipmentCraftData.cs @@ -54,11 +54,10 @@ DateTimeOffset blockTime var equipment = (Equipment)slot.Result.itemUsable; var (ncgCost, materialCosts) = CustomCraftHelper.CalculateCraftCost( craftData.IconId, + relationship, sheets.GetSheet(), recipeRow, relationshipRow, - sheets.GetSheet().Values - .FirstOrDefault(r => r.Relationship == relationship), gameConfig.CustomEquipmentCraftIconCostMultiplier ); From 808fd31be326344a88a78a769d04cbc83f2a7b98 Mon Sep 17 00:00:00 2001 From: hyeon Date: Fri, 13 Sep 2024 12:53:04 +0900 Subject: [PATCH 47/62] Bump headless --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index 6ec7c596..b4ee381e 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit 6ec7c596d39eed967349fcced75b31c0c713875c +Subproject commit b4ee381e178beda23468b4fcc13d78e278a5ff5a From 55ca58579dbbbe1b20f6043ffeb20e81025ee954 Mon Sep 17 00:00:00 2001 From: moreal Date: Mon, 23 Sep 2024 17:31:22 +0900 Subject: [PATCH 48/62] Bump headless --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index b4ee381e..57754bd5 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit b4ee381e178beda23468b4fcc13d78e278a5ff5a +Subproject commit 57754bd5c7c6febd7e8d2347694bcfbbe8b143f6 From e1cde28dfc889d24e329fb0c38a7b43ff085dd51 Mon Sep 17 00:00:00 2001 From: hyeon Date: Mon, 23 Sep 2024 17:32:54 +0900 Subject: [PATCH 49/62] Bump headless --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index b4ee381e..57754bd5 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit b4ee381e178beda23468b4fcc13d78e278a5ff5a +Subproject commit 57754bd5c7c6febd7e8d2347694bcfbbe8b143f6 From ace18f63f512260c516b456c6b5071a8cb08e6e5 Mon Sep 17 00:00:00 2001 From: moreal Date: Mon, 23 Sep 2024 17:35:48 +0900 Subject: [PATCH 50/62] Remove depreacted actions' handlers --- .../Commands/MySqlMigration.cs | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs b/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs index 0dfe956f..9e1ad8ee 100644 --- a/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs +++ b/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs @@ -815,14 +815,6 @@ private void ProcessTasks(Task>[] taskArray, IB Console.WriteLine("Writing Stake action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); } - if (action is Stake0 stake0) - { - var start = DateTimeOffset.UtcNow; - _stakeList.Add(StakeData.GetStakeInfo(inputState, outputState, ae.InputContext.Signer, ae.InputContext.BlockIndex, _blockTimeOffset, Guid.Empty)); - var end = DateTimeOffset.UtcNow; - Console.WriteLine("Writing Stake action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); - } - if (action is MigrateMonsterCollection migrateMonsterCollection) { var start = DateTimeOffset.UtcNow; @@ -1175,27 +1167,6 @@ private void ProcessTasks(Task>[] taskArray, IB Console.WriteLine("Stored TransferAsset action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); } - if (action is TransferAsset0 transferAsset0) - { - var start = DateTimeOffset.UtcNow; - var actionString = ae.InputContext.TxId.ToString(); - var actionByteArray = Encoding.UTF8.GetBytes(actionString!).Take(16).ToArray(); - var id = new Guid(actionByteArray); - _transferAssetList.Add(TransferAssetData.GetTransferAssetInfo( - id, - (TxId)ae.InputContext.TxId!, - ae.InputContext.BlockIndex, - _blockHash!.ToString(), - transferAsset0.Sender, - transferAsset0.Recipient, - transferAsset0.Amount.Currency.Ticker, - transferAsset0.Amount, - _blockTimeOffset)); - - var end = DateTimeOffset.UtcNow; - Console.WriteLine("Stored TransferAsset action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); - } - if (action is RequestPledge requestPledge) { var start = DateTimeOffset.UtcNow; From 4036c9b1849ab895fc01702a46f3c9fd96e6490b Mon Sep 17 00:00:00 2001 From: hyeon Date: Mon, 23 Sep 2024 21:19:14 +0900 Subject: [PATCH 51/62] Fix wrong column type - Delete duplicated, unused `AdditionalMaterials` column - Use `AdditonalCost` column --- .../20240912124503_CustomEquipmentCraft.Designer.cs | 2 +- .../Migrations/20240912124503_CustomEquipmentCraft.cs | 2 +- .../20240912163112_UnlockCombinationSlot.Designer.cs | 2 +- .../Migrations/NineChroniclesContextModelSnapshot.cs | 2 +- .../DataRendering/Crafting/CustomEquipmentCraftData.cs | 2 +- .../Store/Models/Crafting/CustomEquipmentCraftModel.cs | 4 +--- 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/NineChronicles.DataProvider.Executable/Migrations/20240912124503_CustomEquipmentCraft.Designer.cs b/NineChronicles.DataProvider.Executable/Migrations/20240912124503_CustomEquipmentCraft.Designer.cs index 8dc5cc2d..89e64e1c 100644 --- a/NineChronicles.DataProvider.Executable/Migrations/20240912124503_CustomEquipmentCraft.Designer.cs +++ b/NineChronicles.DataProvider.Executable/Migrations/20240912124503_CustomEquipmentCraft.Designer.cs @@ -842,7 +842,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("Id") .HasColumnType("varchar(255)"); - b.Property("AdditionalMaterials") + b.Property("AdditionalCost") .HasColumnType("longtext"); b.Property("AgentAddress") diff --git a/NineChronicles.DataProvider.Executable/Migrations/20240912124503_CustomEquipmentCraft.cs b/NineChronicles.DataProvider.Executable/Migrations/20240912124503_CustomEquipmentCraft.cs index 609e1768..c8d6756c 100644 --- a/NineChronicles.DataProvider.Executable/Migrations/20240912124503_CustomEquipmentCraft.cs +++ b/NineChronicles.DataProvider.Executable/Migrations/20240912124503_CustomEquipmentCraft.cs @@ -12,7 +12,7 @@ protected override void Up(MigrationBuilder migrationBuilder) migrationBuilder.AddColumn( name: "AgentAddress", table: "CustomEquipmentCraft", - type: "string", + type: "varchar(255)", nullable: false, defaultValue: string.Empty ).Annotation("MySql:CharSet", "utf8mb4"); diff --git a/NineChronicles.DataProvider.Executable/Migrations/20240912163112_UnlockCombinationSlot.Designer.cs b/NineChronicles.DataProvider.Executable/Migrations/20240912163112_UnlockCombinationSlot.Designer.cs index 6f79ce83..76646df8 100644 --- a/NineChronicles.DataProvider.Executable/Migrations/20240912163112_UnlockCombinationSlot.Designer.cs +++ b/NineChronicles.DataProvider.Executable/Migrations/20240912163112_UnlockCombinationSlot.Designer.cs @@ -862,7 +862,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("AdditionalCost") .HasColumnType("longtext"); - b.Property("AdditionalMaterials") + b.Property("AdditionalCost") .HasColumnType("longtext"); b.Property("AgentAddress") diff --git a/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs b/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs index 7edddb45..1e439a01 100644 --- a/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs +++ b/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs @@ -840,7 +840,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Id") .HasColumnType("varchar(255)"); - b.Property("AdditionalMaterials") + b.Property("AdditionalCost") .HasColumnType("longtext"); b.Property("AgentAddress") diff --git a/NineChronicles.DataProvider/DataRendering/Crafting/CustomEquipmentCraftData.cs b/NineChronicles.DataProvider/DataRendering/Crafting/CustomEquipmentCraftData.cs index 93e2899f..13fb955f 100644 --- a/NineChronicles.DataProvider/DataRendering/Crafting/CustomEquipmentCraftData.cs +++ b/NineChronicles.DataProvider/DataRendering/Crafting/CustomEquipmentCraftData.cs @@ -93,7 +93,7 @@ DateTimeOffset blockTime Scroll = scrollCost, Circle = circleCost, NcgCost = (decimal)ncgCost, - AdditionalMaterials = string.Join(",", additional), + AdditionalCost = string.Join(",", additional), Relationship = relationship, EquipmentItemId = equipment.Id, IconId = equipment.IconId, diff --git a/NineChronicles.DataProvider/Store/Models/Crafting/CustomEquipmentCraftModel.cs b/NineChronicles.DataProvider/Store/Models/Crafting/CustomEquipmentCraftModel.cs index 18264521..d951b735 100644 --- a/NineChronicles.DataProvider/Store/Models/Crafting/CustomEquipmentCraftModel.cs +++ b/NineChronicles.DataProvider/Store/Models/Crafting/CustomEquipmentCraftModel.cs @@ -32,7 +32,7 @@ public class CustomEquipmentCraftModel public decimal NcgCost { get; set; } - public string? AdditionalMaterials { get; set; } + public string? AdditionalCost { get; set; } // Result public int EquipmentItemId { get; set; } @@ -52,8 +52,6 @@ public class CustomEquipmentCraftModel public bool HasRandomOnlyIcon { get; set; } // Time - public string? AdditionalCost { get; set; } - public DateOnly Date { get; set; } public DateTimeOffset TimeStamp { get; set; } From 8bbcf0380809bbbeb60a87548ce6d85860e1693b Mon Sep 17 00:00:00 2001 From: hyeon Date: Tue, 24 Sep 2024 12:08:01 +0900 Subject: [PATCH 52/62] Add missing field --- .../DataRendering/Crafting/CustomEquipmentCraftData.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/NineChronicles.DataProvider/DataRendering/Crafting/CustomEquipmentCraftData.cs b/NineChronicles.DataProvider/DataRendering/Crafting/CustomEquipmentCraftData.cs index 13fb955f..c60ef14c 100644 --- a/NineChronicles.DataProvider/DataRendering/Crafting/CustomEquipmentCraftData.cs +++ b/NineChronicles.DataProvider/DataRendering/Crafting/CustomEquipmentCraftData.cs @@ -95,6 +95,7 @@ DateTimeOffset blockTime NcgCost = (decimal)ncgCost, AdditionalCost = string.Join(",", additional), Relationship = relationship, + ItemSubType = equipment.ItemSubType.ToString(), EquipmentItemId = equipment.Id, IconId = equipment.IconId, ElementalType = equipment.ElementalType.ToString(), From c46ec2a3c547a58806fa77482b074d29d90a4540 Mon Sep 17 00:00:00 2001 From: hyeon Date: Tue, 24 Sep 2024 17:48:56 +0900 Subject: [PATCH 53/62] Bump headless --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index 57754bd5..3cba470a 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit 57754bd5c7c6febd7e8d2347694bcfbbe8b143f6 +Subproject commit 3cba470ad189741a57d0118187b779eeafc3113a From 0f2ce5d2d48a3b9dd0528e62778b537df2804c21 Mon Sep 17 00:00:00 2001 From: hyeon Date: Tue, 24 Sep 2024 18:49:47 +0900 Subject: [PATCH 54/62] Use helper to get CP --- .../DataRendering/Crafting/CustomEquipmentCraftData.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.DataProvider/DataRendering/Crafting/CustomEquipmentCraftData.cs b/NineChronicles.DataProvider/DataRendering/Crafting/CustomEquipmentCraftData.cs index c60ef14c..055f26fb 100644 --- a/NineChronicles.DataProvider/DataRendering/Crafting/CustomEquipmentCraftData.cs +++ b/NineChronicles.DataProvider/DataRendering/Crafting/CustomEquipmentCraftData.cs @@ -100,7 +100,7 @@ DateTimeOffset blockTime IconId = equipment.IconId, ElementalType = equipment.ElementalType.ToString(), OptionId = ItemFactory.SelectOption(recipeRow.ItemSubType, optionSheet, random).Id, - TotalCP = random.Next(relationshipRow.MinCp, relationshipRow.MaxCp + 1), + TotalCP = CustomCraftHelper.SelectCp(relationshipRow, random), CraftWithRandom = equipment.CraftWithRandom, HasRandomOnlyIcon = equipment.HasRandomOnlyIcon, BlockIndex = blockIndex, From 8a8e75e88f3ecf563cfa8e67b18aaa23fb8b07d3 Mon Sep 17 00:00:00 2001 From: hyeon Date: Wed, 25 Sep 2024 15:36:24 +0900 Subject: [PATCH 55/62] Bump headless --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index 3cba470a..4343d416 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit 3cba470ad189741a57d0118187b779eeafc3113a +Subproject commit 4343d4163714f52b6e8c89304489a3568d8a8ec5 From 860fff0d978efb0f8c66ff91783b5793fddfb607 Mon Sep 17 00:00:00 2001 From: hyeon Date: Wed, 25 Sep 2024 17:31:15 +0900 Subject: [PATCH 56/62] Bump headless --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index 4343d416..35ab4202 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit 4343d4163714f52b6e8c89304489a3568d8a8ec5 +Subproject commit 35ab420254afaecb562f20383a0120ec97725e97 From b39e93bf96a5f6b7357e9eed12ce6200ed0ad306 Mon Sep 17 00:00:00 2001 From: hyeon Date: Thu, 26 Sep 2024 12:08:05 +0900 Subject: [PATCH 57/62] Skip invalid seasons - Skip not participated season - Add stop condition when one is null and another says stop looping --- .../AdventureBossClaimRewardData.cs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/NineChronicles.DataProvider/DataRendering/AdventureBoss/AdventureBossClaimRewardData.cs b/NineChronicles.DataProvider/DataRendering/AdventureBoss/AdventureBossClaimRewardData.cs index fcefee12..dc8ab5b5 100644 --- a/NineChronicles.DataProvider/DataRendering/AdventureBoss/AdventureBossClaimRewardData.cs +++ b/NineChronicles.DataProvider/DataRendering/AdventureBoss/AdventureBossClaimRewardData.cs @@ -32,8 +32,8 @@ ClaimAdventureBossReward claim var gameConfig = states.GetGameConfigState(); var ncgRewardRatioSheet = states.GetSheet(); - var continueInv = true; - var continueExp = true; + bool continueInv; + bool continueExp; var claimedSeasonList = new List(); @@ -59,6 +59,12 @@ ClaimAdventureBossReward claim break; } + // Skip not participated season + if (investor is null && explorer is null) + { + continue; + } + if (investor is not null) { continueInv = AdventureBossHelper.CollectWantedReward( @@ -75,6 +81,10 @@ ref myReward investor.Claimed = true; states = states.SetBountyBoard(szn, bountyBoard); } + else + { + continueInv = false; + } if (explorer is not null) { @@ -94,7 +104,12 @@ out ncgReward explorer.Claimed = true; states = states.SetExplorer(szn, explorer); } + else + { + continueExp = false; + } + // Stop if stop both investor and explorer if (!continueInv && !continueExp) { break; From 1fe89299826f7ca7d88fa20de4f9c24093c12d04 Mon Sep 17 00:00:00 2001 From: hyeon Date: Fri, 27 Sep 2024 11:26:46 +0900 Subject: [PATCH 58/62] Update grinding - Store individual grinding result per equipment - Add log to check data collection --- .../DataRendering/Grinding/GrindingData.cs | 60 +++++++++++-------- .../Subscriber/GrindingRenderSubscriber.cs | 2 +- 2 files changed, 35 insertions(+), 27 deletions(-) diff --git a/NineChronicles.DataProvider/DataRendering/Grinding/GrindingData.cs b/NineChronicles.DataProvider/DataRendering/Grinding/GrindingData.cs index 98a604a4..b73f8ce6 100644 --- a/NineChronicles.DataProvider/DataRendering/Grinding/GrindingData.cs +++ b/NineChronicles.DataProvider/DataRendering/Grinding/GrindingData.cs @@ -6,7 +6,6 @@ namespace NineChronicles.DataProvider.DataRendering.Grinding using Bencodex.Types; using Libplanet.Action.State; using Libplanet.Crypto; - using Libplanet.Types.Assets; using Nekoyume.Action; using Nekoyume.Extensions; using Nekoyume.Helper; @@ -17,6 +16,7 @@ namespace NineChronicles.DataProvider.DataRendering.Grinding using Nekoyume.TableData; using Nekoyume.TableData.Crystal; using NineChronicles.DataProvider.Store.Models.Grinding; + using Serilog; public static class GrindingData { @@ -30,14 +30,20 @@ public static List GetGrindingInfo( DateTimeOffset blockTime ) { - AvatarState prevAvatarState = previousStates.GetAvatarState(avatarAddress); - AgentState? agentState = previousStates.GetAgentState(signer); + var prevAvatarState = previousStates.GetAvatarState( + avatarAddress, + getInventory: true, + getQuestList: false, + getWorldInformation: false + ); + + var agentState = previousStates.GetAgentState(signer); if (agentState is null) { throw new FailedLoadStateException("Aborted as the agent state failed to load."); } - Address monsterCollectionAddress = MonsterCollectionState.DeriveAddress( + var monsterCollectionAddress = MonsterCollectionState.DeriveAddress( signer, agentState.MonsterCollectionRound ); @@ -49,7 +55,7 @@ DateTimeOffset blockTime typeof(StakeRegularRewardSheet), }); - List equipmentList = new List(); + var equipmentList = new List(); foreach (var equipmentId in equipmentIds) { if (prevAvatarState.inventory.TryGetNonFungibleItem(equipmentId, out Equipment equipment)) @@ -58,8 +64,8 @@ DateTimeOffset blockTime } } - Currency currency = previousStates.GetGoldCurrency(); - FungibleAssetValue stakedAmount = 0 * currency; + var currency = previousStates.GetGoldCurrency(); + var stakedAmount = 0 * currency; if (previousStates.TryGetStakeStateV2(signer, out _)) { var stakeAddr = StakeStateV2.DeriveAddress(signer); @@ -73,29 +79,30 @@ DateTimeOffset blockTime } } - FungibleAssetValue crystal = CrystalCalculator.CalculateCrystal( - signer, - equipmentList, - stakedAmount, - false, - sheets.GetSheet(), - sheets.GetSheet(), - sheets.GetSheet() - ); - - var materials = Grinding.CalculateMaterialReward( - equipmentList, - sheets.GetSheet(), - sheets.GetSheet() - ); - var materialList = materials.Select(kv => $"{kv.Key.Id}:{kv.Value}").ToList(); - var grindList = new List(); - foreach (var equipment in equipmentList) + for (var i = 0; i < equipmentList.Count; i++) { + var equipment = equipmentList[i]; + var crystal = CrystalCalculator.CalculateCrystal( + signer, + new List { equipment }, + stakedAmount, + false, + sheets.GetSheet(), + sheets.GetSheet(), + sheets.GetSheet() + ); + + var materials = Grinding.CalculateMaterialReward( + new List { equipment }, + sheets.GetSheet(), + sheets.GetSheet() + ); + var materialList = materials.Select(kv => $"{kv.Key.Id}:{kv.Value}").ToList(); + grindList.Add(new GrindingModel() { - Id = actionId.ToString(), + Id = $"{actionId}_{i:D3}", AgentAddress = signer.ToString(), AvatarAddress = avatarAddress.ToString(), EquipmentItemId = equipment.ItemId.ToString(), @@ -109,6 +116,7 @@ DateTimeOffset blockTime }); } + Log.Debug($"{grindList.Count} grinding collected from {signer}"); return grindList; } } diff --git a/NineChronicles.DataProvider/Subscriber/GrindingRenderSubscriber.cs b/NineChronicles.DataProvider/Subscriber/GrindingRenderSubscriber.cs index 14354857..3b9e197f 100644 --- a/NineChronicles.DataProvider/Subscriber/GrindingRenderSubscriber.cs +++ b/NineChronicles.DataProvider/Subscriber/GrindingRenderSubscriber.cs @@ -42,7 +42,7 @@ partial void SubscribeGrinding(ActionEvaluation ev) { try { - if (ev.Action is { } grinding) + if (ev.Exception is null && ev.Action is { } grinding) { var start = DateTimeOffset.UtcNow; var inputState = new World(_blockChainStates.GetWorldState(ev.PreviousState)); From dac683bd88179d56ef125d4dfb807492c66a56c2 Mon Sep 17 00:00:00 2001 From: hyeon Date: Fri, 27 Sep 2024 18:53:46 +0900 Subject: [PATCH 59/62] Bump lib9c: Update custom craft cost calculator --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index 35ab4202..f6d44add 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit 35ab420254afaecb562f20383a0120ec97725e97 +Subproject commit f6d44addbff7bd842432c7d6a45b74b57dd9d314 From 91532d160a24bb6f54574bb18522fcfa24d4654e Mon Sep 17 00:00:00 2001 From: hyeon Date: Mon, 30 Sep 2024 10:44:12 +0900 Subject: [PATCH 60/62] Bump headless to tag --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index f6d44add..97965e0e 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit f6d44addbff7bd842432c7d6a45b74b57dd9d314 +Subproject commit 97965e0ef05535d0e3103760bcf9d01cef57459f From 4111ebd27e3d485e7f60033da12c141fa472ef86 Mon Sep 17 00:00:00 2001 From: moreal Date: Mon, 30 Sep 2024 14:50:51 +0900 Subject: [PATCH 61/62] Register IKeyStore for DI --- NineChronicles.DataProvider.Executable/Program.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/NineChronicles.DataProvider.Executable/Program.cs b/NineChronicles.DataProvider.Executable/Program.cs index dae3ac65..8f57426a 100644 --- a/NineChronicles.DataProvider.Executable/Program.cs +++ b/NineChronicles.DataProvider.Executable/Program.cs @@ -199,6 +199,7 @@ IActionEvaluatorConfiguration GetActionEvaluatorConfiguration(IConfiguration con hostBuilder.ConfigureServices(services => { services.AddSingleton(_ => context); + services.AddSingleton(_ => context.KeyStore); }); hostBuilder.UseNineChroniclesNode(nineChroniclesProperties, context, publisher, service); From d02deecbc7282ea80e344a4c784de51c54b6780e Mon Sep 17 00:00:00 2001 From: moreal Date: Mon, 30 Sep 2024 22:27:22 +0900 Subject: [PATCH 62/62] Register missing repositories --- NineChronicles.DataProvider/GraphQLStartup.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/NineChronicles.DataProvider/GraphQLStartup.cs b/NineChronicles.DataProvider/GraphQLStartup.cs index 4201e7e8..c9299b0d 100644 --- a/NineChronicles.DataProvider/GraphQLStartup.cs +++ b/NineChronicles.DataProvider/GraphQLStartup.cs @@ -12,6 +12,10 @@ using NineChronicles.DataProvider.GraphTypes; using NineChronicles.Headless; using NineChronicles.Headless.GraphTypes; + using NineChronicles.Headless.Repositories.BlockChain; + using NineChronicles.Headless.Repositories.StateTrie; + using NineChronicles.Headless.Repositories.Transaction; + using NineChronicles.Headless.Repositories.WorldState; public class GraphQLStartup { @@ -45,6 +49,10 @@ public void ConfigureServices(IServiceCollection services) .AddLibplanetExplorer(); services.AddSingleton(); services.AddGraphTypes(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); }