Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove StringLength attributes from Entities #2046

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions TASVideos.Data/Entity/Awards/Award.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ public class Award
public int Id { get; set; }
public AwardType Type { get; set; }

[StringLength(25)]
public string ShortName { get; set; } = "";

[StringLength(50)]
public string Description { get; set; } = "";
}
1 change: 0 additions & 1 deletion TASVideos.Data/Entity/DeprecatedMovieFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ public class DeprecatedMovieFormat : BaseEntity
{
public int Id { get; set; }

[StringLength(8)]
public string FileExtension { get; set; } = "";

public bool Deprecated { get; set; } = true;
Expand Down
4 changes: 0 additions & 4 deletions TASVideos.Data/Entity/Flag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@ public class Flag
{
public int Id { get; set; }

[StringLength(32)]
public string Name { get; set; } = "";

[StringLength(48)]
public string? IconPath { get; set; }

[StringLength(48)]
public string? LinkPath { get; set; }

[StringLength(24)]
public string Token { get; set; } = "";

public PermissionTo? PermissionRestriction { get; set; }
Expand Down
3 changes: 0 additions & 3 deletions TASVideos.Data/Entity/Forum/Forum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,10 @@ public class Forum : BaseEntity
public ICollection<ForumTopic> ForumTopics { get; init; } = [];
public ICollection<ForumPost> ForumPosts { get; init; } = [];

[StringLength(50)]
public string Name { get; set; } = "";

[StringLength(10)]
public string ShortName { get; set; } = "";

[StringLength(1000)]
public string? Description { get; set; }

public int Ordinal { get; set; }
Expand Down
2 changes: 0 additions & 2 deletions TASVideos.Data/Entity/Forum/ForumCategory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ public class ForumCategory : BaseEntity
public int Id { get; set; }
public ICollection<Forum> Forums { get; init; } = [];

[StringLength(30)]
public string Title { get; set; } = "";

public int Ordinal { get; set; }

[StringLength(1000)]
public string? Description { get; set; }
}
1 change: 0 additions & 1 deletion TASVideos.Data/Entity/Forum/ForumPoll.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ public class ForumPoll : BaseEntity
public int TopicId { get; set; }
public ForumTopic? Topic { get; set; }

[StringLength(500)]
public string Question { get; set; } = "";

public DateTime? CloseDate { get; set; }
Expand Down
1 change: 0 additions & 1 deletion TASVideos.Data/Entity/Forum/ForumPollOption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ public class ForumPollOption : BaseEntity
{
public int Id { get; set; }

[StringLength(250)]
public string Text { get; set; } = "";

public int Ordinal { get; set; }
Expand Down
1 change: 0 additions & 1 deletion TASVideos.Data/Entity/Forum/ForumPollOptionVote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ public class ForumPollOptionVote

public DateTime CreateTimestamp { get; set; }

[StringLength(50)]
public string? IpAddress { get; set; }
}
2 changes: 0 additions & 2 deletions TASVideos.Data/Entity/Forum/ForumPost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ public class ForumPost : BaseEntity
public int PosterId { get; set; }
public User? Poster { get; set; }

[StringLength(50)]
public string? IpAddress { get; set; }

[StringLength(150)]
public string? Subject { get; set; }

public string Text { get; set; } = "";
Expand Down
1 change: 0 additions & 1 deletion TASVideos.Data/Entity/Forum/ForumTopic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public class ForumTopic : BaseEntity
public ICollection<ForumPost> ForumPosts { get; init; } = [];
public ICollection<ForumTopicWatch> ForumTopicWatches { get; init; } = [];

[StringLength(500)]
public string Title { get; set; } = "";

public int PosterId { get; set; }
Expand Down
5 changes: 0 additions & 5 deletions TASVideos.Data/Entity/Game/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,14 @@ public class Game : BaseEntity
public ICollection<GameGameGroup> GameGroups { get; init; } = [];
public ICollection<GameGoal> GameGoals { get; init; } = [];

[StringLength(100)]
public string DisplayName { get; set; } = "";

[StringLength(24)]
public string? Abbreviation { get; set; }

[StringLength(250)]
public string? Aliases { get; set; }

[StringLength(250)]
public string? ScreenshotUrl { get; set; }

[StringLength(300)]
public string? GameResourcesPage { get; set; }
}

Expand Down
1 change: 0 additions & 1 deletion TASVideos.Data/Entity/Game/GameGoal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ public class GameGoal
public int GameId { get; set; }
public Game? Game { get; set; }

[StringLength(50)]
public string DisplayName { get; set; } = "";

public ICollection<Publication> Publications { get; init; } = [];
Expand Down
3 changes: 0 additions & 3 deletions TASVideos.Data/Entity/Game/GameGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@ public class GameGroup
{
public int Id { get; set; }

[StringLength(255)]
public string Name { get; set; } = "";

[StringLength(255)]
public string? Abbreviation { get; set; }

[StringLength(2000)]
public string? Description { get; set; }

public ICollection<GameGameGroup> Games { get; init; } = [];
Expand Down
2 changes: 0 additions & 2 deletions TASVideos.Data/Entity/Game/GameSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ public class GameSystem : BaseEntity
public ICollection<Publication> Publications { get; init; } = [];
public ICollection<Submission> Submissions { get; init; } = [];

[StringLength(8)]
public string Code { get; set; } = "";

[StringLength(100)]
public string DisplayName { get; set; } = "";
}

Expand Down
1 change: 0 additions & 1 deletion TASVideos.Data/Entity/Game/GameSystemFrameRate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ public class GameSystemFrameRate : BaseEntity

