Changes on Database for Rolebased Users also started with Login Cookies.
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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>();
|
||||
|
||||
|
||||
@@ -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>();
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,7 @@ namespace WatchLog.Data
|
||||
|
||||
// --- Navigation Properties ---
|
||||
[ForeignKey(nameof(CreatorId))]
|
||||
public virtual User User { get; set; } = null!;
|
||||
public virtual AppUser User { get; set; } = null!;
|
||||
|
||||
public virtual ICollection<LinkTablePrivateLabel> LinkTablePrivateLabels { get; set; } = new List<LinkTablePrivateLabel>();
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace WatchLog.Data
|
||||
|
||||
// --- Navigation Properties ---
|
||||
[ForeignKey(nameof(UserId))]
|
||||
public virtual User User { get; set; } = null!;
|
||||
public virtual AppUser User { get; set; } = null!;
|
||||
|
||||
[ForeignKey(nameof(GlobalEntityId))]
|
||||
public virtual GlobalEntity GlobalEntity { get; set; } = null!;
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace WatchLog.Data
|
||||
|
||||
// --- Navigation Properties ---
|
||||
[ForeignKey(nameof(UserId))]
|
||||
public virtual User User { get; set; } = null!;
|
||||
public virtual AppUser User { get; set; } = null!;
|
||||
|
||||
public virtual ICollection<PrivateEntity> PrivateEntities { get; set; } = new List<PrivateEntity>();
|
||||
}
|
||||
|
||||
@@ -16,6 +16,6 @@ namespace WatchLog.Data
|
||||
public virtual SharedList SharedList { get; set; } = null!;
|
||||
|
||||
[ForeignKey(nameof(UserId))]
|
||||
public virtual User User { get; set; } = null!;
|
||||
public virtual AppUser User { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
@@ -19,13 +19,12 @@ namespace WatchLog.Data
|
||||
//Note: Link Tables a commented out because Entity Framework creates the tables by itself
|
||||
|
||||
// Global
|
||||
public DbSet<Admin> Admins { get; set; }
|
||||
public DbSet<Genre> Genres { get; set; }
|
||||
public DbSet<GlobalEntity> GlobalEntities { get; set; }
|
||||
//public DbSet<LinkTableGlobalGenre> LinkTableGlobalGenres { get; set; }
|
||||
public DbSet<StreamingPlatform> StreamingPlatforms { get; set; }
|
||||
public DbSet<Type> Types { get; set; } // 'Watchlog.Data.Type' if namecolsion with System.Type
|
||||
public DbSet<User> Users { get; set; }
|
||||
public DbSet<AppUser> AppUsers { get; set; }
|
||||
|
||||
//Private
|
||||
public DbSet<Label> Labels { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user