Compare commits
25 Commits
4e3eca0650
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 594541a103 | |||
| ee7bcc1eae | |||
| 4fe354add0 | |||
| c6355d47df | |||
| 97a92269ad | |||
| 66468a1f8b | |||
| e48e8b6394 | |||
| 5f39417109 | |||
| 76e8e8daa6 | |||
| 6db2bca50b | |||
| 46491dd987 | |||
| 8edf749e23 | |||
| 3cc4fd8240 | |||
| d0f91fd0e1 | |||
| f1a68296ec | |||
| c5a3ba2b40 | |||
| 67b559e6d7 | |||
| 3c10721c4e | |||
| eec7f40e72 | |||
| 899a36a49c | |||
| 8e607ee180 | |||
| 87e6132f34 | |||
| dd845f4be6 | |||
| 6ca8fe7bdc | |||
| 56bcd712f1 |
@@ -3,7 +3,7 @@ name: Build Docker Linux ARM64
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
#- main
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build-docker-linux-arm64:
|
||||
@@ -18,11 +18,19 @@ jobs:
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Get Repository Name
|
||||
id: get_repo
|
||||
run: |
|
||||
echo "REPO_LC=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
|
||||
|
||||
- name: Build Linux ARM64 Docker Image
|
||||
run: docker build -t couchlog-linux-arm64 .
|
||||
run: |
|
||||
docker build \
|
||||
-t gitea.penry.de/${{ env.REPO_LC }}:latest \
|
||||
.
|
||||
|
||||
- name: Save Docker Image to Tar
|
||||
run: docker save -o CouchLog-Linux-ARM64-Docker-Image.tar couchlog-linux-arm64
|
||||
run: docker save -o CouchLog-Linux-ARM64-Docker-Image.tar gitea.penry.de/${{ env.REPO_LC }}:latest
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
@@ -30,4 +38,4 @@ jobs:
|
||||
name: CouchLog-Linux-ARM64-Docker-Image
|
||||
path: CouchLog-Linux-ARM64-Docker-Image.tar
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
retention-days: 5
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -2,5 +2,7 @@
|
||||
bin
|
||||
Debug
|
||||
/CouchLog/Data/CouchLog.db
|
||||
/CouchLog/Data/CouchLog.db-shm
|
||||
/CouchLog/Data/CouchLog.db-wal
|
||||
#Migrations
|
||||
obj
|
||||
|
||||
4
CouchLog/.editorconfig
Normal file
4
CouchLog/.editorconfig
Normal file
@@ -0,0 +1,4 @@
|
||||
[*.cs]
|
||||
|
||||
# IDE0130: Namespace does not match folder structure
|
||||
dotnet_diagnostic.IDE0130.severity = none
|
||||
@@ -10,10 +10,10 @@
|
||||
@inject UserManager<ApplicationUser> UserManager
|
||||
@inject IUserStore<ApplicationUser> UserStore
|
||||
@inject SignInManager<ApplicationUser> SignInManager
|
||||
@inject IEmailSender<ApplicationUser> EmailSender
|
||||
@inject ILogger<Register> Logger
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject IdentityRedirectManager RedirectManager
|
||||
@inject ApplicationDbContext CouchLogDB
|
||||
|
||||
<PageTitle>Register</PageTitle>
|
||||
|
||||
@@ -28,9 +28,9 @@
|
||||
<hr />
|
||||
<ValidationSummary class="text-danger" role="alert" />
|
||||
<div class="form-floating mb-3">
|
||||
<InputText @bind-Value="Input.Email" id="Input.Email" class="form-control" autocomplete="username" aria-required="true" placeholder="name@example.com" />
|
||||
<label for="Input.Email">Email</label>
|
||||
<ValidationMessage For="() => Input.Email" class="text-danger" />
|
||||
<InputText @bind-Value="Input.Username" id="Input.Username" class="form-control" autocomplete="username" aria-required="true" placeholder="NewUsername" />
|
||||
<label for="Input.Username">Username</label>
|
||||
<ValidationMessage For="() => Input.Username" class="text-danger" />
|
||||
</div>
|
||||
<div class="form-floating mb-3">
|
||||
<InputText type="password" @bind-Value="Input.Password" id="Input.Password" class="form-control" autocomplete="new-password" aria-required="true" placeholder="password" />
|
||||
@@ -67,11 +67,19 @@
|
||||
|
||||
public async Task RegisterUser(EditContext editContext)
|
||||
{
|
||||
if(!CouchLogDB.AccountsSettings.First().IsRegistrationAllowed)
|
||||
{
|
||||
identityErrors = new[]
|
||||
{
|
||||
new IdentityError { Description = "Registration is deactivated" }
|
||||
};
|
||||
return;
|
||||
}
|
||||
|
||||
var user = CreateUser();
|
||||
|
||||
await UserStore.SetUserNameAsync(user, Input.Email, CancellationToken.None);
|
||||
var emailStore = GetEmailStore();
|
||||
await emailStore.SetEmailAsync(user, Input.Email, CancellationToken.None);
|
||||
await UserStore.SetUserNameAsync(user, Input.Username, CancellationToken.None);
|
||||
user.EmailConfirmed = true;
|
||||
var result = await UserManager.CreateAsync(user, Input.Password);
|
||||
|
||||
if (!result.Succeeded)
|
||||
@@ -80,23 +88,24 @@
|
||||
return;
|
||||
}
|
||||
|
||||
Logger.LogInformation("User created a new account with password.");
|
||||
|
||||
var userId = await UserManager.GetUserIdAsync(user);
|
||||
var code = await UserManager.GenerateEmailConfirmationTokenAsync(user);
|
||||
code = WebEncoders.Base64UrlEncode(Encoding.UTF8.GetBytes(code));
|
||||
var callbackUrl = NavigationManager.GetUriWithQueryParameters(
|
||||
NavigationManager.ToAbsoluteUri("Account/ConfirmEmail").AbsoluteUri,
|
||||
new Dictionary<string, object?> { ["userId"] = userId, ["code"] = code, ["returnUrl"] = ReturnUrl });
|
||||
|
||||
await EmailSender.SendConfirmationLinkAsync(user, Input.Email, HtmlEncoder.Default.Encode(callbackUrl));
|
||||
|
||||
if (UserManager.Options.SignIn.RequireConfirmedAccount)
|
||||
if(CouchLogDB.CouchLogState.Count() == 0)
|
||||
{
|
||||
RedirectManager.RedirectTo(
|
||||
"Account/RegisterConfirmation",
|
||||
new() { ["email"] = Input.Email, ["returnUrl"] = ReturnUrl });
|
||||
await UserManager.AddToRoleAsync(user, "Admin");
|
||||
await CouchLogDB.CouchLogState.AddAsync(new CouchLogState
|
||||
{
|
||||
Id = 1,
|
||||
InitializationDate = DateTime.Now,
|
||||
IsInitialized = true
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
await UserManager.AddToRoleAsync(user, "User");
|
||||
}
|
||||
|
||||
await CouchLogDB.SaveChangesAsync();
|
||||
|
||||
Logger.LogInformation("User created a new account with password.");
|
||||
|
||||
await SignInManager.SignInAsync(user, isPersistent: false);
|
||||
RedirectManager.RedirectTo(ReturnUrl);
|
||||
@@ -127,9 +136,8 @@
|
||||
private sealed class InputModel
|
||||
{
|
||||
[Required]
|
||||
[EmailAddress]
|
||||
[Display(Name = "Email")]
|
||||
public string Email { get; set; } = "";
|
||||
[Display(Name = "Username")]
|
||||
public string Username { get; set; } = "";
|
||||
|
||||
[Required]
|
||||
[StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)]
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
@page "/AdminSettings/CouchLogSettings"
|
||||
@rendermode InteractiveServer
|
||||
|
||||
@using CouchLog.Data
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using Microsoft.AspNetCore.Components.Forms
|
||||
|
||||
@inject ApplicationDbContext CouchLogDB
|
||||
|
||||
<h3>CouchLog Settings</h3>
|
||||
|
||||
@if (accountsSettings is null)
|
||||
{
|
||||
<p>Lade Einstellungen…</p>
|
||||
}
|
||||
else
|
||||
{
|
||||
<EditForm Model="accountsSettings">
|
||||
<div class="form-check form-switch">
|
||||
<InputCheckbox class="form-check-input"
|
||||
role="switch"
|
||||
id="IsRegistrationallowedInput"
|
||||
Value="accountsSettings.IsRegistrationAllowed"
|
||||
ValueChanged="OnRegistrationChanged"
|
||||
ValueExpression="() => accountsSettings.IsRegistrationAllowed" />
|
||||
|
||||
|
||||
|
||||
<label class="form-check-label" for="IsRegistrationallowedInput">
|
||||
Is Registration allowed
|
||||
</label>
|
||||
</div>
|
||||
</EditForm>
|
||||
}
|
||||
|
||||
@code {
|
||||
private AccountsSettings? accountsSettings;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
accountsSettings = await CouchLogDB.AccountsSettings.FirstAsync();
|
||||
}
|
||||
|
||||
private async Task OnRegistrationChanged(bool value)
|
||||
{
|
||||
accountsSettings!.IsRegistrationAllowed = value;
|
||||
|
||||
CouchLogDB.AccountsSettings.Update(accountsSettings);
|
||||
await CouchLogDB.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
@inject ApplicationDbContext CouchLogDB
|
||||
@inject UserManager<ApplicationUser> UserManager
|
||||
@inject RoleManager<IdentityRole> RoleManager
|
||||
@inject AuthenticationStateProvider AuthenticationStateProvider
|
||||
@inject NavigationManager NavigationManager
|
||||
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
@inject SignInManager<ApplicationUser> SignInManager
|
||||
|
||||
<ul class="nav nav-pills flex-column">
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link" href="/AdminSettings/CouchLogSettings">CouchLog Settings</NavLink>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link" href="/AdminSettings/UserManagement" Match="NavLinkMatch.All">User Management</NavLink>
|
||||
</li>
|
||||
@@ -11,8 +14,5 @@
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link" href=""></NavLink>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link" href=""></NavLink>
|
||||
</li>
|
||||
-->
|
||||
</ul>
|
||||
@@ -5,6 +5,7 @@
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject AuthenticationStateProvider AuthenticationStateProvider
|
||||
@inject UserManager<ApplicationUser> UserManager
|
||||
@inject ApplicationDbContext CouchLogDB
|
||||
|
||||
<div class="top-row ps-3 navbar navbar-dark">
|
||||
<div class="container-fluid">
|
||||
@@ -58,11 +59,14 @@
|
||||
</div>
|
||||
</Authorized>
|
||||
<NotAuthorized>
|
||||
@if(CouchLogDB.AccountsSettings.First().IsRegistrationAllowed)
|
||||
{
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="Account/Register">
|
||||
<span class="bi bi-person-nav-menu" aria-hidden="true"></span> Register
|
||||
</NavLink>
|
||||
</div>
|
||||
}
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="Account/Login">
|
||||
<span class="bi bi-person-badge-nav-menu" aria-hidden="true"></span> Login
|
||||
|
||||
@@ -43,10 +43,10 @@
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="Picture" class="form-label">Picture</label>
|
||||
<InputFile OnChange="@LoadFiles" accept="image/*"/>
|
||||
@if (!string.IsNullOrEmpty(ImagePreviewUrl))
|
||||
<InputFile OnChange="@LoadImage" accept="image/*" />
|
||||
@if (!string.IsNullOrEmpty(ImageString))
|
||||
{
|
||||
<img src="@ImagePreviewUrl" style="max-width: 256px; max-height: 256px;" />
|
||||
<img src="@ImageString" style="max-width: 256px; max-height: 256px;" />
|
||||
}
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
@@ -66,12 +66,12 @@
|
||||
<!-- #endregion -->
|
||||
|
||||
<!-- #region Show Entitys -->
|
||||
<div class="row">
|
||||
<div class="row g-4">
|
||||
@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="Enity-Container" class="col-6 col-md-4 col-lg-2 col-xl-2 mb-4 Entity-Container">
|
||||
<div name="Entity-Container-Card" class="Entity-Container-Card">
|
||||
|
||||
<div class="Entity-Container-Menu-Button dropdown ms-1">
|
||||
@@ -143,14 +143,14 @@
|
||||
private List<GlobalEntity> GlobalEntities = new List<GlobalEntity>();
|
||||
private List<int> GenreIds = new List<int>();
|
||||
private HashSet<int> UserPrivateEntityIds = new();
|
||||
private string? ImagePreviewUrl;
|
||||
private IBrowserFile? Picture;
|
||||
System.Security.Claims.ClaimsPrincipal User = new();
|
||||
ApplicationUser? AppUser = new();
|
||||
ApplicationUser AppUser = null!;
|
||||
private GlobalEntity GlobalEntity = new();
|
||||
private bool isCollapseNewGlobalEntityOpen = false;
|
||||
private int SelectedMediaTypeId;
|
||||
private bool isPrivate = false;
|
||||
private string ImageString = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
@@ -159,14 +159,14 @@
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
GlobalEntities = await CouchLogDB.GlobalEntities.OrderByDescending(Entity => Entity.Id).ToListAsync();
|
||||
GlobalEntities = await CouchLogDB.GlobalEntities.OrderByDescending(Entity => Entity.CreationTime).ToListAsync();
|
||||
MediaTypes = await CouchLogDB.MediaType.OrderBy(Type => Type.Id).ToListAsync();
|
||||
Genres = await CouchLogDB.Genres.OrderBy(Genre => Genre.Id).ToListAsync();
|
||||
Genres = await CouchLogDB.Genres.OrderBy(Genre => Genre.Name).ToListAsync();
|
||||
|
||||
var AuthState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
|
||||
User = AuthState.User;
|
||||
|
||||
AppUser = await UserManager.GetUserAsync(User);
|
||||
AppUser = (await UserManager.GetUserAsync(User))!;
|
||||
|
||||
if (AppUser == null)
|
||||
{
|
||||
@@ -181,6 +181,19 @@
|
||||
UserPrivateEntityIds = TempUserPrivateEntityIds.ToHashSet();
|
||||
}
|
||||
|
||||
private async Task LoadImage(InputFileChangeEventArgs e)
|
||||
{
|
||||
Picture = e.File;
|
||||
|
||||
foreach(var file in e.GetMultipleFiles())
|
||||
{
|
||||
using var stream = file.OpenReadStream();
|
||||
using var ms = new MemoryStream();
|
||||
await stream.CopyToAsync(ms);
|
||||
ImageString = $"data:{file.ContentType};base64,{Convert.ToBase64String(ms.ToArray())}";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
||||
@@ -16,140 +16,41 @@
|
||||
<PageTitle>Private List</PageTitle>
|
||||
|
||||
<div class="container-fluid mt-4 px-4">
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h2>Private List</h2>
|
||||
</div>
|
||||
|
||||
<!-- Grid-Layout -->
|
||||
<!-- Active Watching Section -->
|
||||
@if (ActiveWatchingEntities.Any())
|
||||
{
|
||||
<div class="mb-5">
|
||||
<h2 class="mb-4">Aktiv am Schauen</h2>
|
||||
<div class="row g-4">
|
||||
@foreach (var Entity in PrivateEntities)
|
||||
@foreach (var entity in ActiveWatchingEntities)
|
||||
{
|
||||
/*
|
||||
Hier bleiben wir bei col-lg-6 (halbe Bildschirmbreite),
|
||||
wie du es im roten Kasten wolltest.
|
||||
*/
|
||||
<div class="col-12 col-lg-6 col-xxl-4">
|
||||
@RenderEntityCard(entity)
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="card shadow-sm border-0 overflow-hidden private-entity-card">
|
||||
<div class="row g-0 h-100">
|
||||
|
||||
<!-- BILD: col-auto sorgt dafür, dass sich die Breite nach CSS richtet -->
|
||||
<div class="col-auto img-wrapper">
|
||||
@if (!string.IsNullOrEmpty(Entity.GlobalEntity?.PicturePath))
|
||||
<!-- Library / Completed Section -->
|
||||
@if (LibraryEntities.Any())
|
||||
{
|
||||
<img src="/@Entity.GlobalEntity.PicturePath"
|
||||
class="entity-img"
|
||||
alt="@Entity.GlobalEntity.Title">
|
||||
}
|
||||
else
|
||||
<div class="mb-5">
|
||||
<h2 class="mb-4">Bibliothek</h2>
|
||||
<div class="row g-4">
|
||||
@foreach (var entity in LibraryEntities)
|
||||
{
|
||||
<div class="d-flex align-items-center justify-content-center h-100 bg-light text-muted small px-2">
|
||||
Kein Bild
|
||||
</div>
|
||||
@RenderEntityCard(entity)
|
||||
}
|
||||
</div>
|
||||
|
||||
<!-- INFO: 'col' nimmt automatisch den RESTLICHEN Platz ein -->
|
||||
<div class="col">
|
||||
<div class="card-body d-flex flex-column h-100 py-2 px-3">
|
||||
|
||||
<!-- Header -->
|
||||
<div class="d-flex justify-content-between align-items-start">
|
||||
<div class="overflow-hidden">
|
||||
<h5 class="card-title fw-bold mb-0 text-truncate">@Entity.GlobalEntity?.Title</h5>
|
||||
<small class="text-muted meta-text">
|
||||
@Entity.CreationTime.ToShortDateString()
|
||||
</small>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="dropdown ms-1">
|
||||
<button class="btn btn-link menu-btn" type="button" data-bs-toggle="modal" data-bs-target="#modal-@Entity.Id">
|
||||
⋮
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<select class="form-select"
|
||||
value="@Entity.UserWatchStatusId"
|
||||
@onchange="@(e => UpdateWatchStatus(Entity, e.Value))">
|
||||
|
||||
@foreach (var status in userWatchStatuses)
|
||||
@if (!PrivateEntities.Any())
|
||||
{
|
||||
<option value="@status.Id">@status.Name</option>
|
||||
}
|
||||
</select>
|
||||
|
||||
@if (Entity.GlobalEntity?.MediaType.Name == "Series")
|
||||
{
|
||||
<select class="form-select" value="@Entity.Season" @onchange="@(e => UpdateSeason(Entity, e.Value))">
|
||||
@{
|
||||
int currentSeason = Entity.Season ?? 1;
|
||||
|
||||
int startOffsetSeason = currentSeason > 1 ? -1 : 0;
|
||||
}
|
||||
|
||||
@for (int i = startOffsetSeason; i <= 5; i++)
|
||||
{
|
||||
int season = currentSeason + i;
|
||||
|
||||
<option value="@season">
|
||||
Staffel @season
|
||||
</option>
|
||||
}
|
||||
</select>
|
||||
|
||||
<select class="form-select" value="@Entity.Episode" @onchange="@(e => UpdateEpisode(Entity, e.Value))">
|
||||
@{
|
||||
int currentEpisode = Entity.Episode ?? 1;
|
||||
|
||||
int startOffsetEpisode = currentEpisode > 1 ? -1 : 0;
|
||||
}
|
||||
|
||||
@for (int i = startOffsetEpisode; i <= 5; i++)
|
||||
{
|
||||
int episode = currentEpisode + i;
|
||||
|
||||
<option value="@episode">
|
||||
Episode @episode
|
||||
</option>
|
||||
}
|
||||
</select>
|
||||
}
|
||||
|
||||
<!-- Beschreibung -->
|
||||
<!--<p class="card-text text-truncate-multiline flex-grow-1 text-muted small mt-1 mb-2">
|
||||
@(!string.IsNullOrWhiteSpace(Entity.Description)
|
||||
? Entity.Description
|
||||
: (Entity.Description ?? "Keine Beschreibung."))
|
||||
</p>
|
||||
-->
|
||||
<!-- Footer Button -->
|
||||
<div class="mt-auto d-flex justify-content-end">
|
||||
<button class="btn btn-outline-secondary btn-sm btn-details" type="button">Details</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal (unverändert) -->
|
||||
<div class="modal fade" id="modal-@Entity.Id" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Optionen</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">Optionen...</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Schließen</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center text-muted py-5">
|
||||
<p>Keine Einträge vorhanden.</p>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code
|
||||
@@ -158,6 +59,9 @@
|
||||
private List<UserWatchStatus> userWatchStatuses = new List<UserWatchStatus>();
|
||||
ApplicationUser? AppUser = new();
|
||||
|
||||
private List<PrivateEntity> ActiveWatchingEntities => PrivateEntities.Where(x => x.UserWatchStatus?.Name == "Watching").ToList();
|
||||
private List<PrivateEntity> LibraryEntities => PrivateEntities.Where(x => x.UserWatchStatus?.Name != "Watching").ToList();
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
var AuthState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
|
||||
@@ -177,29 +81,142 @@
|
||||
}
|
||||
}
|
||||
|
||||
private RenderFragment RenderEntityCard(PrivateEntity Entity) => __builder =>
|
||||
{
|
||||
<div class="col-12 col-lg-6 col-xxl-4">
|
||||
<div class="card shadow-sm border-0 overflow-hidden private-entity-card">
|
||||
<div class="row g-0 h-100">
|
||||
|
||||
<div class="col-auto" style="flex: 0 0 auto; min-width: 120px; max-width: 150px;">
|
||||
@if (!string.IsNullOrEmpty(Entity.GlobalEntity?.PicturePath))
|
||||
{
|
||||
<img src="/@Entity.GlobalEntity.PicturePath"
|
||||
class="entity-img w-100 h-100"
|
||||
style="object-fit: cover;"
|
||||
alt="@Entity.GlobalEntity.Title">
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="d-flex align-items-center justify-content-center h-100 bg-light text-muted small">
|
||||
Kein Bild
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<!-- Content -->
|
||||
<div class="col" style="min-width: 0;">
|
||||
<div class="card-body d-flex flex-column h-100 py-2 px-3">
|
||||
|
||||
<!-- Header -->
|
||||
<div class="d-flex justify-content-between align-items-start mb-2">
|
||||
<div style="min-width: 0; flex: 1;">
|
||||
<h5 class="card-title fw-bold mb-0" style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
|
||||
@Entity.GlobalEntity?.Title
|
||||
</h5>
|
||||
<small class="text-muted meta-text">
|
||||
@Entity.CreationTime.ToShortDateString()
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<div class="dropdown ms-2" style="flex-shrink: 0;">
|
||||
<button class="btn btn-link menu-btn" type="button" data-bs-toggle="modal" data-bs-target="#modal-@Entity.Id">
|
||||
⋮
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Watch Status Dropdown -->
|
||||
<select class="form-select"
|
||||
value="@Entity.UserWatchStatusId"
|
||||
@onchange="@(e => UpdateWatchStatus(Entity, e.Value))">
|
||||
@foreach (var status in userWatchStatuses)
|
||||
{
|
||||
<option value="@status.Id">@status.Name</option>
|
||||
}
|
||||
</select>
|
||||
|
||||
@if (Entity.GlobalEntity?.MediaType.Name == "Series" || Entity.GlobalEntity?.MediaType.Name == "Anime")
|
||||
{
|
||||
<select class="form-select" value="@Entity.Season" @onchange="@(e => UpdateSeason(Entity, e.Value))">
|
||||
@{
|
||||
int currentSeason = Entity.Season ?? 1;
|
||||
int startOffsetSeason = currentSeason > 1 ? -1 : 0;
|
||||
}
|
||||
@for (int i = startOffsetSeason; i <= 5; i++)
|
||||
{
|
||||
int season = currentSeason + i;
|
||||
<option value="@season">Staffel @season</option>
|
||||
}
|
||||
</select>
|
||||
|
||||
<select class="form-select" value="@Entity.Episode" @onchange="@(e => UpdateEpisode(Entity, e.Value))">
|
||||
@{
|
||||
int currentEpisode = Entity.Episode ?? 1;
|
||||
int startOffsetEpisode = currentEpisode > 1 ? -1 : 0;
|
||||
}
|
||||
@for (int i = startOffsetEpisode; i <= 5; i++)
|
||||
{
|
||||
int episode = currentEpisode + i;
|
||||
<option value="@episode">Episode @episode</option>
|
||||
}
|
||||
</select>
|
||||
}
|
||||
|
||||
<!-- Footer Button -->
|
||||
<div class="mt-auto d-flex justify-content-end">
|
||||
<button class="btn btn-outline-secondary btn-sm btn-details" type="button">Details</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="modal-@Entity.Id" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Optionen</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<button type="button" class="btn btn-danger" @onclick="@(e => RemoveEntityFromPrivateList(Entity))" data-bs-dismiss="modal">Aus PrivateList entfernen</button>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Schließen</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
};
|
||||
|
||||
private async Task RemoveEntityFromPrivateList(PrivateEntity entity)
|
||||
{
|
||||
//Delete DB
|
||||
CouchLogDB.PrivateEntities.Remove(entity);
|
||||
await CouchLogDB.SaveChangesAsync();
|
||||
|
||||
//Delete Memory List
|
||||
PrivateEntities.Remove(entity);
|
||||
}
|
||||
|
||||
private async Task UpdateWatchStatus(PrivateEntity entity, object? newValue)
|
||||
{
|
||||
// Wir holen uns die gewählte ID aus dem Dropdown
|
||||
if (int.TryParse(newValue?.ToString(), out int newId))
|
||||
{
|
||||
// 1. ID im Objekt aktualisieren
|
||||
entity.UserWatchStatusId = newId;
|
||||
|
||||
// 2. Navigation Property aktualisieren (damit die UI nicht flackert)
|
||||
// Wir suchen das passende Objekt aus der geladenen Liste
|
||||
entity.UserWatchStatus = userWatchStatuses.FirstOrDefault(s => s.Id == newId);
|
||||
|
||||
// 3. Ab in die Datenbank
|
||||
await CouchLogDB.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task UpdateSeason(PrivateEntity entity, object? newSeasonValue)
|
||||
{
|
||||
if(int.TryParse(newSeasonValue?.ToString(), out int newSeason))
|
||||
if (int.TryParse(newSeasonValue?.ToString(), out int newSeason))
|
||||
{
|
||||
entity.Season = newSeason;
|
||||
|
||||
entity.Episode = 1;
|
||||
await CouchLogDB.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
@@ -209,7 +226,6 @@
|
||||
if (int.TryParse(newEpisodeValue?.ToString(), out int newEpisode))
|
||||
{
|
||||
entity.Episode = newEpisode;
|
||||
|
||||
await CouchLogDB.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 18
|
||||
VisualStudioVersion = 18.1.11304.174 d18.0
|
||||
VisualStudioVersion = 18.1.11304.174
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CouchLog", "CouchLog.csproj", "{4FBF15C3-5FC5-4605-9EBC-3F7DA1ADC47A}"
|
||||
EndProject
|
||||
|
||||
@@ -23,5 +23,9 @@ namespace CouchLog.Data
|
||||
public DbSet<SharedListEntity> SharedListEntities { get; set; }
|
||||
public DbSet<SharedListLabel> SharedListLabels { get; set; }
|
||||
public DbSet<SharedWatchStatus> SharedWatchStatuses { get; set; }
|
||||
|
||||
//Settings
|
||||
public DbSet<CouchLogState> CouchLogState { get; set; }
|
||||
public DbSet<AccountsSettings> AccountsSettings { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,6 @@ namespace CouchLog.Data
|
||||
[ForeignKey(nameof(CreatorId))]
|
||||
public virtual ApplicationUser User { get; set; } = null!;
|
||||
|
||||
public virtual ICollection<LinkTablePrivateLabel> LinkTablePrivateLabels { get; set; } = new List<LinkTablePrivateLabel>();
|
||||
public virtual ICollection<LinkTablePrivateLabel> LinkTablePrivateLabels { get; set; } = [];
|
||||
}
|
||||
}
|
||||
13
CouchLog/Data/DatabaseModels/Settings/AccountsSettings.cs
Normal file
13
CouchLog/Data/DatabaseModels/Settings/AccountsSettings.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CouchLog.Data
|
||||
{
|
||||
public class AccountsSettings
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public bool IsRegistrationAllowed { get; set; }
|
||||
|
||||
//More Options that can be added
|
||||
}
|
||||
}
|
||||
9
CouchLog/Data/DatabaseModels/Settings/CouchLogState.cs
Normal file
9
CouchLog/Data/DatabaseModels/Settings/CouchLogState.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace CouchLog.Data
|
||||
{
|
||||
public class CouchLogState
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public bool IsInitialized { get; set; }
|
||||
public DateTime? InitializationDate { get; set; }
|
||||
}
|
||||
}
|
||||
978
CouchLog/Migrations/20251229004324_CouchLogState.Designer.cs
generated
Normal file
978
CouchLog/Migrations/20251229004324_CouchLogState.Designer.cs
generated
Normal file
@@ -0,0 +1,978 @@
|
||||
// <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("20251229004324_CouchLogState")]
|
||||
partial class CouchLogState
|
||||
{
|
||||
/// <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.CouchLogState", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime?>("InitializationDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("IsInitialized")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("CouchLogState");
|
||||
});
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
36
CouchLog/Migrations/20251229004324_CouchLogState.cs
Normal file
36
CouchLog/Migrations/20251229004324_CouchLogState.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CouchLog.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class CouchLogState : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CouchLogState",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
IsInitialized = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
InitializationDate = table.Column<DateTime>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_CouchLogState", x => x.Id);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "CouchLogState");
|
||||
}
|
||||
}
|
||||
}
|
||||
992
CouchLog/Migrations/20260103202104_AccountsSettings.Designer.cs
generated
Normal file
992
CouchLog/Migrations/20260103202104_AccountsSettings.Designer.cs
generated
Normal file
@@ -0,0 +1,992 @@
|
||||
// <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("20260103202104_AccountsSettings")]
|
||||
partial class AccountsSettings
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "10.0.1");
|
||||
|
||||
modelBuilder.Entity("CouchLog.Data.AccountsSettings", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("IsRegistrationAllowed")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("AccountsSettings");
|
||||
});
|
||||
|
||||
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.CouchLogState", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime?>("InitializationDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("IsInitialized")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("CouchLogState");
|
||||
});
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
34
CouchLog/Migrations/20260103202104_AccountsSettings.cs
Normal file
34
CouchLog/Migrations/20260103202104_AccountsSettings.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CouchLog.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AccountsSettings : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AccountsSettings",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
IsRegistrationAllowed = table.Column<bool>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AccountsSettings", x => x.Id);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "AccountsSettings");
|
||||
}
|
||||
}
|
||||
}
|
||||
992
CouchLog/Migrations/20260104151950_FixAccountsSettingsKey.Designer.cs
generated
Normal file
992
CouchLog/Migrations/20260104151950_FixAccountsSettingsKey.Designer.cs
generated
Normal file
@@ -0,0 +1,992 @@
|
||||
// <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("20260104151950_FixAccountsSettingsKey")]
|
||||
partial class FixAccountsSettingsKey
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "10.0.1");
|
||||
|
||||
modelBuilder.Entity("CouchLog.Data.AccountsSettings", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("IsRegistrationAllowed")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("AccountsSettings");
|
||||
});
|
||||
|
||||
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.CouchLogState", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime?>("InitializationDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("IsInitialized")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("CouchLogState");
|
||||
});
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
22
CouchLog/Migrations/20260104151950_FixAccountsSettingsKey.cs
Normal file
22
CouchLog/Migrations/20260104151950_FixAccountsSettingsKey.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CouchLog.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class FixAccountsSettingsKey : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,20 @@ namespace CouchLog.Migrations
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "10.0.1");
|
||||
|
||||
modelBuilder.Entity("CouchLog.Data.AccountsSettings", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("IsRegistrationAllowed")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("AccountsSettings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CouchLog.Data.ApplicationUser", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
@@ -81,6 +95,23 @@ namespace CouchLog.Migrations
|
||||
b.ToTable("AspNetUsers", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CouchLog.Data.CouchLogState", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime?>("InitializationDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("IsInitialized")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("CouchLogState");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CouchLog.Data.Genre", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
|
||||
@@ -1,23 +1,52 @@
|
||||
using CouchLog.Data;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CouchLog
|
||||
{
|
||||
public class OnStartUp
|
||||
public class OnStartUp(ApplicationDbContext CouchLogDB, RoleManager<IdentityRole> RoleManager)
|
||||
{
|
||||
private ApplicationDbContext CouchLogDB;
|
||||
private readonly ApplicationDbContext CouchLogDB = CouchLogDB;
|
||||
private readonly RoleManager<IdentityRole> RoleManager = RoleManager;
|
||||
|
||||
public OnStartUp(ApplicationDbContext CouchLogDB)
|
||||
public async Task CreateRoles()
|
||||
{
|
||||
this.CouchLogDB = CouchLogDB;
|
||||
string[] roleNames = ["Admin", "User"];
|
||||
IdentityResult roleResult;
|
||||
|
||||
foreach (var roleName in roleNames)
|
||||
{
|
||||
var roleExist = await RoleManager.RoleExistsAsync(roleName);
|
||||
if (!roleExist)
|
||||
{
|
||||
roleResult = await RoleManager.CreateAsync(new IdentityRole(roleName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void AddBasicDatabaseEntries()
|
||||
public async Task CreateStanardSettings()
|
||||
{
|
||||
if(!CouchLogDB.AccountsSettings.Any())
|
||||
{
|
||||
AccountsSettings accountsSettings = new()
|
||||
{
|
||||
Id = 1,
|
||||
IsRegistrationAllowed = true,
|
||||
};
|
||||
|
||||
await CouchLogDB.AccountsSettings.AddAsync(accountsSettings);
|
||||
|
||||
await CouchLogDB.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task AddBasicDatabaseEntries()
|
||||
{
|
||||
//##################
|
||||
//### MediaTypes ###
|
||||
//##################
|
||||
List<MediaType> MediaTypes = new List<MediaType>
|
||||
{
|
||||
List<MediaType> MediaTypes =
|
||||
[
|
||||
//Video based
|
||||
new() { Name="Movie" },
|
||||
new() { Name="Series" },
|
||||
@@ -38,21 +67,21 @@ namespace CouchLog
|
||||
//Text based
|
||||
new() { Name = "Book" },
|
||||
new() { Name = "Comic" },
|
||||
};
|
||||
];
|
||||
|
||||
foreach (MediaType MediaType in MediaTypes)
|
||||
{
|
||||
if(!CouchLogDB.MediaType.Any(m => m.Name == MediaType.Name))
|
||||
if(!await CouchLogDB.MediaType.AnyAsync(m => m.Name == MediaType.Name))
|
||||
{
|
||||
CouchLogDB.MediaType.Add(MediaType);
|
||||
await CouchLogDB.MediaType.AddAsync(MediaType);
|
||||
}
|
||||
}
|
||||
|
||||
//##############
|
||||
//### Genres ###
|
||||
//##############
|
||||
List<Genre> Genres = new List<Genre>
|
||||
{
|
||||
List<Genre> Genres =
|
||||
[
|
||||
new() { Name = "Action", CreationTime = DateTime.Now },
|
||||
new() { Name = "Animation", CreationTime = DateTime.Now },
|
||||
new() { Name = "Adventure", CreationTime = DateTime.Now },
|
||||
@@ -70,13 +99,13 @@ namespace CouchLog
|
||||
new() { Name = "Thriller", CreationTime = DateTime.Now },
|
||||
new() { Name = "War", CreationTime = DateTime.Now },
|
||||
new() { Name = "Western", CreationTime = DateTime.Now },
|
||||
};
|
||||
];
|
||||
|
||||
foreach(Genre Genre in Genres)
|
||||
{
|
||||
if(!CouchLogDB.Genres.Any(m => m.Name == Genre.Name))
|
||||
if(! await CouchLogDB.Genres.AnyAsync(m => m.Name == Genre.Name))
|
||||
{
|
||||
CouchLogDB.Genres.Add(Genre);
|
||||
await CouchLogDB.Genres.AddAsync(Genre);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,8 +113,8 @@ namespace CouchLog
|
||||
//##########################
|
||||
//### StreamingPlatforms ###
|
||||
//##########################
|
||||
List<StreamingPlatform> StreamingPlatforms = new List<StreamingPlatform>
|
||||
{
|
||||
List<StreamingPlatform> StreamingPlatforms =
|
||||
[
|
||||
new() { Name = "Netflix", PicturePath="StreamingPlatforms/Netflix.png", CreationTime = DateTime.Now },
|
||||
new() { Name = "Prime Video", PicturePath="StreamingPlatforms/Prime-Video.png", CreationTime = DateTime.Now },
|
||||
new() { Name = "Disney+", PicturePath="StreamingPlatforms/Disney+.png", CreationTime = DateTime.Now },
|
||||
@@ -93,38 +122,55 @@ namespace CouchLog
|
||||
new() { Name = "WOW TV", PicturePath="StreamingPlatforms/WOWTV.png", CreationTime = DateTime.Now },
|
||||
new() { Name = "Paramount+", PicturePath="StreamingPlatforms/Paramount+.png", CreationTime = DateTime.Now },
|
||||
new() { Name = "Joyn", PicturePath="StreamingPlatforms/Joyn.png", CreationTime = DateTime.Now },
|
||||
};
|
||||
];
|
||||
|
||||
foreach(StreamingPlatform StreamingPlatform in StreamingPlatforms)
|
||||
{
|
||||
if(!CouchLogDB.StreamingPlatforms.Any(m => m.Name == StreamingPlatform.Name))
|
||||
if(! await CouchLogDB.StreamingPlatforms.AnyAsync(m => m.Name == StreamingPlatform.Name))
|
||||
{
|
||||
CouchLogDB.StreamingPlatforms.Add(StreamingPlatform);
|
||||
await CouchLogDB.StreamingPlatforms.AddAsync(StreamingPlatform);
|
||||
}
|
||||
}
|
||||
|
||||
//##########################
|
||||
//###### WatchStates #######
|
||||
//##########################
|
||||
List<UserWatchStatus> UserWatchStatuses = new List<UserWatchStatus>
|
||||
{
|
||||
List<UserWatchStatus> UserWatchStatuses =
|
||||
[
|
||||
new() { Name = "Not watched", CreationTime = DateTime.Now },
|
||||
new() { Name = "Started", CreationTime = DateTime.Now },
|
||||
new() { Name = "Watching", CreationTime = DateTime.Now },
|
||||
new() { Name = "Finished", CreationTime = DateTime.Now },
|
||||
new() { Name = "Paused", CreationTime = DateTime.Now },
|
||||
new() { Name = "Aborted", CreationTime= DateTime.Now },
|
||||
};
|
||||
];
|
||||
|
||||
foreach(UserWatchStatus UserWatchStatus in UserWatchStatuses)
|
||||
{
|
||||
if(!CouchLogDB.UserWatchStatuses.Any(m => m.Name == UserWatchStatus.Name))
|
||||
if(! await CouchLogDB.UserWatchStatuses.AnyAsync(m => m.Name == UserWatchStatus.Name))
|
||||
{
|
||||
CouchLogDB.UserWatchStatuses.Add(UserWatchStatus);
|
||||
await CouchLogDB.UserWatchStatuses.AddAsync(UserWatchStatus);
|
||||
}
|
||||
}
|
||||
|
||||
//#################################################
|
||||
//###### Old-Things that need to be deleted #######
|
||||
//#################################################
|
||||
List<UserWatchStatus> oldUserWatchStatuses =
|
||||
[
|
||||
new() { Name = "Started" , CreationTime = DateTime.Now },
|
||||
];
|
||||
|
||||
CouchLogDB.SaveChanges();
|
||||
foreach(UserWatchStatus oldUserWatchStatus in oldUserWatchStatuses)
|
||||
{
|
||||
UserWatchStatus? toDeletedUserWatchStatus = await CouchLogDB.UserWatchStatuses.FirstOrDefaultAsync(m => m.Name == oldUserWatchStatus.Name);
|
||||
|
||||
if(toDeletedUserWatchStatus != null)
|
||||
{
|
||||
CouchLogDB.UserWatchStatuses.Remove(toDeletedUserWatchStatus);
|
||||
}
|
||||
}
|
||||
|
||||
await CouchLogDB.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,91 +65,12 @@ using (var scope = app.Services.CreateScope())
|
||||
var CouchLogDB = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
|
||||
CouchLogDB.Database.Migrate();
|
||||
|
||||
var roleManager = scope.ServiceProvider.GetRequiredService<RoleManager<IdentityRole>>();
|
||||
var userManager = scope.ServiceProvider.GetRequiredService<UserManager<ApplicationUser>>();
|
||||
var RoleManager = scope.ServiceProvider.GetRequiredService<RoleManager<IdentityRole>>();
|
||||
|
||||
string[] roleNames = { "Admin", "User" };
|
||||
IdentityResult roleResult;
|
||||
|
||||
foreach (var roleName in roleNames)
|
||||
{
|
||||
var roleExist = await roleManager.RoleExistsAsync(roleName);
|
||||
if (!roleExist)
|
||||
{
|
||||
roleResult = await roleManager.CreateAsync(new IdentityRole(roleName));
|
||||
}
|
||||
}
|
||||
|
||||
var adminUsername = "Admin";
|
||||
var normalUsername = "User";
|
||||
var adminPassword = "EinSehrSicheresPasswort123!";
|
||||
|
||||
var adminUser = await userManager.FindByNameAsync(adminUsername);
|
||||
var normalUser = await userManager.FindByNameAsync(normalUsername);
|
||||
|
||||
if (adminUser == null)
|
||||
{
|
||||
adminUser = new ApplicationUser
|
||||
{
|
||||
UserName = adminUsername,
|
||||
EmailConfirmed = true
|
||||
};
|
||||
var createResult = await userManager.CreateAsync(adminUser, adminPassword);
|
||||
|
||||
if (createResult.Succeeded)
|
||||
{
|
||||
await userManager.AddToRoleAsync(adminUser, "Admin");
|
||||
}
|
||||
}
|
||||
else if (normalUser == null)
|
||||
{
|
||||
normalUser = new ApplicationUser
|
||||
{
|
||||
UserName = normalUsername,
|
||||
EmailConfirmed = true
|
||||
};
|
||||
var createResult = await userManager.CreateAsync(normalUser, adminPassword);
|
||||
|
||||
if (createResult.Succeeded)
|
||||
{
|
||||
await userManager.AddToRoleAsync(adminUser, "User");
|
||||
}
|
||||
}
|
||||
else if (!await userManager.IsInRoleAsync(normalUser, "User"))
|
||||
{
|
||||
await userManager.AddToRoleAsync(normalUser, "User");
|
||||
}
|
||||
else if (!await userManager.IsInRoleAsync(adminUser, "Admin"))
|
||||
{
|
||||
await userManager.AddToRoleAsync(adminUser, "Admin");
|
||||
}
|
||||
|
||||
MediaType mediaType = new()
|
||||
{
|
||||
Name = "Movie"
|
||||
};
|
||||
|
||||
if (!CouchLogDB.MediaType.Any())
|
||||
CouchLogDB.MediaType.Add(mediaType);
|
||||
|
||||
await CouchLogDB.SaveChangesAsync();
|
||||
|
||||
GlobalEntity globalEntity = new()
|
||||
{
|
||||
Title = "Inception",
|
||||
CreationTime = DateTime.Now,
|
||||
CreatorId = (await userManager.FindByNameAsync("Admin"))!.Id,
|
||||
TypeId = 1,
|
||||
PicturePath = "Pictures/Inception.jpg"
|
||||
};
|
||||
|
||||
if (!CouchLogDB.GlobalEntities.Any())
|
||||
CouchLogDB.GlobalEntities.Add(globalEntity);
|
||||
|
||||
await CouchLogDB.SaveChangesAsync();
|
||||
|
||||
OnStartUp onStartUp = new(CouchLogDB);
|
||||
onStartUp.AddBasicDatabaseEntries();
|
||||
OnStartUp onStartUp = new(CouchLogDB, RoleManager);
|
||||
await onStartUp.CreateRoles();
|
||||
await onStartUp.AddBasicDatabaseEntries();
|
||||
await onStartUp.CreateStanardSettings();
|
||||
}
|
||||
|
||||
app.Run();
|
||||
Reference in New Issue
Block a user