public double FrameRate { get; set; }

[StringLength(8)]
public string RegionCode { get; set; } = "";
public bool Preliminary { get; set; }

Expand Down
8 changes: 0 additions & 8 deletions TASVideos.Data/Entity/Game/GameVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,22 @@ public class GameVersion : BaseEntity
public ICollection<Publication> Publications { get; init; } = [];
public ICollection<Submission> Submissions { get; init; } = [];

[StringLength(32)]
public string? Md5 { get; set; }

[StringLength(40)]
public string? Sha1 { get; set; }

[StringLength(255)]
public string Name { get; set; } = "";

public VersionTypes Type { get; set; }

[StringLength(50)]
public string? Region { get; set; }

[StringLength(50)]
public string? Version { get; set; }

[StringLength(255)]
public string? TitleOverride { get; set; }

[StringLength(50)]
public string? SourceDb { get; set; }

[StringLength(2000)]
public string? Notes { get; set; }
}

Expand Down
1 change: 0 additions & 1 deletion TASVideos.Data/Entity/Game/Genre.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ public class Genre
{
public int Id { get; set; }

[StringLength(20)]
public string DisplayName { get; set; } = "";

public ICollection<GameGenre> GameGenres { get; init; } = [];
Expand Down
1 change: 0 additions & 1 deletion TASVideos.Data/Entity/IpBan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ public class IpBan : BaseEntity
{
public int Id { get; set; }

[StringLength(40)]
public string Mask { get; set; } = "";
}
6 changes: 0 additions & 6 deletions TASVideos.Data/Entity/MediaPosts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,15 @@ public class MediaPost : BaseEntity
{
public int Id { get; set; }

[StringLength(512)]
public string Title { get; set; } = "";

[StringLength(255)]
public string Link { get; set; } = "";

[StringLength(1024)]
public string Body { get; set; } = "";

[StringLength(255)]
public string Group { get; set; } = "";

[StringLength(100)]
public string Type { get; set; } = "";

[StringLength(100)]
public string User { get; set; } = "";
}
2 changes: 0 additions & 2 deletions TASVideos.Data/Entity/PrivateMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ public class PrivateMessage : BaseEntity
public int ToUserId { get; set; }
public User? ToUser { get; set; }

[StringLength(500)]
public string? Subject { get; set; }

[StringLength(10000)]
public string Text { get; set; } = "";

public bool EnableHtml { get; set; }
Expand Down
4 changes: 0 additions & 4 deletions TASVideos.Data/Entity/Publication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@ public class Publication : BaseEntity, ITimeable

public byte[] MovieFile { get; set; } = [];

[StringLength(200)]
public string MovieFileName { get; set; } = "";

[StringLength(50)]
public string? EmulatorVersion { get; set; }

public int Frames { get; set; }
Expand All @@ -74,11 +72,9 @@ public class Publication : BaseEntity, ITimeable
/// <summary>
/// Gets or sets Any author's that are not a user. If they are a user, they should be linked, and not listed here.
/// </summary>
[StringLength(200)]
public string? AdditionalAuthors { get; set; }

// De-normalized name for easy recreation
[StringLength(500)]
public string Title { get; set; } = "";

double ITimeable.FrameRate => SystemFrameRate?.FrameRate ?? throw new InvalidOperationException($"{nameof(SystemFrameRate)} must not be lazy loaded!");
Expand Down
3 changes: 0 additions & 3 deletions TASVideos.Data/Entity/PublicationClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@ public class PublicationClass
{
public int Id { get; set; }

[StringLength(20)]
public string Name { get; set; } = "";

[StringLength(100)]
public string? IconPath { get; set; }

[StringLength(100)]
public string Link { get; set; } = "";
}
2 changes: 0 additions & 2 deletions TASVideos.Data/Entity/PublicationFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ public class PublicationFile : BaseEntity
public int PublicationId { get; set; }
public Publication? Publication { get; set; }

[StringLength(250)]
public string Path { get; set; } = "";
public FileType Type { get; set; }

[StringLength(250)]
public string? Description { get; set; }

public byte[]? FileData { get; set; }
Expand Down
2 changes: 0 additions & 2 deletions TASVideos.Data/Entity/PublicationMaintenanceLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ public class PublicationMaintenanceLog

public DateTime TimeStamp { get; set; }

[StringLength(1024)]

public string Log { get; set; } = "";

public int PublicationId { get; set; }
Expand Down
2 changes: 0 additions & 2 deletions TASVideos.Data/Entity/PublicationUrl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ public class PublicationUrl : BaseEntity
public Publication? Publication { get; set; }

[Required]
[StringLength(500)]
public string? Url { get; set; }

public PublicationUrlType Type { get; set; } = PublicationUrlType.Streaming;

[StringLength(100)]
public string? DisplayName { get; set; }
}

Expand Down
2 changes: 0 additions & 2 deletions TASVideos.Data/Entity/Role.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ namespace TASVideos.Data.Entity;

public class Role : IdentityRole<int>, ITrackable
{
[StringLength(50)]
public new string Name
{
get => base.Name!;
Expand All @@ -16,7 +15,6 @@ public class Role : IdentityRole<int>, ITrackable
/// </summary>
public bool IsDefault { get; set; }

[StringLength(300)]
public string Description { get; set; } = "";

/// <summary>
Expand Down
1 change: 0 additions & 1 deletion TASVideos.Data/Entity/RoleLinks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ public class RoleLink
{
public int Id { get; set; }

[StringLength(300)]
public string Link { get; set; } = "";

public int RoleId { get; set; }
Expand Down
Loading