diff --git a/TOOHUCardAPI/DTO/RankData/RankEntryDTO.cs b/TOOHUCardAPI/DTO/RankData/RankEntryDTO.cs index e7f129a..8cc3dfb 100644 --- a/TOOHUCardAPI/DTO/RankData/RankEntryDTO.cs +++ b/TOOHUCardAPI/DTO/RankData/RankEntryDTO.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Linq; using Newtonsoft.Json; @@ -9,12 +10,20 @@ namespace TOOHUCardAPI.DTO.RankData { [JsonProperty("rank_type")] public string RankType { get; set; } + [JsonProperty("steamid")] public long SteamId { get; set; } + [JsonProperty("userid")] public long UserId { get; set; } + [JsonProperty("username")] public string Username { get; set; } + [JsonProperty("version")] public string Version { get; set; } + [JsonProperty("wave")] public int Wave { get; set; } + [JsonProperty("damage")] public long Damage { get; set; } + [JsonProperty("updatetime")] + public DateTime UpdateTime { get; set; } [JsonIgnore] public Dictionary Cards { get; set; } } @@ -32,6 +41,7 @@ namespace TOOHUCardAPI.DTO.RankData Version = rankEntry.Version, Wave = rankEntry.Wave, Damage = rankEntry.Damage, + UpdateTime = rankEntry.UpdateTime, Cards = rankEntry.TowersUsed.Select(tower => KeyValuePair.Create(tower.TowerKey, tower.EncodedData)) .ToDictionary(kv => kv.Key, kv => kv.Value) }; diff --git a/TOOHUCardAPI/Data/Models/RankEntry.cs b/TOOHUCardAPI/Data/Models/RankEntry.cs index b938470..aa0ab3a 100644 --- a/TOOHUCardAPI/Data/Models/RankEntry.cs +++ b/TOOHUCardAPI/Data/Models/RankEntry.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; @@ -17,6 +18,7 @@ namespace TOOHUCardAPI.Data.Models public string Version { get; set; } public int Wave { get; set; } public long Damage { get; set; } + public DateTime UpdateTime { get; set; } public List TowersUsed { get; set; } } } \ No newline at end of file diff --git a/TOOHUCardAPI/Data/Services/RankService.cs b/TOOHUCardAPI/Data/Services/RankService.cs index 24d79cb..e3cec27 100644 --- a/TOOHUCardAPI/Data/Services/RankService.cs +++ b/TOOHUCardAPI/Data/Services/RankService.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -45,7 +46,8 @@ namespace TOOHUCardAPI.Data.Services Version = entry.Version, Wave = entry.Wave, Damage = entry.Damage, - TowersUsed = towersUsed + TowersUsed = towersUsed, + UpdateTime = DateTime.Now }; await _rankRepository.InsertRankEntry(toUpload); _logger.LogInformation("Uploaded a rank entry for {SteamId}", entry.SteamId); diff --git a/TOOHUCardAPI/Migrations/20211107044043_updatetime.Designer.cs b/TOOHUCardAPI/Migrations/20211107044043_updatetime.Designer.cs new file mode 100644 index 0000000..527ad8a --- /dev/null +++ b/TOOHUCardAPI/Migrations/20211107044043_updatetime.Designer.cs @@ -0,0 +1,1117 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using TOOHUCardAPI.Data; + +namespace TOOHUCardAPI.Migrations +{ + [DbContext(typeof(AppDbContext))] + [Migration("20211107044043_updatetime")] + partial class updatetime + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Relational:MaxIdentifierLength", 63) + .HasAnnotation("ProductVersion", "5.0.11") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + modelBuilder.Entity("TOOHUCardAPI.Data.Models.Card", b => + { + b.Property("ItemCode") + .HasColumnType("text"); + + b.Property("CardName") + .HasColumnType("text"); + + b.Property("HasPortrait") + .HasColumnType("boolean"); + + b.Property("HasVoice") + .HasColumnType("boolean"); + + b.Property("Quality") + .HasColumnType("integer"); + + b.HasKey("ItemCode"); + + b.ToTable("Cards"); + + b.HasData( + new + { + ItemCode = "item_0026", + CardName = "rin", + HasPortrait = true, + HasVoice = true, + Quality = 3 + }, + new + { + ItemCode = "item_0043", + CardName = "hatate", + HasPortrait = true, + HasVoice = true, + Quality = 2 + }, + new + { + ItemCode = "item_0014", + CardName = "merlin", + HasPortrait = true, + HasVoice = true, + Quality = 2 + }, + new + { + ItemCode = "item_0007", + CardName = "hanadayousei", + HasPortrait = false, + HasVoice = false, + Quality = 1 + }, + new + { + ItemCode = "item_2002", + CardName = "item_2002", + HasPortrait = false, + HasVoice = false, + Quality = 4 + }, + new + { + ItemCode = "item_0055", + CardName = "suika", + HasPortrait = true, + HasVoice = true, + Quality = 3 + }, + new + { + ItemCode = "item_0002", + CardName = "nazrin", + HasPortrait = true, + HasVoice = true, + Quality = 2 + }, + new + { + ItemCode = "item_0061", + CardName = "keine", + HasPortrait = true, + HasVoice = false, + Quality = 3 + }, + new + { + ItemCode = "item_0069", + CardName = "toramaru", + HasPortrait = true, + HasVoice = false, + Quality = 2 + }, + new + { + ItemCode = "item_0042", + CardName = "aya", + HasPortrait = true, + HasVoice = false, + Quality = 3 + }, + new + { + ItemCode = "item_1011", + CardName = "BonusEgg", + HasPortrait = false, + HasVoice = false, + Quality = 1 + }, + new + { + ItemCode = "item_0015", + CardName = "rumia", + HasPortrait = true, + HasVoice = true, + Quality = 2 + }, + new + { + ItemCode = "item_0030", + CardName = "remilia", + HasPortrait = true, + HasVoice = false, + Quality = 4 + }, + new + { + ItemCode = "item_0028", + CardName = "reimu", + HasPortrait = true, + HasVoice = true, + Quality = 4 + }, + new + { + ItemCode = "item_0045", + CardName = "kagerou", + HasPortrait = true, + HasVoice = false, + Quality = 3 + }, + new + { + ItemCode = "item_0019", + CardName = "marisa", + HasPortrait = true, + HasVoice = true, + Quality = 3 + }, + new + { + ItemCode = "item_0075", + CardName = "clownpiece", + HasPortrait = true, + HasVoice = false, + Quality = 3 + }, + new + { + ItemCode = "item_0050", + CardName = "nue", + HasPortrait = true, + HasVoice = false, + Quality = 3 + }, + new + { + ItemCode = "item_0044", + CardName = "momiji", + HasPortrait = true, + HasVoice = true, + Quality = 2 + }, + new + { + ItemCode = "item_0011", + CardName = "letty", + HasPortrait = true, + HasVoice = true, + Quality = 2 + }, + new + { + ItemCode = "item_1003", + CardName = "BonusEgg", + HasPortrait = false, + HasVoice = false, + Quality = 1 + }, + new + { + ItemCode = "item_0022", + CardName = "sakuya", + HasPortrait = true, + HasVoice = true, + Quality = 3 + }, + new + { + ItemCode = "item_0003", + CardName = "minoriko", + HasPortrait = true, + HasVoice = true, + Quality = 2 + }, + new + { + ItemCode = "item_2022", + CardName = "item_2022", + HasPortrait = false, + HasVoice = false, + Quality = 3 + }, + new + { + ItemCode = "item_2020", + CardName = "item_2020", + HasPortrait = false, + HasVoice = false, + Quality = 4 + }, + new + { + ItemCode = "item_2016", + CardName = "item_2016", + HasPortrait = false, + HasVoice = false, + Quality = 3 + }, + new + { + ItemCode = "item_2018", + CardName = "item_2018", + HasPortrait = false, + HasVoice = false, + Quality = 2 + }, + new + { + ItemCode = "item_2006", + CardName = "item_2006", + HasPortrait = false, + HasVoice = false, + Quality = 2 + }, + new + { + ItemCode = "item_2019", + CardName = "item_2019", + HasPortrait = false, + HasVoice = false, + Quality = 2 + }, + new + { + ItemCode = "item_2015", + CardName = "item_2015", + HasPortrait = false, + HasVoice = false, + Quality = 3 + }, + new + { + ItemCode = "item_2014", + CardName = "item_2014", + HasPortrait = false, + HasVoice = false, + Quality = 4 + }, + new + { + ItemCode = "item_0009", + CardName = "cirno", + HasPortrait = true, + HasVoice = false, + Quality = 2 + }, + new + { + ItemCode = "item_0038", + CardName = "chen", + HasPortrait = true, + HasVoice = false, + Quality = 2 + }, + new + { + ItemCode = "item_0074", + CardName = "hecatia", + HasPortrait = true, + HasVoice = false, + Quality = 4 + }, + new + { + ItemCode = "item_0080", + CardName = "shinki", + HasPortrait = true, + HasVoice = false, + Quality = 4 + }, + new + { + ItemCode = "item_0051", + CardName = "byakuren", + HasPortrait = true, + HasVoice = false, + Quality = 4 + }, + new + { + ItemCode = "item_1012", + CardName = "BonusEgg", + HasPortrait = false, + HasVoice = false, + Quality = 2 + }, + new + { + ItemCode = "item_0029", + CardName = "daiyousei", + HasPortrait = true, + HasVoice = true, + Quality = 4 + }, + new + { + ItemCode = "item_0073", + CardName = "junko", + HasPortrait = true, + HasVoice = false, + Quality = 4 + }, + new + { + ItemCode = "item_0063", + CardName = "kisume", + HasPortrait = true, + HasVoice = false, + Quality = 2 + }, + new + { + ItemCode = "item_2007", + CardName = "item_2007", + HasPortrait = false, + HasVoice = false, + Quality = 2 + }, + new + { + ItemCode = "item_0025", + CardName = "youmu", + HasPortrait = true, + HasVoice = true, + Quality = 3 + }, + new + { + ItemCode = "item_0004", + CardName = "mugiyousei", + HasPortrait = false, + HasVoice = false, + Quality = 1 + }, + new + { + ItemCode = "item_0096", + CardName = "seiga", + HasPortrait = true, + HasVoice = false, + Quality = 3 + }, + new + { + ItemCode = "item_0034", + CardName = "meirin", + HasPortrait = true, + HasVoice = false, + Quality = 2 + }, + new + { + ItemCode = "item_2011", + CardName = "item_2011", + HasPortrait = false, + HasVoice = false, + Quality = 3 + }, + new + { + ItemCode = "item_2010", + CardName = "item_2010", + HasPortrait = false, + HasVoice = false, + Quality = 3 + }, + new + { + ItemCode = "item_2008", + CardName = "item_2008", + HasPortrait = false, + HasVoice = false, + Quality = 2 + }, + new + { + ItemCode = "item_0036", + CardName = "yukari", + HasPortrait = true, + HasVoice = false, + Quality = 4 + }, + new + { + ItemCode = "item_0018", + CardName = "mystia", + HasPortrait = true, + HasVoice = true, + Quality = 2 + }, + new + { + ItemCode = "item_2009", + CardName = "item_2009", + HasPortrait = false, + HasVoice = false, + Quality = 3 + }, + new + { + ItemCode = "item_0046", + CardName = "sanae", + HasPortrait = true, + HasVoice = false, + Quality = 3 + }, + new + { + ItemCode = "item_2017", + CardName = "item_2017", + HasPortrait = false, + HasVoice = false, + Quality = 3 + }, + new + { + ItemCode = "item_2005", + CardName = "item_2005", + HasPortrait = false, + HasVoice = false, + Quality = 2 + }, + new + { + ItemCode = "item_0052", + CardName = "miko", + HasPortrait = true, + HasVoice = true, + Quality = 4 + }, + new + { + ItemCode = "item_0023", + CardName = "reisen", + HasPortrait = true, + HasVoice = true, + Quality = 3 + }, + new + { + ItemCode = "item_0049", + CardName = "minamitsu", + HasPortrait = true, + HasVoice = true, + Quality = 3 + }, + new + { + ItemCode = "item_2004", + CardName = "item_2004", + HasPortrait = false, + HasVoice = false, + Quality = 2 + }, + new + { + ItemCode = "item_2003", + CardName = "item_2003", + HasPortrait = false, + HasVoice = false, + Quality = 3 + }, + new + { + ItemCode = "item_0056", + CardName = "star", + HasPortrait = true, + HasVoice = true, + Quality = 2 + }, + new + { + ItemCode = "item_0006", + CardName = "hourainingyou", + HasPortrait = false, + HasVoice = false, + Quality = 1 + }, + new + { + ItemCode = "item_0057", + CardName = "sunny", + HasPortrait = true, + HasVoice = true, + Quality = 2 + }, + new + { + ItemCode = "item_0095", + CardName = "futo", + HasPortrait = true, + HasVoice = false, + Quality = 3 + }, + new + { + ItemCode = "item_2001", + CardName = "item_2001", + HasPortrait = false, + HasVoice = false, + Quality = 3 + }, + new + { + ItemCode = "item_1013", + CardName = "BonusEgg", + HasPortrait = false, + HasVoice = false, + Quality = 3 + }, + new + { + ItemCode = "item_0097", + CardName = "yoshika", + HasPortrait = true, + HasVoice = false, + Quality = 2 + }, + new + { + ItemCode = "item_0027", + CardName = "utsuho", + HasPortrait = true, + HasVoice = false, + Quality = 3 + }, + new + { + ItemCode = "item_0068", + CardName = "komachi", + HasPortrait = true, + HasVoice = false, + Quality = 4 + }, + new + { + ItemCode = "item_0047", + CardName = "kanako", + HasPortrait = true, + HasVoice = true, + Quality = 4 + }, + new + { + ItemCode = "item_0058", + CardName = "luna", + HasPortrait = true, + HasVoice = true, + Quality = 2 + }, + new + { + ItemCode = "item_2013", + CardName = "item_2013", + HasPortrait = false, + HasVoice = false, + Quality = 4 + }, + new + { + ItemCode = "item_0024", + CardName = "yuyuko", + HasPortrait = true, + HasVoice = true, + Quality = 3 + }, + new + { + ItemCode = "item_0093", + CardName = "kyouko", + HasPortrait = true, + HasVoice = true, + Quality = 2 + }, + new + { + ItemCode = "item_0005", + CardName = "shanghainingyou", + HasPortrait = false, + HasVoice = false, + Quality = 1 + }, + new + { + ItemCode = "item_1006", + CardName = "BonusEgg", + HasPortrait = false, + HasVoice = false, + Quality = 4 + }, + new + { + ItemCode = "item_0064", + CardName = "shikieiki", + HasPortrait = true, + HasVoice = false, + Quality = 4 + }, + new + { + ItemCode = "item_0092", + CardName = "medicine", + HasPortrait = true, + HasVoice = true, + Quality = 2 + }, + new + { + ItemCode = "item_0017", + CardName = "iku", + HasPortrait = true, + HasVoice = false, + Quality = 2 + }, + new + { + ItemCode = "item_0013", + CardName = "lunasa", + HasPortrait = true, + HasVoice = true, + Quality = 2 + }, + new + { + ItemCode = "item_0091", + CardName = "hina", + HasPortrait = true, + HasVoice = false, + Quality = 2 + }, + new + { + ItemCode = "item_1004", + CardName = "BonusEgg", + HasPortrait = false, + HasVoice = false, + Quality = 2 + }, + new + { + ItemCode = "item_0040", + CardName = "mokou", + HasPortrait = true, + HasVoice = true, + Quality = 3 + }, + new + { + ItemCode = "item_0088", + CardName = "sizuha", + HasPortrait = true, + HasVoice = true, + Quality = 2 + }, + new + { + ItemCode = "item_2012", + CardName = "item_2012", + HasPortrait = false, + HasVoice = false, + Quality = 4 + }, + new + { + ItemCode = "item_0010", + CardName = "kogasa", + HasPortrait = true, + HasVoice = true, + Quality = 2 + }, + new + { + ItemCode = "item_0062", + CardName = "inaba", + HasPortrait = true, + HasVoice = false, + Quality = 2 + }, + new + { + ItemCode = "item_0001", + CardName = "lily", + HasPortrait = true, + HasVoice = false, + Quality = 2 + }, + new + { + ItemCode = "item_1005", + CardName = "BonusEgg", + HasPortrait = false, + HasVoice = false, + Quality = 3 + }, + new + { + ItemCode = "item_0060", + CardName = "wriggle", + HasPortrait = true, + HasVoice = false, + Quality = 2 + }, + new + { + ItemCode = "item_0059", + CardName = "alice", + HasPortrait = true, + HasVoice = true, + Quality = 3 + }, + new + { + ItemCode = "item_0054", + CardName = "yuugi", + HasPortrait = true, + HasVoice = true, + Quality = 3 + }, + new + { + ItemCode = "item_0032", + CardName = "flandre", + HasPortrait = true, + HasVoice = true, + Quality = 4 + }, + new + { + ItemCode = "item_0033", + CardName = "koakuma", + HasPortrait = true, + HasVoice = true, + Quality = 2 + }, + new + { + ItemCode = "item_0041", + CardName = "kaguya", + HasPortrait = true, + HasVoice = true, + Quality = 3 + }, + new + { + ItemCode = "item_0039", + CardName = "eirin", + HasPortrait = true, + HasVoice = true, + Quality = 4 + }, + new + { + ItemCode = "item_0037", + CardName = "ran", + HasPortrait = true, + HasVoice = true, + Quality = 3 + }, + new + { + ItemCode = "item_0035", + CardName = "yuuka", + HasPortrait = true, + HasVoice = true, + Quality = 4 + }, + new + { + ItemCode = "item_0048", + CardName = "suwako", + HasPortrait = true, + HasVoice = false, + Quality = 3 + }, + new + { + ItemCode = "item_0016", + CardName = "satori", + HasPortrait = true, + HasVoice = true, + Quality = 2 + }, + new + { + ItemCode = "item_0053", + CardName = "kokoro", + HasPortrait = true, + HasVoice = true, + Quality = 3 + }, + new + { + ItemCode = "item_0008", + CardName = "maidyousei", + HasPortrait = false, + HasVoice = false, + Quality = 1 + }, + new + { + ItemCode = "item_0012", + CardName = "lyrica", + HasPortrait = true, + HasVoice = true, + Quality = 2 + }, + new + { + ItemCode = "item_0031", + CardName = "koishi", + HasPortrait = true, + HasVoice = true, + Quality = 4 + }, + new + { + ItemCode = "item_0094", + CardName = "soga", + HasPortrait = true, + HasVoice = true, + Quality = 3 + }, + new + { + ItemCode = "item_0021", + CardName = "patchouli", + HasPortrait = true, + HasVoice = true, + Quality = 3 + }, + new + { + ItemCode = "item_0020", + CardName = "tenshi", + HasPortrait = true, + HasVoice = false, + Quality = 3 + }, + new + { + ItemCode = "item_1014", + CardName = "BonusEgg", + HasPortrait = false, + HasVoice = false, + Quality = 4 + }); + }); + + modelBuilder.Entity("TOOHUCardAPI.Data.Models.CardLevel", b => + { + b.Property("UserSteamId") + .HasColumnType("bigint"); + + b.Property("CardItemCode") + .HasColumnType("text"); + + b.Property("Level") + .HasColumnType("integer"); + + b.HasKey("UserSteamId", "CardItemCode"); + + b.HasIndex("CardItemCode"); + + b.ToTable("CardLevel"); + }); + + modelBuilder.Entity("TOOHUCardAPI.Data.Models.EncodedCardGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("EncodedString") + .HasColumnType("text"); + + b.Property("GroupKey") + .HasColumnType("text"); + + b.Property("UserSteamId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserSteamId"); + + b.ToTable("EncodedCardGroup"); + }); + + modelBuilder.Entity("TOOHUCardAPI.Data.Models.RankEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("AccountId") + .HasColumnType("bigint"); + + b.Property("Damage") + .HasColumnType("bigint"); + + b.Property("RankType") + .HasColumnType("integer"); + + b.Property("UpdateTime") + .HasColumnType("timestamp without time zone"); + + b.Property("UserSteamId") + .HasColumnType("bigint"); + + b.Property("Username") + .HasColumnType("text"); + + b.Property("Version") + .HasColumnType("text"); + + b.Property("Wave") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("UserSteamId"); + + b.ToTable("RankEntries"); + }); + + modelBuilder.Entity("TOOHUCardAPI.Data.Models.RankTowerEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("EncodedData") + .HasColumnType("text"); + + b.Property("RankEntryId") + .HasColumnType("integer"); + + b.Property("TowerKey") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("RankEntryId"); + + b.ToTable("RankTowerEntry"); + }); + + modelBuilder.Entity("TOOHUCardAPI.Data.Models.User", b => + { + b.Property("SteamId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("Ban") + .HasColumnType("boolean"); + + b.Property("EndTime") + .HasColumnType("timestamp without time zone"); + + b.Property("KeySaveDate") + .HasColumnType("timestamp without time zone"); + + b.Property("KeyTotal") + .HasColumnType("integer"); + + b.Property("KeyUseCount") + .HasColumnType("integer"); + + b.Property("LastDailyLoginBonus") + .HasColumnType("timestamp without time zone"); + + b.Property("LastFirstWin") + .HasColumnType("timestamp without time zone"); + + b.Property("MaxTeamWave") + .HasColumnType("integer"); + + b.Property("MaxWave") + .HasColumnType("integer"); + + b.Property("PetEffect") + .HasColumnType("text"); + + b.Property("PetLevel") + .HasColumnType("integer"); + + b.Property("PetModel") + .HasColumnType("text"); + + b.Property("Point") + .HasColumnType("integer"); + + b.Property("PowerMaxTotal") + .HasColumnType("integer"); + + b.Property("Vip") + .HasColumnType("boolean"); + + b.HasKey("SteamId"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("TOOHUCardAPI.Data.Models.CardLevel", b => + { + b.HasOne("TOOHUCardAPI.Data.Models.Card", "Card") + .WithMany() + .HasForeignKey("CardItemCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TOOHUCardAPI.Data.Models.User", null) + .WithMany("CardLevels") + .HasForeignKey("UserSteamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Card"); + }); + + modelBuilder.Entity("TOOHUCardAPI.Data.Models.EncodedCardGroup", b => + { + b.HasOne("TOOHUCardAPI.Data.Models.User", null) + .WithMany("EncodedCardGroups") + .HasForeignKey("UserSteamId"); + }); + + modelBuilder.Entity("TOOHUCardAPI.Data.Models.RankEntry", b => + { + b.HasOne("TOOHUCardAPI.Data.Models.User", "User") + .WithMany() + .HasForeignKey("UserSteamId"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("TOOHUCardAPI.Data.Models.RankTowerEntry", b => + { + b.HasOne("TOOHUCardAPI.Data.Models.RankEntry", null) + .WithMany("TowersUsed") + .HasForeignKey("RankEntryId"); + }); + + modelBuilder.Entity("TOOHUCardAPI.Data.Models.RankEntry", b => + { + b.Navigation("TowersUsed"); + }); + + modelBuilder.Entity("TOOHUCardAPI.Data.Models.User", b => + { + b.Navigation("CardLevels"); + + b.Navigation("EncodedCardGroups"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/TOOHUCardAPI/Migrations/20211107044043_updatetime.cs b/TOOHUCardAPI/Migrations/20211107044043_updatetime.cs new file mode 100644 index 0000000..1e82187 --- /dev/null +++ b/TOOHUCardAPI/Migrations/20211107044043_updatetime.cs @@ -0,0 +1,25 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace TOOHUCardAPI.Migrations +{ + public partial class updatetime : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "UpdateTime", + table: "RankEntries", + type: "timestamp without time zone", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "UpdateTime", + table: "RankEntries"); + } + } +} diff --git a/TOOHUCardAPI/Migrations/AppDbContextModelSnapshot.cs b/TOOHUCardAPI/Migrations/AppDbContextModelSnapshot.cs index 67613ee..bcf83b8 100644 --- a/TOOHUCardAPI/Migrations/AppDbContextModelSnapshot.cs +++ b/TOOHUCardAPI/Migrations/AppDbContextModelSnapshot.cs @@ -956,6 +956,9 @@ namespace TOOHUCardAPI.Migrations b.Property("RankType") .HasColumnType("integer"); + b.Property("UpdateTime") + .HasColumnType("timestamp without time zone"); + b.Property("UserSteamId") .HasColumnType("bigint");