- Improved .curtrs (It will now have a lot more useful data in the database, show Tx ids, and be partially localized)

- Added .curtr command which lets you see full information about one of your own transactions with the specified id
- Added .WithAuthor(IUser) extension for embedbuilder
This commit is contained in:
Kwoth
2022-01-25 05:55:38 +01:00
parent 81533b7f69
commit 3910dc7499
18 changed files with 3077 additions and 70 deletions

View File

@@ -146,13 +146,23 @@ public class NadekoContext : DbContext
modelBuilder.Entity<DiscordUser>(du =>
{
du.Property(x => x.IsClubAdmin).HasDefaultValue(false);
du.Property(x => x.IsClubAdmin)
.HasDefaultValue(false);
du.Property(x => x.NotifyOnLevelUp).HasDefaultValue(XpNotificationLocation.None);
du.Property(x => x.NotifyOnLevelUp)
.HasDefaultValue(XpNotificationLocation.None);
du.Property(x => x.LastXpGain).HasDefaultValueSql("datetime('now', '-1 years')");
du.Property(x => x.LastXpGain)
.HasDefaultValueSql("datetime('now', '-1 years')");
du.Property(x => x.LastLevelUp).HasDefaultValueSql("datetime('now')");
du.Property(x => x.LastLevelUp)
.HasDefaultValueSql("datetime('now')");
du.Property(x => x.TotalXp)
.HasDefaultValue(0);
du.Property(x => x.CurrencyAmount)
.HasDefaultValue(0);
du.HasAlternateKey(w => w.UserId);
du.HasOne(x => x.Club).WithMany(x => x.Users).IsRequired(false);
@@ -244,7 +254,22 @@ public class NadekoContext : DbContext
#region CurrencyTransactions
modelBuilder.Entity<CurrencyTransaction>().HasIndex(x => x.UserId).IsUnique(false);
modelBuilder.Entity<CurrencyTransaction>(e =>
{
e.HasIndex(x => x.UserId)
.IsUnique(false);
e.Property(x => x.OtherId)
.HasDefaultValueSql("NULL");
e.Property(x => x.Type)
.IsRequired();
e.Property(x => x.Extra)
.IsRequired();
});
#endregion
@@ -321,6 +346,7 @@ public class NadekoContext : DbContext
atch.HasMany(x => x.Users).WithOne(x => x.Channel).OnDelete(DeleteBehavior.Cascade);
modelBuilder.Entity<AutoTranslateUser>(atu => atu.HasAlternateKey(x => new { x.ChannelId, x.UserId }));
}
#if DEBUG