diff --git a/NuGet.Config b/NuGet.Config
index 3a8d572c2..bb227654c 100644
--- a/NuGet.Config
+++ b/NuGet.Config
@@ -3,5 +3,6 @@
+
\ No newline at end of file
diff --git a/TASVideos.Core/Services/SignInManager.cs b/TASVideos.Core/Services/SignInManager.cs
index ad468e001..a22527d74 100644
--- a/TASVideos.Core/Services/SignInManager.cs
+++ b/TASVideos.Core/Services/SignInManager.cs
@@ -6,7 +6,6 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
-using TASVideos.Core.Extensions;
using TASVideos.Data;
using TASVideos.Data.Entity;
diff --git a/TASVideos.Data/ApplicationDbContext.cs b/TASVideos.Data/ApplicationDbContext.cs
index 81c2301f5..ee3650a8a 100644
--- a/TASVideos.Data/ApplicationDbContext.cs
+++ b/TASVideos.Data/ApplicationDbContext.cs
@@ -27,6 +27,8 @@ public ApplicationDbContext(DbContextOptions options, IHtt
_httpContext = httpContextAccessor;
}
+ public DbSet AutoHistory { get; set; } = null!;
+
public DbSet RolePermission { get; set; } = null!;
public DbSet WikiPages { get; set; } = null!;
public DbSet WikiReferrals { get; set; } = null!;
@@ -94,16 +96,65 @@ public override int SaveChanges(bool acceptAllChangesOnSuccess)
PerformTrackingUpdates();
ChangeTracker.AutoDetectChangesEnabled = false;
+
+ // remember added entries,
+ // before EF Core is assigning valid Ids (it does on save changes,
+ // when ids equal zero) and setting their state to
+ // Unchanged (it does on every save changes)
+ var addedEntities = ChangeTracker
+ .Entries()
+ .Where(e => e.State == EntityState.Added)
+ .ToArray();
+
+ this.EnsureAutoHistory(() => new CustomAutoHistory()
+ {
+ UserId = _httpContext?.HttpContext?.User.GetUserId() ?? -1
+ });
var result = base.SaveChanges(acceptAllChangesOnSuccess);
+
+ // after "SaveChanges" added enties now have gotten valid ids (if it was necessary)
+ // and the history for them can be ensured and be saved with another "SaveChanges"
+ this.EnsureAddedHistory(
+ () => new CustomAutoHistory()
+ {
+ UserId = _httpContext?.HttpContext?.User.GetUserId() ?? -1
+ }, addedEntities);
+ result += base.SaveChanges(acceptAllChangesOnSuccess);
+
ChangeTracker.AutoDetectChangesEnabled = true;
return result;
}
- public override Task SaveChangesAsync(CancellationToken cancellationToken = default)
+ public override async Task SaveChangesAsync(CancellationToken cancellationToken = default)
{
PerformTrackingUpdates();
- return base.SaveChangesAsync(cancellationToken);
+
+ // remember added entries,
+ // before EF Core is assigning valid Ids (it does on save changes,
+ // when ids equal zero) and setting their state to
+ // Unchanged (it does on every save changes)
+ var addedEntities = ChangeTracker
+ .Entries()
+ .Where(e => e.State == EntityState.Added)
+ .ToArray();
+
+ this.EnsureAutoHistory(() => new CustomAutoHistory()
+ {
+ UserId = _httpContext?.HttpContext?.User.GetUserId() ?? -1
+ });
+ var result = await base.SaveChangesAsync(cancellationToken);
+
+ // after "SaveChanges" added enties now have gotten valid ids (if it was necessary)
+ // and the history for them can be ensured and be saved with another "SaveChanges"
+ this.EnsureAddedHistory(
+ () => new CustomAutoHistory()
+ {
+ UserId = _httpContext?.HttpContext?.User.GetUserId() ?? -1
+ }, addedEntities);
+ result += await base.SaveChangesAsync(CancellationToken.None);
+
+ return result;
}
///
@@ -421,6 +472,11 @@ protected override void OnModelCreating(ModelBuilder builder)
{
entity.HasIndex(e => e.FileExtension).IsUnique();
});
+
+ builder.EnableAutoHistory(o =>
+ {
+ o.LimitChangedLength = false;
+ });
}
private void PerformTrackingUpdates()
diff --git a/TASVideos.Data/CustomAutoHistory.cs b/TASVideos.Data/CustomAutoHistory.cs
new file mode 100644
index 000000000..1ad3e3aa2
--- /dev/null
+++ b/TASVideos.Data/CustomAutoHistory.cs
@@ -0,0 +1,8 @@
+using Microsoft.EntityFrameworkCore;
+
+namespace TASVideos.Data;
+
+internal class CustomAutoHistory : AutoHistory
+{
+ public int UserId { get; set; }
+}
diff --git a/TASVideos.Data/Entity/Awards/Award.cs b/TASVideos.Data/Entity/Awards/Award.cs
index eabd8e4f3..097bf728b 100644
--- a/TASVideos.Data/Entity/Awards/Award.cs
+++ b/TASVideos.Data/Entity/Awards/Award.cs
@@ -1,4 +1,6 @@
-namespace TASVideos.Data.Entity.Awards;
+using Microsoft.EntityFrameworkCore;
+
+namespace TASVideos.Data.Entity.Awards;
public enum AwardType
{
@@ -6,6 +8,7 @@ public enum AwardType
Movie
}
+[ExcludeFromHistory]
public class Award
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/Awards/PublicationAward.cs b/TASVideos.Data/Entity/Awards/PublicationAward.cs
index 091c431be..0b9c2db4c 100644
--- a/TASVideos.Data/Entity/Awards/PublicationAward.cs
+++ b/TASVideos.Data/Entity/Awards/PublicationAward.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity.Awards;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity.Awards;
+
+[ExcludeFromHistory]
public class PublicationAward
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/Awards/UserAward.cs b/TASVideos.Data/Entity/Awards/UserAward.cs
index 900a68af8..376c0b398 100644
--- a/TASVideos.Data/Entity/Awards/UserAward.cs
+++ b/TASVideos.Data/Entity/Awards/UserAward.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity.Awards;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity.Awards;
+
+[ExcludeFromHistory]
public class UserAward
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/BaseEntity.cs b/TASVideos.Data/Entity/BaseEntity.cs
index c55191739..49b5155e4 100644
--- a/TASVideos.Data/Entity/BaseEntity.cs
+++ b/TASVideos.Data/Entity/BaseEntity.cs
@@ -1,4 +1,6 @@
-namespace TASVideos.Data.Entity;
+using Microsoft.EntityFrameworkCore;
+
+namespace TASVideos.Data.Entity;
public interface ITrackable
{
@@ -11,10 +13,14 @@ public interface ITrackable
public class BaseEntity : ITrackable
{
+ [ExcludeFromHistory]
public DateTime CreateTimestamp { get; set; }
+ [ExcludeFromHistory]
public string? CreateUserName { get; set; }
+ [ExcludeFromHistory]
public DateTime LastUpdateTimestamp { get; set; }
+ [ExcludeFromHistory]
public string? LastUpdateUserName { get; set; }
}
diff --git a/TASVideos.Data/Entity/DeprecatedMovieFormat.cs b/TASVideos.Data/Entity/DeprecatedMovieFormat.cs
index 6aabfd0db..04daf5089 100644
--- a/TASVideos.Data/Entity/DeprecatedMovieFormat.cs
+++ b/TASVideos.Data/Entity/DeprecatedMovieFormat.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity;
+
+[ExcludeFromHistory]
public class DeprecatedMovieFormat : BaseEntity
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/Flag.cs b/TASVideos.Data/Entity/Flag.cs
index 2ec2ee484..1ea0a658a 100644
--- a/TASVideos.Data/Entity/Flag.cs
+++ b/TASVideos.Data/Entity/Flag.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity;
+
+[ExcludeFromHistory]
public class Flag : BaseEntity
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/Forum/Forum.cs b/TASVideos.Data/Entity/Forum/Forum.cs
index c9c763109..fb8b28f30 100644
--- a/TASVideos.Data/Entity/Forum/Forum.cs
+++ b/TASVideos.Data/Entity/Forum/Forum.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity.Forum;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity.Forum;
+
+[ExcludeFromHistory]
public class Forum : BaseEntity
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/Forum/ForumCategory.cs b/TASVideos.Data/Entity/Forum/ForumCategory.cs
index d40751279..8450b9209 100644
--- a/TASVideos.Data/Entity/Forum/ForumCategory.cs
+++ b/TASVideos.Data/Entity/Forum/ForumCategory.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity.Forum;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity.Forum;
+
+[ExcludeFromHistory]
public class ForumCategory : BaseEntity
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/Forum/ForumPoll.cs b/TASVideos.Data/Entity/Forum/ForumPoll.cs
index fb44ef5fd..5424a5666 100644
--- a/TASVideos.Data/Entity/Forum/ForumPoll.cs
+++ b/TASVideos.Data/Entity/Forum/ForumPoll.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity.Forum;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity.Forum;
+
+[ExcludeFromHistory]
public class ForumPoll : BaseEntity
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/Forum/ForumPollOption.cs b/TASVideos.Data/Entity/Forum/ForumPollOption.cs
index 008b4ce11..650c950a7 100644
--- a/TASVideos.Data/Entity/Forum/ForumPollOption.cs
+++ b/TASVideos.Data/Entity/Forum/ForumPollOption.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity.Forum;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity.Forum;
+
+[ExcludeFromHistory]
public class ForumPollOption : BaseEntity
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/Forum/ForumPollOptionVote.cs b/TASVideos.Data/Entity/Forum/ForumPollOptionVote.cs
index b087b1151..02d59b0af 100644
--- a/TASVideos.Data/Entity/Forum/ForumPollOptionVote.cs
+++ b/TASVideos.Data/Entity/Forum/ForumPollOptionVote.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity.Forum;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity.Forum;
+
+[ExcludeFromHistory]
public class ForumPollOptionVote
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/Forum/ForumPost.cs b/TASVideos.Data/Entity/Forum/ForumPost.cs
index 953437292..242cc3bc1 100644
--- a/TASVideos.Data/Entity/Forum/ForumPost.cs
+++ b/TASVideos.Data/Entity/Forum/ForumPost.cs
@@ -1,8 +1,10 @@
using System.Text.Json.Serialization;
+using Microsoft.EntityFrameworkCore;
using NpgsqlTypes;
namespace TASVideos.Data.Entity.Forum;
+[ExcludeFromHistory]
public class ForumPost : BaseEntity
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/Forum/ForumTopic.cs b/TASVideos.Data/Entity/Forum/ForumTopic.cs
index 3fc7fdccd..3f18dec90 100644
--- a/TASVideos.Data/Entity/Forum/ForumTopic.cs
+++ b/TASVideos.Data/Entity/Forum/ForumTopic.cs
@@ -1,4 +1,6 @@
-namespace TASVideos.Data.Entity.Forum;
+using Microsoft.EntityFrameworkCore;
+
+namespace TASVideos.Data.Entity.Forum;
public enum ForumTopicType
{
@@ -7,6 +9,7 @@ public enum ForumTopicType
Announcement = 2
}
+[ExcludeFromHistory]
public class ForumTopic : BaseEntity
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/Forum/ForumTopicWatch.cs b/TASVideos.Data/Entity/Forum/ForumTopicWatch.cs
index f90cfa761..b216bbe65 100644
--- a/TASVideos.Data/Entity/Forum/ForumTopicWatch.cs
+++ b/TASVideos.Data/Entity/Forum/ForumTopicWatch.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity.Forum;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity.Forum;
+
+[ExcludeFromHistory]
public class ForumTopicWatch
{
public int UserId { get; set; }
diff --git a/TASVideos.Data/Entity/Game/GameGameGroup.cs b/TASVideos.Data/Entity/Game/GameGameGroup.cs
index c29d0985c..4594c8b45 100644
--- a/TASVideos.Data/Entity/Game/GameGameGroup.cs
+++ b/TASVideos.Data/Entity/Game/GameGameGroup.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity.Game;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity.Game;
+
+[ExcludeFromHistory]
public class GameGameGroup
{
public int GameId { get; set; }
diff --git a/TASVideos.Data/Entity/Game/GameGenre.cs b/TASVideos.Data/Entity/Game/GameGenre.cs
index 0544b3d87..bbecb01bf 100644
--- a/TASVideos.Data/Entity/Game/GameGenre.cs
+++ b/TASVideos.Data/Entity/Game/GameGenre.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity.Game;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity.Game;
+
+[ExcludeFromHistory]
public class GameGenre
{
public int GameId { get; set; }
diff --git a/TASVideos.Data/Entity/Game/GameGroup.cs b/TASVideos.Data/Entity/Game/GameGroup.cs
index 93e84e7c4..1b33d88ea 100644
--- a/TASVideos.Data/Entity/Game/GameGroup.cs
+++ b/TASVideos.Data/Entity/Game/GameGroup.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity.Game;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity.Game;
+
+[ExcludeFromHistory]
public class GameGroup
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/Game/GameSystem.cs b/TASVideos.Data/Entity/Game/GameSystem.cs
index 08937404a..5e0519419 100644
--- a/TASVideos.Data/Entity/Game/GameSystem.cs
+++ b/TASVideos.Data/Entity/Game/GameSystem.cs
@@ -1,8 +1,11 @@
-namespace TASVideos.Data.Entity.Game;
+using Microsoft.EntityFrameworkCore;
+
+namespace TASVideos.Data.Entity.Game;
///
/// Represents the system that a game runs on, such as NES, SNES, Commodore 64, PSX, etc
///
+[ExcludeFromHistory]
public class GameSystem : BaseEntity
{
public int Id { get; set; } // Note that this is Non-auto-incrementing, we need Ids to be identical across any database
diff --git a/TASVideos.Data/Entity/Game/GameSystemFrameRate.cs b/TASVideos.Data/Entity/Game/GameSystemFrameRate.cs
index 9b38f4e78..d7777c496 100644
--- a/TASVideos.Data/Entity/Game/GameSystemFrameRate.cs
+++ b/TASVideos.Data/Entity/Game/GameSystemFrameRate.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity.Game;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity.Game;
+
+[ExcludeFromHistory]
public class GameSystemFrameRate : BaseEntity
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/Game/Genre.cs b/TASVideos.Data/Entity/Game/Genre.cs
index 0ea8b1d44..ec8649e50 100644
--- a/TASVideos.Data/Entity/Game/Genre.cs
+++ b/TASVideos.Data/Entity/Game/Genre.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity.Game;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity.Game;
+
+[ExcludeFromHistory]
public class Genre
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/IpBan.cs b/TASVideos.Data/Entity/IpBan.cs
index 91a4d9394..15e47dd48 100644
--- a/TASVideos.Data/Entity/IpBan.cs
+++ b/TASVideos.Data/Entity/IpBan.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity;
+
+[ExcludeFromHistory]
public class IpBan : BaseEntity
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/MediaPosts.cs b/TASVideos.Data/Entity/MediaPosts.cs
index 54c1f31c9..664ee16ce 100644
--- a/TASVideos.Data/Entity/MediaPosts.cs
+++ b/TASVideos.Data/Entity/MediaPosts.cs
@@ -1,8 +1,11 @@
-namespace TASVideos.Data.Entity;
+using Microsoft.EntityFrameworkCore;
+
+namespace TASVideos.Data.Entity;
///
/// Data storage for an external media post (such as Irc, Discord).
///
+[ExcludeFromHistory]
public class MediaPost : BaseEntity
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/PrivateMessage.cs b/TASVideos.Data/Entity/PrivateMessage.cs
index 4bec527ba..758fc56bb 100644
--- a/TASVideos.Data/Entity/PrivateMessage.cs
+++ b/TASVideos.Data/Entity/PrivateMessage.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity;
+
+[ExcludeFromHistory]
public class PrivateMessage : BaseEntity
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/Publication.cs b/TASVideos.Data/Entity/Publication.cs
index c733d52d9..992ff8cd4 100644
--- a/TASVideos.Data/Entity/Publication.cs
+++ b/TASVideos.Data/Entity/Publication.cs
@@ -1,4 +1,5 @@
-using System.ComponentModel.DataAnnotations.Schema;
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations.Schema;
using TASVideos.Common;
using TASVideos.Data.Entity.Awards;
using TASVideos.Data.Entity.Game;
@@ -26,6 +27,7 @@ public interface IPublicationTokens
int? Limit { get; }
}
+[ExcludeFromHistory]
public class Publication : BaseEntity, ITimeable
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/PublicationAuthor.cs b/TASVideos.Data/Entity/PublicationAuthor.cs
index 5594e70b9..21ea353b9 100644
--- a/TASVideos.Data/Entity/PublicationAuthor.cs
+++ b/TASVideos.Data/Entity/PublicationAuthor.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity;
+
+[ExcludeFromHistory]
public class PublicationAuthor
{
public int UserId { get; set; }
diff --git a/TASVideos.Data/Entity/PublicationClass.cs b/TASVideos.Data/Entity/PublicationClass.cs
index ecf2d370f..f739ef8fe 100644
--- a/TASVideos.Data/Entity/PublicationClass.cs
+++ b/TASVideos.Data/Entity/PublicationClass.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity;
+
+[ExcludeFromHistory]
public class PublicationClass
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/PublicationFile.cs b/TASVideos.Data/Entity/PublicationFile.cs
index b5a957d81..de1788e0b 100644
--- a/TASVideos.Data/Entity/PublicationFile.cs
+++ b/TASVideos.Data/Entity/PublicationFile.cs
@@ -1,10 +1,13 @@
-namespace TASVideos.Data.Entity;
+using Microsoft.EntityFrameworkCore;
+
+namespace TASVideos.Data.Entity;
public enum FileType
{
Screenshot, MovieFile
}
+[ExcludeFromHistory]
public class PublicationFile : BaseEntity
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/PublicationFlag.cs b/TASVideos.Data/Entity/PublicationFlag.cs
index ec72a295d..33a818c9b 100644
--- a/TASVideos.Data/Entity/PublicationFlag.cs
+++ b/TASVideos.Data/Entity/PublicationFlag.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity;
+
+[ExcludeFromHistory]
public class PublicationFlag
{
public int PublicationId { get; set; }
diff --git a/TASVideos.Data/Entity/PublicationMaintenanceLog.cs b/TASVideos.Data/Entity/PublicationMaintenanceLog.cs
index 62f26386c..0eaec1d6c 100644
--- a/TASVideos.Data/Entity/PublicationMaintenanceLog.cs
+++ b/TASVideos.Data/Entity/PublicationMaintenanceLog.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity;
+
+[ExcludeFromHistory]
public class PublicationMaintenanceLog
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/PublicationRating.cs b/TASVideos.Data/Entity/PublicationRating.cs
index 6400417ee..eef973928 100644
--- a/TASVideos.Data/Entity/PublicationRating.cs
+++ b/TASVideos.Data/Entity/PublicationRating.cs
@@ -1,10 +1,13 @@
-namespace TASVideos.Data.Entity;
+using Microsoft.EntityFrameworkCore;
+
+namespace TASVideos.Data.Entity;
public enum PublicationRatingType
{
Entertainment, TechQuality
}
+[ExcludeFromHistory]
public class PublicationRating
{
public int UserId { get; set; }
diff --git a/TASVideos.Data/Entity/PublicationTag.cs b/TASVideos.Data/Entity/PublicationTag.cs
index 95e2e2945..7f95139ff 100644
--- a/TASVideos.Data/Entity/PublicationTag.cs
+++ b/TASVideos.Data/Entity/PublicationTag.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity;
+
+[ExcludeFromHistory]
public class PublicationTag
{
public int PublicationId { get; set; }
diff --git a/TASVideos.Data/Entity/PublicationUrl.cs b/TASVideos.Data/Entity/PublicationUrl.cs
index 347fd2135..99ad9b6cc 100644
--- a/TASVideos.Data/Entity/PublicationUrl.cs
+++ b/TASVideos.Data/Entity/PublicationUrl.cs
@@ -1,7 +1,10 @@
-namespace TASVideos.Data.Entity;
+using Microsoft.EntityFrameworkCore;
+
+namespace TASVideos.Data.Entity;
public enum PublicationUrlType { Streaming, Mirror }
+[ExcludeFromHistory]
public class PublicationUrl : BaseEntity
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/Role.cs b/TASVideos.Data/Entity/Role.cs
index 5cf36ee24..31a7008e8 100644
--- a/TASVideos.Data/Entity/Role.cs
+++ b/TASVideos.Data/Entity/Role.cs
@@ -1,7 +1,9 @@
using Microsoft.AspNetCore.Identity;
+using Microsoft.EntityFrameworkCore;
namespace TASVideos.Data.Entity;
+[ExcludeFromHistory]
public class Role : IdentityRole, ITrackable
{
///
diff --git a/TASVideos.Data/Entity/RoleClaim.cs b/TASVideos.Data/Entity/RoleClaim.cs
index 5ed15c0c1..f378df8f5 100644
--- a/TASVideos.Data/Entity/RoleClaim.cs
+++ b/TASVideos.Data/Entity/RoleClaim.cs
@@ -1,7 +1,9 @@
using Microsoft.AspNetCore.Identity;
+using Microsoft.EntityFrameworkCore;
namespace TASVideos.Data.Entity;
+[ExcludeFromHistory]
public class RoleClaim : IdentityRoleClaim
{
}
diff --git a/TASVideos.Data/Entity/RoleLinks.cs b/TASVideos.Data/Entity/RoleLinks.cs
index 97c391223..07b12f478 100644
--- a/TASVideos.Data/Entity/RoleLinks.cs
+++ b/TASVideos.Data/Entity/RoleLinks.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity;
+
+[ExcludeFromHistory]
public class RoleLink
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/RolePermission.cs b/TASVideos.Data/Entity/RolePermission.cs
index 6ae6910ab..e3042b32f 100644
--- a/TASVideos.Data/Entity/RolePermission.cs
+++ b/TASVideos.Data/Entity/RolePermission.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity;
+
+[ExcludeFromHistory]
public class RolePermission
{
public int RoleId { get; set; }
diff --git a/TASVideos.Data/Entity/Submission.cs b/TASVideos.Data/Entity/Submission.cs
index 1fc652c06..f769850ff 100644
--- a/TASVideos.Data/Entity/Submission.cs
+++ b/TASVideos.Data/Entity/Submission.cs
@@ -1,4 +1,5 @@
-using TASVideos.Common;
+using Microsoft.EntityFrameworkCore;
+using TASVideos.Common;
using TASVideos.Data.Entity.Forum;
using TASVideos.Data.Entity.Game;
@@ -13,6 +14,7 @@ public interface ISubmissionFilter
IEnumerable GameIds { get; }
}
+[ExcludeFromHistory]
public class Submission : BaseEntity, ITimeable
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/SubmissionAuthor.cs b/TASVideos.Data/Entity/SubmissionAuthor.cs
index fe3822b50..2bb485e97 100644
--- a/TASVideos.Data/Entity/SubmissionAuthor.cs
+++ b/TASVideos.Data/Entity/SubmissionAuthor.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity;
+
+[ExcludeFromHistory]
public class SubmissionAuthor
{
public int UserId { get; set; }
diff --git a/TASVideos.Data/Entity/SubmissionRejectionReason.cs b/TASVideos.Data/Entity/SubmissionRejectionReason.cs
index 6c75e7f92..1da7a6f94 100644
--- a/TASVideos.Data/Entity/SubmissionRejectionReason.cs
+++ b/TASVideos.Data/Entity/SubmissionRejectionReason.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity;
+
+[ExcludeFromHistory]
public class SubmissionRejectionReason
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/SubmissionStatusHistory.cs b/TASVideos.Data/Entity/SubmissionStatusHistory.cs
index 0c9b2d81f..5e51982e8 100644
--- a/TASVideos.Data/Entity/SubmissionStatusHistory.cs
+++ b/TASVideos.Data/Entity/SubmissionStatusHistory.cs
@@ -3,6 +3,7 @@
namespace TASVideos.Data.Entity;
+[ExcludeFromHistory]
public class SubmissionStatusHistory : BaseEntity
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/Tag.cs b/TASVideos.Data/Entity/Tag.cs
index 4e0b4b255..2ca904a53 100644
--- a/TASVideos.Data/Entity/Tag.cs
+++ b/TASVideos.Data/Entity/Tag.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity;
+
+[ExcludeFromHistory]
public class Tag
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/User.cs b/TASVideos.Data/Entity/User.cs
index 70644d5f0..dfa9d1cf7 100644
--- a/TASVideos.Data/Entity/User.cs
+++ b/TASVideos.Data/Entity/User.cs
@@ -6,6 +6,7 @@
namespace TASVideos.Data.Entity;
+[ExcludeFromHistory]
public class User : IdentityUser, ITrackable
{
public DateTime? LastLoggedInTimeStamp { get; set; }
diff --git a/TASVideos.Data/Entity/UserClaim.cs b/TASVideos.Data/Entity/UserClaim.cs
index 637883eb2..74121dc2b 100644
--- a/TASVideos.Data/Entity/UserClaim.cs
+++ b/TASVideos.Data/Entity/UserClaim.cs
@@ -1,7 +1,9 @@
using Microsoft.AspNetCore.Identity;
+using Microsoft.EntityFrameworkCore;
namespace TASVideos.Data.Entity;
+[ExcludeFromHistory]
public class UserClaim : IdentityUserClaim
{
}
diff --git a/TASVideos.Data/Entity/UserDisallow.cs b/TASVideos.Data/Entity/UserDisallow.cs
index 4d68d03c4..0140e0d3f 100644
--- a/TASVideos.Data/Entity/UserDisallow.cs
+++ b/TASVideos.Data/Entity/UserDisallow.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity;
+
+[ExcludeFromHistory]
public class UserDisallow : BaseEntity
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/UserFile.cs b/TASVideos.Data/Entity/UserFile.cs
index daac07925..8cff9026c 100644
--- a/TASVideos.Data/Entity/UserFile.cs
+++ b/TASVideos.Data/Entity/UserFile.cs
@@ -1,4 +1,6 @@
-namespace TASVideos.Data.Entity;
+using Microsoft.EntityFrameworkCore;
+
+namespace TASVideos.Data.Entity;
public enum UserFileClass
{
@@ -15,6 +17,7 @@ public enum Compression
Gzip
}
+[ExcludeFromHistory]
public class UserFile
{
public long Id { get; set; }
diff --git a/TASVideos.Data/Entity/UserFileComment.cs b/TASVideos.Data/Entity/UserFileComment.cs
index cfd33e3b8..f4ed38830 100644
--- a/TASVideos.Data/Entity/UserFileComment.cs
+++ b/TASVideos.Data/Entity/UserFileComment.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity;
+
+[ExcludeFromHistory]
public class UserFileComment
{
[Key]
diff --git a/TASVideos.Data/Entity/UserLogin.cs b/TASVideos.Data/Entity/UserLogin.cs
index 5c093cfdf..cc7c760d9 100644
--- a/TASVideos.Data/Entity/UserLogin.cs
+++ b/TASVideos.Data/Entity/UserLogin.cs
@@ -1,7 +1,9 @@
using Microsoft.AspNetCore.Identity;
+using Microsoft.EntityFrameworkCore;
namespace TASVideos.Data.Entity;
+[ExcludeFromHistory]
public class UserLogin : IdentityUserLogin
{
}
diff --git a/TASVideos.Data/Entity/UserMaintenanceLog.cs b/TASVideos.Data/Entity/UserMaintenanceLog.cs
index 84f031f5b..e1389e8f1 100644
--- a/TASVideos.Data/Entity/UserMaintenanceLog.cs
+++ b/TASVideos.Data/Entity/UserMaintenanceLog.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity;
+
+[ExcludeFromHistory]
public class UserMaintenanceLog
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/UserRole.cs b/TASVideos.Data/Entity/UserRole.cs
index 4f622f05f..331e21e3a 100644
--- a/TASVideos.Data/Entity/UserRole.cs
+++ b/TASVideos.Data/Entity/UserRole.cs
@@ -1,7 +1,9 @@
using Microsoft.AspNetCore.Identity;
+using Microsoft.EntityFrameworkCore;
namespace TASVideos.Data.Entity;
+[ExcludeFromHistory]
public class UserRole : IdentityUserRole
{
public virtual User? User { get; set; }
diff --git a/TASVideos.Data/Entity/UserToken.cs b/TASVideos.Data/Entity/UserToken.cs
index f6aedcaa9..256f56e27 100644
--- a/TASVideos.Data/Entity/UserToken.cs
+++ b/TASVideos.Data/Entity/UserToken.cs
@@ -1,7 +1,9 @@
using Microsoft.AspNetCore.Identity;
+using Microsoft.EntityFrameworkCore;
namespace TASVideos.Data.Entity;
+[ExcludeFromHistory]
public class UserToken : IdentityUserToken
{
}
diff --git a/TASVideos.Data/Entity/WikiPage.cs b/TASVideos.Data/Entity/WikiPage.cs
index 861801398..77885445e 100644
--- a/TASVideos.Data/Entity/WikiPage.cs
+++ b/TASVideos.Data/Entity/WikiPage.cs
@@ -1,8 +1,10 @@
using System.Text.Json.Serialization;
+using Microsoft.EntityFrameworkCore;
using NpgsqlTypes;
namespace TASVideos.Data.Entity;
+[ExcludeFromHistory]
public class WikiPage : BaseEntity, ISoftDeletable
{
public int Id { get; set; }
diff --git a/TASVideos.Data/Entity/WikiPageReferral.cs b/TASVideos.Data/Entity/WikiPageReferral.cs
index 04e2739bf..3e4828bdb 100644
--- a/TASVideos.Data/Entity/WikiPageReferral.cs
+++ b/TASVideos.Data/Entity/WikiPageReferral.cs
@@ -1,5 +1,8 @@
-namespace TASVideos.Data.Entity;
+using Microsoft.EntityFrameworkCore;
+namespace TASVideos.Data.Entity;
+
+[ExcludeFromHistory]
public class WikiPageReferral
{
public int Id { get; set; }
diff --git a/TASVideos.Core/Extensions/ClaimsExtensions.cs b/TASVideos.Data/Extensions/ClaimsExtensions.cs
similarity index 92%
rename from TASVideos.Core/Extensions/ClaimsExtensions.cs
rename to TASVideos.Data/Extensions/ClaimsExtensions.cs
index e3c5f715f..dcd96b7f0 100644
--- a/TASVideos.Core/Extensions/ClaimsExtensions.cs
+++ b/TASVideos.Data/Extensions/ClaimsExtensions.cs
@@ -1,7 +1,7 @@
using System.Security.Claims;
using TASVideos.Data.Entity;
-namespace TASVideos.Core.Extensions;
+namespace TASVideos;
public static class ClaimsExtensions
{
diff --git a/TASVideos.Core/Extensions/ClaimsPrincipalExtensions.cs b/TASVideos.Data/Extensions/ClaimsPrincipalExtensions.cs
similarity index 97%
rename from TASVideos.Core/Extensions/ClaimsPrincipalExtensions.cs
rename to TASVideos.Data/Extensions/ClaimsPrincipalExtensions.cs
index 8fac700a3..3133f210d 100644
--- a/TASVideos.Core/Extensions/ClaimsPrincipalExtensions.cs
+++ b/TASVideos.Data/Extensions/ClaimsPrincipalExtensions.cs
@@ -1,5 +1,4 @@
using System.Security.Claims;
-using TASVideos.Core.Extensions;
using TASVideos.Data.Entity;
namespace TASVideos;
diff --git a/TASVideos.Data/Migrations/20220728191447_AddAutoHistory.Designer.cs b/TASVideos.Data/Migrations/20220728191447_AddAutoHistory.Designer.cs
new file mode 100644
index 000000000..6d51df591
--- /dev/null
+++ b/TASVideos.Data/Migrations/20220728191447_AddAutoHistory.Designer.cs
@@ -0,0 +1,3631 @@
+//
+using System;
+using System.ComponentModel.DataAnnotations.Schema;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+using NpgsqlTypes;
+using TASVideos.Data;
+
+#nullable disable
+
+namespace TASVideos.Data.Migrations
+{
+ [DbContext(typeof(ApplicationDbContext))]
+ [Migration("20220728191447_AddAutoHistory")]
+ partial class AddAutoHistory
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "6.0.6")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "citext");
+ NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "pg_trgm");
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("Microsoft.EntityFrameworkCore.AutoHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Changed")
+ .HasColumnType("citext")
+ .HasColumnName("changed");
+
+ b.Property("Created")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("created");
+
+ b.Property("Discriminator")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("discriminator");
+
+ b.Property("Kind")
+ .HasColumnType("integer")
+ .HasColumnName("kind");
+
+ b.Property("RowId")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("citext")
+ .HasColumnName("row_id");
+
+ b.Property("TableName")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("citext")
+ .HasColumnName("table_name");
+
+ b.HasKey("Id")
+ .HasName("pk_auto_history");
+
+ b.ToTable("auto_history", (string)null);
+
+ b.HasDiscriminator("Discriminator").HasValue("AutoHistory");
+ });
+
+ modelBuilder.Entity("TASVideos.Data.Entity.Awards.Award", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Description")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("citext")
+ .HasColumnName("description");
+
+ b.Property("ShortName")
+ .IsRequired()
+ .HasMaxLength(25)
+ .HasColumnType("citext")
+ .HasColumnName("short_name");
+
+ b.Property("Type")
+ .HasColumnType("integer")
+ .HasColumnName("type");
+
+ b.HasKey("Id")
+ .HasName("pk_awards");
+
+ b.ToTable("awards", (string)null);
+ });
+
+ modelBuilder.Entity("TASVideos.Data.Entity.Awards.PublicationAward", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("AwardId")
+ .HasColumnType("integer")
+ .HasColumnName("award_id");
+
+ b.Property("PublicationId")
+ .HasColumnType("integer")
+ .HasColumnName("publication_id");
+
+ b.Property("Year")
+ .HasColumnType("integer")
+ .HasColumnName("year");
+
+ b.HasKey("Id")
+ .HasName("pk_publication_awards");
+
+ b.HasIndex("AwardId")
+ .HasDatabaseName("ix_publication_awards_award_id");
+
+ b.HasIndex("PublicationId")
+ .HasDatabaseName("ix_publication_awards_publication_id");
+
+ b.ToTable("publication_awards", (string)null);
+ });
+
+ modelBuilder.Entity("TASVideos.Data.Entity.Awards.UserAward", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("AwardId")
+ .HasColumnType("integer")
+ .HasColumnName("award_id");
+
+ b.Property("UserId")
+ .HasColumnType("integer")
+ .HasColumnName("user_id");
+
+ b.Property("Year")
+ .HasColumnType("integer")
+ .HasColumnName("year");
+
+ b.HasKey("Id")
+ .HasName("pk_user_awards");
+
+ b.HasIndex("AwardId")
+ .HasDatabaseName("ix_user_awards_award_id");
+
+ b.HasIndex("UserId")
+ .HasDatabaseName("ix_user_awards_user_id");
+
+ b.ToTable("user_awards", (string)null);
+ });
+
+ modelBuilder.Entity("TASVideos.Data.Entity.DeprecatedMovieFormat", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("create_timestamp");
+
+ b.Property("CreateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("create_user_name");
+
+ b.Property("Deprecated")
+ .HasColumnType("boolean")
+ .HasColumnName("deprecated");
+
+ b.Property("FileExtension")
+ .IsRequired()
+ .HasColumnType("citext")
+ .HasColumnName("file_extension");
+
+ b.Property("LastUpdateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_update_timestamp");
+
+ b.Property("LastUpdateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("last_update_user_name");
+
+ b.HasKey("Id")
+ .HasName("pk_deprecated_movie_formats");
+
+ b.HasIndex("FileExtension")
+ .IsUnique()
+ .HasDatabaseName("ix_deprecated_movie_formats_file_extension");
+
+ b.ToTable("deprecated_movie_formats", (string)null);
+ });
+
+ modelBuilder.Entity("TASVideos.Data.Entity.Flag", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("create_timestamp");
+
+ b.Property("CreateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("create_user_name");
+
+ b.Property("IconPath")
+ .HasMaxLength(48)
+ .HasColumnType("citext")
+ .HasColumnName("icon_path");
+
+ b.Property("LastUpdateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_update_timestamp");
+
+ b.Property("LastUpdateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("last_update_user_name");
+
+ b.Property("LinkPath")
+ .HasMaxLength(48)
+ .HasColumnType("citext")
+ .HasColumnName("link_path");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(32)
+ .HasColumnType("citext")
+ .HasColumnName("name");
+
+ b.Property("PermissionRestriction")
+ .HasColumnType("integer")
+ .HasColumnName("permission_restriction");
+
+ b.Property("Token")
+ .IsRequired()
+ .HasMaxLength(24)
+ .HasColumnType("citext")
+ .HasColumnName("token");
+
+ b.HasKey("Id")
+ .HasName("pk_flags");
+
+ b.HasIndex("Token")
+ .IsUnique()
+ .HasDatabaseName("ix_flags_token");
+
+ b.ToTable("flags", (string)null);
+ });
+
+ modelBuilder.Entity("TASVideos.Data.Entity.Forum.Forum", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CategoryId")
+ .HasColumnType("integer")
+ .HasColumnName("category_id");
+
+ b.Property("CreateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("create_timestamp");
+
+ b.Property("CreateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("create_user_name");
+
+ b.Property("Description")
+ .HasMaxLength(1000)
+ .HasColumnType("citext")
+ .HasColumnName("description");
+
+ b.Property("LastUpdateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_update_timestamp");
+
+ b.Property("LastUpdateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("last_update_user_name");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("citext")
+ .HasColumnName("name");
+
+ b.Property("Ordinal")
+ .HasColumnType("integer")
+ .HasColumnName("ordinal");
+
+ b.Property("Restricted")
+ .HasColumnType("boolean")
+ .HasColumnName("restricted");
+
+ b.Property("ShortName")
+ .IsRequired()
+ .HasMaxLength(10)
+ .HasColumnType("citext")
+ .HasColumnName("short_name");
+
+ b.HasKey("Id")
+ .HasName("pk_forums");
+
+ b.HasIndex("CategoryId")
+ .HasDatabaseName("ix_forums_category_id");
+
+ b.ToTable("forums", (string)null);
+ });
+
+ modelBuilder.Entity("TASVideos.Data.Entity.Forum.ForumCategory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("create_timestamp");
+
+ b.Property("CreateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("create_user_name");
+
+ b.Property("Description")
+ .HasMaxLength(1000)
+ .HasColumnType("citext")
+ .HasColumnName("description");
+
+ b.Property("LastUpdateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_update_timestamp");
+
+ b.Property("LastUpdateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("last_update_user_name");
+
+ b.Property("Ordinal")
+ .HasColumnType("integer")
+ .HasColumnName("ordinal");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasMaxLength(30)
+ .HasColumnType("citext")
+ .HasColumnName("title");
+
+ b.HasKey("Id")
+ .HasName("pk_forum_categories");
+
+ b.ToTable("forum_categories", (string)null);
+ });
+
+ modelBuilder.Entity("TASVideos.Data.Entity.Forum.ForumPoll", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CloseDate")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("close_date");
+
+ b.Property("CreateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("create_timestamp");
+
+ b.Property("CreateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("create_user_name");
+
+ b.Property("LastUpdateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_update_timestamp");
+
+ b.Property("LastUpdateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("last_update_user_name");
+
+ b.Property("MultiSelect")
+ .HasColumnType("boolean")
+ .HasColumnName("multi_select");
+
+ b.Property("Question")
+ .IsRequired()
+ .HasMaxLength(500)
+ .HasColumnType("citext")
+ .HasColumnName("question");
+
+ b.Property("TopicId")
+ .HasColumnType("integer")
+ .HasColumnName("topic_id");
+
+ b.HasKey("Id")
+ .HasName("pk_forum_polls");
+
+ b.ToTable("forum_polls", (string)null);
+ });
+
+ modelBuilder.Entity("TASVideos.Data.Entity.Forum.ForumPollOption", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("create_timestamp");
+
+ b.Property("CreateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("create_user_name");
+
+ b.Property("LastUpdateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_update_timestamp");
+
+ b.Property("LastUpdateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("last_update_user_name");
+
+ b.Property("Ordinal")
+ .HasColumnType("integer")
+ .HasColumnName("ordinal");
+
+ b.Property("PollId")
+ .HasColumnType("integer")
+ .HasColumnName("poll_id");
+
+ b.Property("Text")
+ .IsRequired()
+ .HasMaxLength(250)
+ .HasColumnType("citext")
+ .HasColumnName("text");
+
+ b.HasKey("Id")
+ .HasName("pk_forum_poll_options");
+
+ b.HasIndex("PollId")
+ .HasDatabaseName("ix_forum_poll_options_poll_id");
+
+ b.ToTable("forum_poll_options", (string)null);
+ });
+
+ modelBuilder.Entity("TASVideos.Data.Entity.Forum.ForumPollOptionVote", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("create_timestamp");
+
+ b.Property("IpAddress")
+ .HasMaxLength(50)
+ .HasColumnType("citext")
+ .HasColumnName("ip_address");
+
+ b.Property("PollOptionId")
+ .HasColumnType("integer")
+ .HasColumnName("poll_option_id");
+
+ b.Property("UserId")
+ .HasColumnType("integer")
+ .HasColumnName("user_id");
+
+ b.HasKey("Id")
+ .HasName("pk_forum_poll_option_votes");
+
+ b.HasIndex("PollOptionId")
+ .HasDatabaseName("ix_forum_poll_option_votes_poll_option_id");
+
+ b.HasIndex("UserId")
+ .HasDatabaseName("ix_forum_poll_option_votes_user_id");
+
+ b.ToTable("forum_poll_option_votes", (string)null);
+ });
+
+ modelBuilder.Entity("TASVideos.Data.Entity.Forum.ForumPost", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("create_timestamp");
+
+ b.Property("CreateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("create_user_name");
+
+ b.Property("EnableBbCode")
+ .HasColumnType("boolean")
+ .HasColumnName("enable_bb_code");
+
+ b.Property("EnableHtml")
+ .HasColumnType("boolean")
+ .HasColumnName("enable_html");
+
+ b.Property("ForumId")
+ .HasColumnType("integer")
+ .HasColumnName("forum_id");
+
+ b.Property("IpAddress")
+ .HasMaxLength(50)
+ .HasColumnType("citext")
+ .HasColumnName("ip_address");
+
+ b.Property("LastUpdateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_update_timestamp");
+
+ b.Property("LastUpdateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("last_update_user_name");
+
+ b.Property("PosterId")
+ .HasColumnType("integer")
+ .HasColumnName("poster_id");
+
+ b.Property("PosterMood")
+ .HasColumnType("integer")
+ .HasColumnName("poster_mood");
+
+ b.Property("SearchVector")
+ .IsRequired()
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("tsvector")
+ .HasColumnName("search_vector")
+ .HasAnnotation("Npgsql:TsVectorConfig", "english")
+ .HasAnnotation("Npgsql:TsVectorProperties", new[] { "Text" });
+
+ b.Property("Subject")
+ .HasMaxLength(500)
+ .HasColumnType("citext")
+ .HasColumnName("subject");
+
+ b.Property("Text")
+ .IsRequired()
+ .HasColumnType("citext")
+ .HasColumnName("text");
+
+ b.Property("TopicId")
+ .HasColumnType("integer")
+ .HasColumnName("topic_id");
+
+ b.HasKey("Id")
+ .HasName("pk_forum_posts");
+
+ b.HasIndex("ForumId")
+ .HasDatabaseName("ix_forum_posts_forum_id");
+
+ b.HasIndex("PosterId")
+ .HasDatabaseName("ix_forum_posts_poster_id");
+
+ b.HasIndex("SearchVector")
+ .HasDatabaseName("ix_forum_posts_search_vector");
+
+ NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex("SearchVector"), "GIN");
+
+ b.HasIndex("Text")
+ .HasDatabaseName("ix_forum_posts_text");
+
+ NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex("Text"), "gin");
+ NpgsqlIndexBuilderExtensions.HasOperators(b.HasIndex("Text"), new[] { "gin_trgm_ops" });
+
+ b.HasIndex("TopicId")
+ .HasDatabaseName("ix_forum_posts_topic_id");
+
+ b.ToTable("forum_posts", (string)null);
+ });
+
+ modelBuilder.Entity("TASVideos.Data.Entity.Forum.ForumTopic", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("create_timestamp");
+
+ b.Property("CreateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("create_user_name");
+
+ b.Property("ForumId")
+ .HasColumnType("integer")
+ .HasColumnName("forum_id");
+
+ b.Property("IsLocked")
+ .HasColumnType("boolean")
+ .HasColumnName("is_locked");
+
+ b.Property("LastUpdateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_update_timestamp");
+
+ b.Property("LastUpdateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("last_update_user_name");
+
+ b.Property("PollId")
+ .HasColumnType("integer")
+ .HasColumnName("poll_id");
+
+ b.Property("PosterId")
+ .HasColumnType("integer")
+ .HasColumnName("poster_id");
+
+ b.Property("SubmissionId")
+ .HasColumnType("integer")
+ .HasColumnName("submission_id");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasMaxLength(500)
+ .HasColumnType("citext")
+ .HasColumnName("title");
+
+ b.Property("Type")
+ .HasColumnType("integer")
+ .HasColumnName("type");
+
+ b.HasKey("Id")
+ .HasName("pk_forum_topics");
+
+ b.HasIndex("ForumId")
+ .HasDatabaseName("ix_forum_topics_forum_id");
+
+ b.HasIndex("PollId")
+ .IsUnique()
+ .HasDatabaseName("ix_forum_topics_poll_id");
+
+ b.HasIndex("PosterId")
+ .HasDatabaseName("ix_forum_topics_poster_id");
+
+ b.HasIndex("SubmissionId")
+ .IsUnique()
+ .HasDatabaseName("ix_forum_topics_submission_id");
+
+ b.ToTable("forum_topics", (string)null);
+ });
+
+ modelBuilder.Entity("TASVideos.Data.Entity.Forum.ForumTopicWatch", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("integer")
+ .HasColumnName("user_id");
+
+ b.Property("ForumTopicId")
+ .HasColumnType("integer")
+ .HasColumnName("forum_topic_id");
+
+ b.Property("IsNotified")
+ .HasColumnType("boolean")
+ .HasColumnName("is_notified");
+
+ b.HasKey("UserId", "ForumTopicId")
+ .HasName("pk_forum_topic_watches");
+
+ b.HasIndex("ForumTopicId")
+ .HasDatabaseName("ix_forum_topic_watches_forum_topic_id");
+
+ b.ToTable("forum_topic_watches", (string)null);
+ });
+
+ modelBuilder.Entity("TASVideos.Data.Entity.Game.Game", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Abbreviation")
+ .HasMaxLength(24)
+ .HasColumnType("citext")
+ .HasColumnName("abbreviation");
+
+ b.Property("Aliases")
+ .HasMaxLength(250)
+ .HasColumnType("citext")
+ .HasColumnName("aliases");
+
+ b.Property("CreateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("create_timestamp");
+
+ b.Property("CreateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("create_user_name");
+
+ b.Property("DisplayName")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("citext")
+ .HasColumnName("display_name");
+
+ b.Property("GameResourcesPage")
+ .HasMaxLength(300)
+ .HasColumnType("citext")
+ .HasColumnName("game_resources_page");
+
+ b.Property("LastUpdateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_update_timestamp");
+
+ b.Property("LastUpdateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("last_update_user_name");
+
+ b.Property("ScreenshotUrl")
+ .HasMaxLength(250)
+ .HasColumnType("citext")
+ .HasColumnName("screenshot_url");
+
+ b.HasKey("Id")
+ .HasName("pk_games");
+
+ b.HasIndex("Abbreviation")
+ .IsUnique()
+ .HasDatabaseName("ix_games_abbreviation");
+
+ b.ToTable("games", (string)null);
+ });
+
+ modelBuilder.Entity("TASVideos.Data.Entity.Game.GameGameGroup", b =>
+ {
+ b.Property("GameId")
+ .HasColumnType("integer")
+ .HasColumnName("game_id");
+
+ b.Property("GameGroupId")
+ .HasColumnType("integer")
+ .HasColumnName("game_group_id");
+
+ b.HasKey("GameId", "GameGroupId")
+ .HasName("pk_game_game_groups");
+
+ b.HasIndex("GameGroupId")
+ .HasDatabaseName("ix_game_game_groups_game_group_id");
+
+ b.HasIndex("GameId")
+ .HasDatabaseName("ix_game_game_groups_game_id");
+
+ b.ToTable("game_game_groups", (string)null);
+ });
+
+ modelBuilder.Entity("TASVideos.Data.Entity.Game.GameGenre", b =>
+ {
+ b.Property("GameId")
+ .HasColumnType("integer")
+ .HasColumnName("game_id");
+
+ b.Property("GenreId")
+ .HasColumnType("integer")
+ .HasColumnName("genre_id");
+
+ b.HasKey("GameId", "GenreId")
+ .HasName("pk_game_genres");
+
+ b.HasIndex("GameId")
+ .HasDatabaseName("ix_game_genres_game_id");
+
+ b.HasIndex("GenreId")
+ .HasDatabaseName("ix_game_genres_genre_id");
+
+ b.ToTable("game_genres", (string)null);
+ });
+
+ modelBuilder.Entity("TASVideos.Data.Entity.Game.GameGroup", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Description")
+ .HasMaxLength(2000)
+ .HasColumnType("citext")
+ .HasColumnName("description");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("citext")
+ .HasColumnName("name");
+
+ b.Property("SearchKey")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("citext")
+ .HasColumnName("search_key");
+
+ b.HasKey("Id")
+ .HasName("pk_game_groups");
+
+ b.HasIndex("Name")
+ .IsUnique()
+ .HasDatabaseName("ix_game_groups_name");
+
+ b.ToTable("game_groups", (string)null);
+ });
+
+ modelBuilder.Entity("TASVideos.Data.Entity.Game.GameSystem", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("integer")
+ .HasColumnName("id")
+ .HasAnnotation("DatabaseGenerated", DatabaseGeneratedOption.None);
+
+ b.Property("Code")
+ .IsRequired()
+ .HasMaxLength(8)
+ .HasColumnType("citext")
+ .HasColumnName("code");
+
+ b.Property("CreateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("create_timestamp");
+
+ b.Property("CreateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("create_user_name");
+
+ b.Property("DisplayName")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("citext")
+ .HasColumnName("display_name");
+
+ b.Property("LastUpdateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_update_timestamp");
+
+ b.Property("LastUpdateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("last_update_user_name");
+
+ b.HasKey("Id")
+ .HasName("pk_game_systems");
+
+ b.HasIndex("Code")
+ .IsUnique()
+ .HasDatabaseName("ix_game_systems_code");
+
+ b.ToTable("game_systems", (string)null);
+ });
+
+ modelBuilder.Entity("TASVideos.Data.Entity.Game.GameSystemFrameRate", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("create_timestamp");
+
+ b.Property("CreateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("create_user_name");
+
+ b.Property("FrameRate")
+ .HasColumnType("double precision")
+ .HasColumnName("frame_rate");
+
+ b.Property("GameSystemId")
+ .HasColumnType("integer")
+ .HasColumnName("game_system_id");
+
+ b.Property("LastUpdateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_update_timestamp");
+
+ b.Property("LastUpdateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("last_update_user_name");
+
+ b.Property("Obsolete")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("boolean")
+ .HasDefaultValue(false)
+ .HasColumnName("obsolete");
+
+ b.Property("Preliminary")
+ .HasColumnType("boolean")
+ .HasColumnName("preliminary");
+
+ b.Property("RegionCode")
+ .IsRequired()
+ .HasMaxLength(8)
+ .HasColumnType("citext")
+ .HasColumnName("region_code");
+
+ b.HasKey("Id")
+ .HasName("pk_game_system_frame_rates");
+
+ b.HasIndex("GameSystemId")
+ .HasDatabaseName("ix_game_system_frame_rates_game_system_id");
+
+ b.ToTable("game_system_frame_rates", (string)null);
+ });
+
+ modelBuilder.Entity("TASVideos.Data.Entity.Game.GameVersion", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("create_timestamp");
+
+ b.Property("CreateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("create_user_name");
+
+ b.Property("GameId")
+ .HasColumnType("integer")
+ .HasColumnName("game_id");
+
+ b.Property("LastUpdateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_update_timestamp");
+
+ b.Property("LastUpdateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("last_update_user_name");
+
+ b.Property("Md5")
+ .HasMaxLength(32)
+ .HasColumnType("citext")
+ .HasColumnName("md5");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("citext")
+ .HasColumnName("name");
+
+ b.Property("Region")
+ .HasMaxLength(50)
+ .HasColumnType("citext")
+ .HasColumnName("region");
+
+ b.Property("Sha1")
+ .HasMaxLength(40)
+ .HasColumnType("citext")
+ .HasColumnName("sha1");
+
+ b.Property("SystemId")
+ .HasColumnType("integer")
+ .HasColumnName("system_id");
+
+ b.Property("TitleOverride")
+ .HasMaxLength(255)
+ .HasColumnType("citext")
+ .HasColumnName("title_override");
+
+ b.Property("Type")
+ .HasColumnType("integer")
+ .HasColumnName("type");
+
+ b.Property("Version")
+ .HasMaxLength(50)
+ .HasColumnType("citext")
+ .HasColumnName("version");
+
+ b.HasKey("Id")
+ .HasName("pk_game_versions");
+
+ b.HasIndex("GameId")
+ .HasDatabaseName("ix_game_versions_game_id");
+
+ b.HasIndex("SystemId")
+ .HasDatabaseName("ix_game_versions_system_id");
+
+ b.ToTable("game_versions", (string)null);
+ });
+
+ modelBuilder.Entity("TASVideos.Data.Entity.Game.Genre", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("DisplayName")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("citext")
+ .HasColumnName("display_name");
+
+ b.HasKey("Id")
+ .HasName("pk_genres");
+
+ b.ToTable("genres", (string)null);
+ });
+
+ modelBuilder.Entity("TASVideos.Data.Entity.IpBan", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("create_timestamp");
+
+ b.Property("CreateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("create_user_name");
+
+ b.Property("LastUpdateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_update_timestamp");
+
+ b.Property("LastUpdateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("last_update_user_name");
+
+ b.Property("Mask")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("citext")
+ .HasColumnName("mask");
+
+ b.HasKey("Id")
+ .HasName("pk_ip_bans");
+
+ b.HasIndex("Mask")
+ .IsUnique()
+ .HasDatabaseName("ix_ip_bans_mask");
+
+ b.ToTable("ip_bans", (string)null);
+ });
+
+ modelBuilder.Entity("TASVideos.Data.Entity.MediaPost", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Body")
+ .IsRequired()
+ .HasMaxLength(1024)
+ .HasColumnType("citext")
+ .HasColumnName("body");
+
+ b.Property("CreateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("create_timestamp");
+
+ b.Property("CreateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("create_user_name");
+
+ b.Property("Group")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("citext")
+ .HasColumnName("group");
+
+ b.Property("LastUpdateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_update_timestamp");
+
+ b.Property("LastUpdateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("last_update_user_name");
+
+ b.Property("Link")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("citext")
+ .HasColumnName("link");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasMaxLength(512)
+ .HasColumnType("citext")
+ .HasColumnName("title");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("citext")
+ .HasColumnName("type");
+
+ b.Property("User")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("citext")
+ .HasColumnName("user");
+
+ b.HasKey("Id")
+ .HasName("pk_media_posts");
+
+ b.ToTable("media_posts", (string)null);
+ });
+
+ modelBuilder.Entity("TASVideos.Data.Entity.PrivateMessage", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("create_timestamp");
+
+ b.Property("CreateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("create_user_name");
+
+ b.Property("DeletedForFromUser")
+ .HasColumnType("boolean")
+ .HasColumnName("deleted_for_from_user");
+
+ b.Property("DeletedForToUser")
+ .HasColumnType("boolean")
+ .HasColumnName("deleted_for_to_user");
+
+ b.Property("EnableBbCode")
+ .HasColumnType("boolean")
+ .HasColumnName("enable_bb_code");
+
+ b.Property("EnableHtml")
+ .HasColumnType("boolean")
+ .HasColumnName("enable_html");
+
+ b.Property("FromUserId")
+ .HasColumnType("integer")
+ .HasColumnName("from_user_id");
+
+ b.Property("IpAddress")
+ .HasMaxLength(50)
+ .HasColumnType("citext")
+ .HasColumnName("ip_address");
+
+ b.Property("LastUpdateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_update_timestamp");
+
+ b.Property("LastUpdateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("last_update_user_name");
+
+ b.Property("ReadOn")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("read_on");
+
+ b.Property("SavedForFromUser")
+ .HasColumnType("boolean")
+ .HasColumnName("saved_for_from_user");
+
+ b.Property("SavedForToUser")
+ .HasColumnType("boolean")
+ .HasColumnName("saved_for_to_user");
+
+ b.Property("Subject")
+ .HasMaxLength(500)
+ .HasColumnType("citext")
+ .HasColumnName("subject");
+
+ b.Property("Text")
+ .IsRequired()
+ .HasColumnType("citext")
+ .HasColumnName("text");
+
+ b.Property("ToUserId")
+ .HasColumnType("integer")
+ .HasColumnName("to_user_id");
+
+ b.HasKey("Id")
+ .HasName("pk_private_messages");
+
+ b.HasIndex("FromUserId")
+ .HasDatabaseName("ix_private_messages_from_user_id");
+
+ b.HasIndex("ToUserId", "ReadOn", "DeletedForToUser")
+ .HasDatabaseName("ix_private_messages_to_user_id_read_on_deleted_for_to_user");
+
+ b.ToTable("private_messages", (string)null);
+ });
+
+ modelBuilder.Entity("TASVideos.Data.Entity.Publication", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("AdditionalAuthors")
+ .HasMaxLength(200)
+ .HasColumnType("citext")
+ .HasColumnName("additional_authors");
+
+ b.Property("Branch")
+ .HasMaxLength(50)
+ .HasColumnType("citext")
+ .HasColumnName("branch");
+
+ b.Property("CreateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("create_timestamp");
+
+ b.Property("CreateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("create_user_name");
+
+ b.Property("EmulatorVersion")
+ .HasMaxLength(50)
+ .HasColumnType("citext")
+ .HasColumnName("emulator_version");
+
+ b.Property("Frames")
+ .HasColumnType("integer")
+ .HasColumnName("frames");
+
+ b.Property("GameId")
+ .HasColumnType("integer")
+ .HasColumnName("game_id");
+
+ b.Property("GameVersionId")
+ .HasColumnType("integer")
+ .HasColumnName("game_version_id");
+
+ b.Property("LastUpdateTimestamp")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_update_timestamp");
+
+ b.Property("LastUpdateUserName")
+ .HasColumnType("citext")
+ .HasColumnName("last_update_user_name");
+
+ b.Property("MovieFile")
+ .IsRequired()
+ .HasColumnType("bytea")
+ .HasColumnName("movie_file");
+
+ b.Property("MovieFileName")
+ .IsRequired()
+ .HasColumnType("citext")
+ .HasColumnName("movie_file_name");
+
+ b.Property("ObsoletedById")
+ .HasColumnType("integer")
+ .HasColumnName("obsoleted_by_id");
+
+ b.Property("PublicationClassId")
+ .HasColumnType("integer")
+ .HasColumnName("publication_class_id");
+
+ b.Property("RerecordCount")
+ .HasColumnType("integer")
+ .HasColumnName("rerecord_count");
+
+ b.Property("SubmissionId")
+ .HasColumnType("integer")
+ .HasColumnName("submission_id");
+
+ b.Property("SystemFrameRateId")
+ .HasColumnType("integer")
+ .HasColumnName("system_frame_rate_id");
+
+ b.Property("SystemId")
+ .HasColumnType("integer")
+ .HasColumnName("system_id");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasColumnType("citext")
+ .HasColumnName("title");
+
+ b.Property("WikiContentId")
+ .HasColumnType("integer")
+ .HasColumnName("wiki_content_id");
+
+ b.HasKey("Id")
+ .HasName("pk_publications");
+
+ b.HasIndex("GameId")
+ .HasDatabaseName("ix_publications_game_id");
+
+ b.HasIndex("GameVersionId")
+ .HasDatabaseName("ix_publications_game_version_id");
+
+ b.HasIndex("ObsoletedById")
+ .HasDatabaseName("ix_publications_obsoleted_by_id");
+
+ b.HasIndex("PublicationClassId")
+ .HasDatabaseName("ix_publications_publication_class_id");
+
+ b.HasIndex("SubmissionId")
+ .IsUnique()
+ .HasDatabaseName("ix_publications_submission_id");
+
+ b.HasIndex("SystemFrameRateId")
+ .HasDatabaseName("ix_publications_system_frame_rate_id");
+
+ b.HasIndex("SystemId")
+ .HasDatabaseName("ix_publications_system_id");
+
+ b.HasIndex("WikiContentId")
+ .HasDatabaseName("ix_publications_wiki_content_id");
+
+ b.ToTable("publications", (string)null);
+ });
+
+ modelBuilder.Entity("TASVideos.Data.Entity.PublicationAuthor", b =>
+ {
+ b.Property