fixes small bug in database logic wich blocked creating the database
This commit is contained in:
@@ -4,18 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace WatchLog.Data
|
||||
{
|
||||
[PrimaryKey(nameof(SharedListId), nameof(GlobalEntityId))]
|
||||
public class SharedListEntity
|
||||
{
|
||||
// --- Foreign Keys ---
|
||||
public int SharedListId { get; set; }
|
||||
public int GlobalEntityId { get; set; }
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
// --- Weiterer Foreign Key ---
|
||||
public int? SharedWatchStatusId { get; set; }
|
||||
|
||||
|
||||
// --- Datenfelder für den Listeneintrag ---
|
||||
public bool Favorite { get; set; } = false;
|
||||
|
||||
[MaxLength(1000)]
|
||||
@@ -31,6 +24,14 @@ namespace WatchLog.Data
|
||||
public DateTime? LastChange { get; set; }
|
||||
|
||||
|
||||
// --- Foreign Keys ---
|
||||
public int SharedListId { get; set; }
|
||||
|
||||
public int GlobalEntityId { get; set; }
|
||||
|
||||
public int? SharedWatchStatusId { get; set; }
|
||||
|
||||
|
||||
// --- Navigation Properties ---
|
||||
[ForeignKey(nameof(SharedListId))]
|
||||
public virtual SharedList SharedList { get; set; } = null!;
|
||||
|
||||
@@ -16,6 +16,8 @@ namespace WatchLog.Data
|
||||
optionsBuilder.UseSqlite(Configuration.GetConnectionString("WatchLogDB"));
|
||||
}
|
||||
|
||||
//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; }
|
||||
|
||||
Reference in New Issue
Block a user