feat: adds the possibility to make a Global Entity only for you #11

Merged
Penry merged 1 commits from PrivateGlobalEntitys into main 2025-12-22 16:44:16 +01:00
5 changed files with 1052 additions and 48 deletions
Showing only changes of commit ef2a395a5a - Show all commits

View File

@@ -56,6 +56,9 @@
<button class="btn-primary btn me-2" value="@Genre.Id" type="button" @onclick="() => AddGenreToList(Genre.Id)">@Genre.Name</button>
}
</div>
<div class="mb-3">
<InputCheckbox DisplayName="isPrivate" @bind-Value="isPrivate" ></InputCheckbox>
</div>
<button type="submit" class="btn-success btn">Create new Global Entity</button>
</EditForm>
</div>
@@ -65,6 +68,8 @@
<!-- #region Show Entitys -->
<div class="row">
@foreach (var Entity in GlobalEntities)
{
if (!Entity.IsPrivate || (Entity.IsPrivate && (Entity.CreatorId == AppUser.Id)))
{
<div name="Enity-Container" class="col-12 col-md-6 col-lg-3 mb-4 Entity-Container">
<div name="Entity-Container-Card" class="Entity-Container-Card">
@@ -126,6 +131,7 @@
</div>
</div>
}
}
</div>
<!-- #endregion -->
</div>
@@ -144,6 +150,7 @@
private GlobalEntity GlobalEntity = new();
private bool isCollapseNewGlobalEntityOpen = false;
private int SelectedMediaTypeId;
private bool isPrivate = false;
/// <summary>
///
@@ -227,6 +234,7 @@
GlobalEntity.CreatorId = AppUser.Id;
GlobalEntity.TypeId = SelectedMediaTypeId;
GlobalEntity.CreationTime = DateTime.Now;
GlobalEntity.IsPrivate = isPrivate;
CouchLogDB.Add(GlobalEntity);
await CouchLogDB.SaveChangesAsync();

View File

@@ -22,6 +22,9 @@ namespace CouchLog.Data
public DateTime? LastChange { get; set; }
[Required]
public bool IsPrivate { get; set; }
// --- Foreign Keys ---
[Required]

View File

