Changes on Database for Rolebased Users also started with Login Cookies.

This commit is contained in:
2025-07-05 00:15:51 +02:00
parent c385ee0628
commit 1152bc4f7e
11 changed files with 575 additions and 250 deletions

View File

@@ -1,17 +0,0 @@
using System.ComponentModel.DataAnnotations;
namespace WatchLog.Data
{
public class Admin
{
[Key]
public int Id { get; set; }
[Required]
[MaxLength(100)]
public required string Name { get; set; }
[Required]
public required string PasswordHash { get; set; } // Important: Save as HASH
}
}

View File

@@ -34,7 +34,7 @@ namespace WatchLog.Data
public virtual Type Type { get; set; } = null!;
[ForeignKey(nameof(CreatorId))]
public virtual User User { get; set; } = null!;
public virtual AppUser User { get; set; } = null!;
public virtual ICollection<LinkTableGlobalGenre> LinkTableGlobalGenres { get; set; } = new List<LinkTableGlobalGenre>();

View File

@@ -1,32 +0,0 @@
using System.ComponentModel.DataAnnotations;
namespace WatchLog.Data
{
public class User
{
[Key]
public int Id { get; set; }
[Required]
[MaxLength(100)]
public required string Name { get; set; }
[MaxLength(255)]
public string? Email { get; set; }
[Required]
public required string PasswordHash { get; set; } // Important: Save as HASH
// --- Navigation Properties ---
public virtual ICollection<PrivateEntity> PrivateEntities { get; set; } = new List<PrivateEntity>();
public virtual ICollection<GlobalEntity> GlobalEntities { get; set; } = new List<GlobalEntity>();
public virtual ICollection<Label> Labels { get; set; } = new List<Label>();
public virtual ICollection<UserWatchStatus> UserWatchStatuses { get; set; } = new List<UserWatchStatus>();
public virtual ICollection<LinkTableSharedUser> LinkTableSharedUsers { get; set; } = new List<LinkTableSharedUser>();
}
}