@@ -0,0 +1,961 @@
// <auto-generated />
using System;
using CouchLog.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace CouchLog.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20251222140730_PrivateGlobalEntitys")]
partial class PrivateGlobalEntitys
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.1");
modelBuilder.Entity("CouchLog.Data.ApplicationUser", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<int>("AccessFailedCount")
.HasColumnType("INTEGER");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<bool>("EmailConfirmed")
.HasColumnType("INTEGER");
b.Property<bool>("LockoutEnabled")
.HasColumnType("INTEGER");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("TEXT");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("PasswordHash")
.HasColumnType("TEXT");
b.Property<string>("PhoneNumber")
.HasColumnType("TEXT");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("INTEGER");
b.Property<string>("SecurityStamp")
.HasColumnType("TEXT");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("INTEGER");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers", (string)null);
});
modelBuilder.Entity("CouchLog.Data.Genre", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<DateTime?>("LastChange")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Genres");
});
modelBuilder.Entity("CouchLog.Data.GlobalEntity", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<string>("CreatorId")
.IsRequired()
.HasColumnType("TEXT");
b.Property<bool>("IsPrivate")
.HasColumnType("INTEGER");
b.Property<DateTime?>("LastChange")
.HasColumnType("TEXT");
b.Property<string>("PicturePath")
.HasMaxLength(500)
.HasColumnType("TEXT");
b.Property<string>("Title")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<int>("TypeId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("CreatorId");
b.HasIndex("TypeId");
b.ToTable("GlobalEntities");
});
modelBuilder.Entity("CouchLog.Data.Label", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<string>("CreatorId")
.IsRequired()
.HasColumnType("TEXT");
b.Property<DateTime?>("LastChange")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatorId");
b.ToTable("Labels");
});
modelBuilder.Entity("CouchLog.Data.LinkTableGlobalGenre", b =>
{
b.Property<int>("GlobalEntityId")
.HasColumnType("INTEGER")
.HasColumnOrder(0);
b.Property<int>("GenreId")
.HasColumnType("INTEGER")
.HasColumnOrder(1);
b.HasKey("GlobalEntityId", "GenreId");
b.HasIndex("GenreId");
b.ToTable("LinkTableGlobalGenre");
});
modelBuilder.Entity("CouchLog.Data.LinkTablePrivateLabel", b =>
{
b.Property<int>("PrivateEntityId")
.HasColumnType("INTEGER");
b.Property<int>("LabelId")
.HasColumnType("INTEGER");
b.HasKey("PrivateEntityId", "LabelId");
b.HasIndex("LabelId");
b.ToTable("LinkTablePrivateLabel");
});
modelBuilder.Entity("CouchLog.Data.LinkTablePrivateStreamingPlatform", b =>
{
b.Property<int>("PrivateEntityId")
.HasColumnType("INTEGER");
b.Property<int>("StreamingPlatformId")
.HasColumnType("INTEGER");
b.Property<int?>("SharedListEntityId")
.HasColumnType("INTEGER");
b.HasKey("PrivateEntityId", "StreamingPlatformId");
b.HasIndex("SharedListEntityId");
b.HasIndex("StreamingPlatformId");
b.ToTable("LinkTablePrivateStreamingPlatform");
});
modelBuilder.Entity("CouchLog.Data.LinkTableSharedLabel", b =>
{
b.Property<int>("SharedListLabelId")
.HasColumnType("INTEGER");
b.Property<int>("SharedListEntityId")
.HasColumnType("INTEGER");
b.HasKey("SharedListLabelId", "SharedListEntityId");
b.HasIndex("SharedListEntityId");
b.ToTable("LinkTableSharedLabel");
});
modelBuilder.Entity("CouchLog.Data.LinkTableSharedUser", b =>
{
b.Property<int>("SharedListId")
.HasColumnType("INTEGER");
b.Property<string>("UserId")
.HasColumnType("TEXT");
b.HasKey("SharedListId", "UserId");
b.HasIndex("UserId");
b.ToTable("LinkTableSharedUser");
});
modelBuilder.Entity("CouchLog.Data.MediaType", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("MediaType");
});
modelBuilder.Entity("CouchLog.Data.PrivateEntity", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasMaxLength(1000)
.HasColumnType("TEXT");
b.Property<int?>("Episode")
.HasColumnType("INTEGER");
b.Property<bool>("Favorite")
.HasColumnType("INTEGER");
b.Property<int>("GlobalEntityId")
.HasColumnType("INTEGER");
b.Property<DateTime?>("LastChange")
.HasColumnType("TEXT");
b.Property<int?>("Rating")
.HasColumnType("INTEGER");
b.Property<int?>("Season")
.HasColumnType("INTEGER");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int?>("UserWatchStatusId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("GlobalEntityId");
b.HasIndex("UserId");
b.HasIndex("UserWatchStatusId");
b.ToTable("PrivateEntities");
});
modelBuilder.Entity("CouchLog.Data.SharedList", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<DateTime?>("LastChange")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(150)
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("SharedLists");
});
modelBuilder.Entity("CouchLog.Data.SharedListEntity", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasMaxLength(1000)
.HasColumnType("TEXT");
b.Property<int?>("Episode")
.HasColumnType("INTEGER");
b.Property<bool>("Favorite")
.HasColumnType("INTEGER");
b.Property<int>("GlobalEntityId")
.HasColumnType("INTEGER");
b.Property<DateTime?>("LastChange")
.HasColumnType("TEXT");
b.Property<int?>("Season")
.HasColumnType("INTEGER");
b.Property<int>("SharedListId")
.HasColumnType("INTEGER");
b.Property<int?>("SharedWatchStatusId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("GlobalEntityId");
b.HasIndex("SharedListId");
b.HasIndex("SharedWatchStatusId");
b.ToTable("SharedListEntities");
});
modelBuilder.Entity("CouchLog.Data.SharedListLabel", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<DateTime?>("LastChange")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int>("SharedListId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("SharedListId");
b.ToTable("SharedListLabels");
});
modelBuilder.Entity("CouchLog.Data.SharedWatchStatus", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("ColorCode")
.HasMaxLength(7)
.HasColumnType("TEXT");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<DateTime?>("LastChange")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int>("SharedListId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("SharedListId");
b.ToTable("SharedWatchStatuses");
});
modelBuilder.Entity("CouchLog.Data.StreamingPlatform", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<DateTime?>("LastChange")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("PicturePath")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("StreamingPlatforms");
});
modelBuilder.Entity("CouchLog.Data.UserWatchStatus", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("ColorCode")
.HasMaxLength(7)
.HasColumnType("TEXT");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<DateTime?>("LastChange")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("UserWatchStatuses");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("ClaimType")
.HasColumnType("TEXT");
b.Property<string>("ClaimValue")
.HasColumnType("TEXT");
b.Property<string>("RoleId")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("ClaimType")
.HasColumnType("TEXT");
b.Property<string>("ClaimValue")
.HasColumnType("TEXT");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasColumnType("TEXT");
b.Property<string>("ProviderKey")
.HasColumnType("TEXT");
b.Property<string>("ProviderDisplayName")
.HasColumnType("TEXT");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("TEXT");
b.Property<string>("RoleId")
.HasColumnType("TEXT");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("TEXT");
b.Property<string>("LoginProvider")
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens", (string)null);
});
modelBuilder.Entity("CouchLog.Data.GlobalEntity", b =>
{
b.HasOne("CouchLog.Data.ApplicationUser", "User")
.WithMany("CreatedGlobalEntities")
.HasForeignKey("CreatorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CouchLog.Data.MediaType", "MediaType")
.WithMany("GlobalEntities")
.HasForeignKey("TypeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MediaType");
b.Navigation("User");
});
modelBuilder.Entity("CouchLog.Data.Label", b =>
{
b.HasOne("CouchLog.Data.ApplicationUser", "User")
.WithMany("CreatedLabels")
.HasForeignKey("CreatorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("CouchLog.Data.LinkTableGlobalGenre", b =>
{
b.HasOne("CouchLog.Data.Genre", "Genre")
.WithMany("LinkTableGlobalGenres")
.HasForeignKey("GenreId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CouchLog.Data.GlobalEntity", "GlobalEntity")
.WithMany("LinkTableGlobalGenres")
.HasForeignKey("GlobalEntityId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Genre");
b.Navigation("GlobalEntity");
});
modelBuilder.Entity("CouchLog.Data.LinkTablePrivateLabel", b =>
{
b.HasOne("CouchLog.Data.Label", "Label")
.WithMany("LinkTablePrivateLabels")
.HasForeignKey("LabelId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CouchLog.Data.PrivateEntity", "PrivateEntity")
.WithMany("PrivateEntityLabels")
.HasForeignKey("PrivateEntityId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Label");
b.Navigation("PrivateEntity");
});
modelBuilder.Entity("CouchLog.Data.LinkTablePrivateStreamingPlatform", b =>
{
b.HasOne("CouchLog.Data.PrivateEntity", "PrivateEntity")
.WithMany("PrivateStreamingPlatforms")
.HasForeignKey("PrivateEntityId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CouchLog.Data.SharedListEntity", null)
.WithMany("LinkTablePrivateStreamingPlatforms")
.HasForeignKey("SharedListEntityId");
b.HasOne("CouchLog.Data.StreamingPlatform", "StreamingPlatform")
.WithMany()
.HasForeignKey("StreamingPlatformId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("PrivateEntity");
b.Navigation("StreamingPlatform");
});
modelBuilder.Entity("CouchLog.Data.LinkTableSharedLabel", b =>
{
b.HasOne("CouchLog.Data.SharedListEntity", "SharedListEntity")
.WithMany("LinkTableSharedLabels")
.HasForeignKey("SharedListEntityId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CouchLog.Data.SharedListLabel", "SharedListLabel")
.WithMany("LinkTableSharedLabels")
.HasForeignKey("SharedListLabelId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("SharedListEntity");
b.Navigation("SharedListLabel");
});
modelBuilder.Entity("CouchLog.Data.LinkTableSharedUser", b =>
{
b.HasOne("CouchLog.Data.SharedList", "SharedList")
.WithMany("SharedListUsers")
.HasForeignKey("SharedListId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CouchLog.Data.ApplicationUser", "User")
.WithMany("LinkTableSharedUsers")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("SharedList");
b.Navigation("User");
});
modelBuilder.Entity("CouchLog.Data.PrivateEntity", b =>
{
b.HasOne("CouchLog.Data.GlobalEntity", "GlobalEntity")
.WithMany("PrivateEntities")
.HasForeignKey("GlobalEntityId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CouchLog.Data.ApplicationUser", "User")
.WithMany("PrivateEntities")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CouchLog.Data.UserWatchStatus", "UserWatchStatus")
.WithMany()
.HasForeignKey("UserWatchStatusId");
b.Navigation("GlobalEntity");
b.Navigation("User");
b.Navigation("UserWatchStatus");
});
modelBuilder.Entity("CouchLog.Data.SharedListEntity", b =>
{
b.HasOne("CouchLog.Data.GlobalEntity", "GlobalEntity")
.WithMany("SharedListEntities")
.HasForeignKey("GlobalEntityId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CouchLog.Data.SharedList", "SharedList")
.WithMany("SharedListEntities")
.HasForeignKey("SharedListId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CouchLog.Data.SharedWatchStatus", "SharedWatchStatus")
.WithMany("SharedListEntities")
.HasForeignKey("SharedWatchStatusId");
b.Navigation("GlobalEntity");
b.Navigation("SharedList");
b.Navigation("SharedWatchStatus");
});
modelBuilder.Entity("CouchLog.Data.SharedListLabel", b =>
{
b.HasOne("CouchLog.Data.SharedList", "SharedList")
.WithMany("SharedListLabels")
.HasForeignKey("SharedListId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("SharedList");
});
modelBuilder.Entity("CouchLog.Data.SharedWatchStatus", b =>
{
b.HasOne("CouchLog.Data.SharedList", "SharedList")
.WithMany("SharedWatchStatuses")
.HasForeignKey("SharedListId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("SharedList");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.HasOne("CouchLog.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.HasOne("CouchLog.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CouchLog.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.HasOne("CouchLog.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("CouchLog.Data.ApplicationUser", b =>
{
b.Navigation("CreatedGlobalEntities");
b.Navigation("CreatedLabels");
b.Navigation("LinkTableSharedUsers");
b.Navigation("PrivateEntities");
});
modelBuilder.Entity("CouchLog.Data.Genre", b =>
{
b.Navigation("LinkTableGlobalGenres");
});
modelBuilder.Entity("CouchLog.Data.GlobalEntity", b =>
{
b.Navigation("LinkTableGlobalGenres");
b.Navigation("PrivateEntities");
b.Navigation("SharedListEntities");
});
modelBuilder.Entity("CouchLog.Data.Label", b =>
{
b.Navigation("LinkTablePrivateLabels");
});
modelBuilder.Entity("CouchLog.Data.MediaType", b =>
{
b.Navigation("GlobalEntities");
});
modelBuilder.Entity("CouchLog.Data.PrivateEntity", b =>
{
b.Navigation("PrivateEntityLabels");
b.Navigation("PrivateStreamingPlatforms");
});
modelBuilder.Entity("CouchLog.Data.SharedList", b =>
{
b.Navigation("SharedListEntities");
b.Navigation("SharedListLabels");
b.Navigation("SharedListUsers");
b.Navigation("SharedWatchStatuses");
});
modelBuilder.Entity("CouchLog.Data.SharedListEntity", b =>
{
b.Navigation("LinkTablePrivateStreamingPlatforms");
b.Navigation("LinkTableSharedLabels");
});
modelBuilder.Entity("CouchLog.Data.SharedListLabel", b =>
{
b.Navigation("LinkTableSharedLabels");
});
modelBuilder.Entity("CouchLog.Data.SharedWatchStatus", b =>
{
b.Navigation("SharedListEntities");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CouchLog.Migrations
{
/// <inheritdoc />
public partial class PrivateGlobalEntitys : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsPrivate",
table: "GlobalEntities",
type: "INTEGER",
nullable: false,
defaultValue: false);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsPrivate",
table: "GlobalEntities");
}
}
}

View File

@@ -15,7 +15,7 @@ namespace CouchLog.Migrations
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.0");
modelBuilder.HasAnnotation("ProductVersion", "10.0.1");
modelBuilder.Entity("CouchLog.Data.ApplicationUser", b =>
{
@@ -116,6 +116,9 @@ namespace CouchLog.Migrations
.IsRequired()
.HasColumnType("TEXT");
b.Property<bool>("IsPrivate")
.HasColumnType("INTEGER");
b.Property<DateTime?>("LastChange")
.HasColumnType("TEXT");